clang 19.0.0git
avx512fintrin.h
Go to the documentation of this file.
1/*===---- avx512fintrin.h - AVX512F intrinsics -----------------------------===
2 *
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
6 *
7 *===-----------------------------------------------------------------------===
8 */
9#ifndef __IMMINTRIN_H
10#error "Never use <avx512fintrin.h> directly; include <immintrin.h> instead."
11#endif
12
13#ifndef __AVX512FINTRIN_H
14#define __AVX512FINTRIN_H
15
16typedef char __v64qi __attribute__((__vector_size__(64)));
17typedef short __v32hi __attribute__((__vector_size__(64)));
18typedef double __v8df __attribute__((__vector_size__(64)));
19typedef float __v16sf __attribute__((__vector_size__(64)));
20typedef long long __v8di __attribute__((__vector_size__(64)));
21typedef int __v16si __attribute__((__vector_size__(64)));
22
23/* Unsigned types */
24typedef unsigned char __v64qu __attribute__((__vector_size__(64)));
25typedef unsigned short __v32hu __attribute__((__vector_size__(64)));
26typedef unsigned long long __v8du __attribute__((__vector_size__(64)));
27typedef unsigned int __v16su __attribute__((__vector_size__(64)));
28
29/* We need an explicitly signed variant for char. Note that this shouldn't
30 * appear in the interface though. */
31typedef signed char __v64qs __attribute__((__vector_size__(64)));
32
33typedef float __m512 __attribute__((__vector_size__(64), __aligned__(64)));
34typedef double __m512d __attribute__((__vector_size__(64), __aligned__(64)));
35typedef long long __m512i __attribute__((__vector_size__(64), __aligned__(64)));
36
37typedef float __m512_u __attribute__((__vector_size__(64), __aligned__(1)));
38typedef double __m512d_u __attribute__((__vector_size__(64), __aligned__(1)));
39typedef long long __m512i_u __attribute__((__vector_size__(64), __aligned__(1)));
40
41typedef unsigned char __mmask8;
42typedef unsigned short __mmask16;
43
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
50
51/* Constants for integer comparison predicates */
52typedef enum {
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 */
63
64typedef enum
65{
151 _MM_PERM_DDDD = 0xFF
153
154typedef enum
155{
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) */
161
162typedef enum
163{
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 */
168
169/* Define the default attributes for the functions in this file. */
170#define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512f,evex512"), __min_vector_width__(512)))
171#define __DEFAULT_FN_ATTRS128 \
172 __attribute__((__always_inline__, __nodebug__, \
173 __target__("avx512f,no-evex512"), __min_vector_width__(128)))
174#define __DEFAULT_FN_ATTRS \
175 __attribute__((__always_inline__, __nodebug__, \
176 __target__("avx512f,no-evex512")))
177
178/* Create vectors with repeated elements */
179
180static __inline __m512i __DEFAULT_FN_ATTRS512
182{
183 return __extension__ (__m512i)(__v8di){ 0, 0, 0, 0, 0, 0, 0, 0 };
184}
185
186#define _mm512_setzero_epi32 _mm512_setzero_si512
187
188static __inline__ __m512d __DEFAULT_FN_ATTRS512
190{
191 return (__m512d)__builtin_ia32_undef512();
192}
193
194static __inline__ __m512 __DEFAULT_FN_ATTRS512
196{
197 return (__m512)__builtin_ia32_undef512();
198}
199
200static __inline__ __m512 __DEFAULT_FN_ATTRS512
202{
203 return (__m512)__builtin_ia32_undef512();
204}
205
206static __inline__ __m512i __DEFAULT_FN_ATTRS512
208{
209 return (__m512i)__builtin_ia32_undef512();
210}
211
212static __inline__ __m512i __DEFAULT_FN_ATTRS512
214{
215 return (__m512i)__builtin_shufflevector((__v4si) __A, (__v4si) __A,
216 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
217}
218
219static __inline__ __m512i __DEFAULT_FN_ATTRS512
220_mm512_mask_broadcastd_epi32 (__m512i __O, __mmask16 __M, __m128i __A)
221{
222 return (__m512i)__builtin_ia32_selectd_512(__M,
223 (__v16si) _mm512_broadcastd_epi32(__A),
224 (__v16si) __O);
225}
226
227static __inline__ __m512i __DEFAULT_FN_ATTRS512
229{
230 return (__m512i)__builtin_ia32_selectd_512(__M,
231 (__v16si) _mm512_broadcastd_epi32(__A),
232 (__v16si) _mm512_setzero_si512());
233}
234
235static __inline__ __m512i __DEFAULT_FN_ATTRS512
237{
238 return (__m512i)__builtin_shufflevector((__v2di) __A, (__v2di) __A,
239 0, 0, 0, 0, 0, 0, 0, 0);
240}
241
242static __inline__ __m512i __DEFAULT_FN_ATTRS512
243_mm512_mask_broadcastq_epi64 (__m512i __O, __mmask8 __M, __m128i __A)
244{
245 return (__m512i)__builtin_ia32_selectq_512(__M,
246 (__v8di) _mm512_broadcastq_epi64(__A),
247 (__v8di) __O);
248
249}
250
251static __inline__ __m512i __DEFAULT_FN_ATTRS512
253{
254 return (__m512i)__builtin_ia32_selectq_512(__M,
255 (__v8di) _mm512_broadcastq_epi64(__A),
256 (__v8di) _mm512_setzero_si512());
257}
258
259
260static __inline __m512 __DEFAULT_FN_ATTRS512
262{
263 return __extension__ (__m512){ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
264 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
265}
266
267#define _mm512_setzero _mm512_setzero_ps
268
269static __inline __m512d __DEFAULT_FN_ATTRS512
271{
272 return __extension__ (__m512d){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
273}
274
275static __inline __m512 __DEFAULT_FN_ATTRS512
277{
278 return __extension__ (__m512){ __w, __w, __w, __w, __w, __w, __w, __w,
279 __w, __w, __w, __w, __w, __w, __w, __w };
280}
281
282static __inline __m512d __DEFAULT_FN_ATTRS512
283_mm512_set1_pd(double __w)
284{
285 return __extension__ (__m512d){ __w, __w, __w, __w, __w, __w, __w, __w };
286}
287
288static __inline __m512i __DEFAULT_FN_ATTRS512
290{
291 return __extension__ (__m512i)(__v64qi){
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,
296 __w, __w, __w, __w, __w, __w, __w, __w,
297 __w, __w, __w, __w, __w, __w, __w, __w,
298 __w, __w, __w, __w, __w, __w, __w, __w,
299 __w, __w, __w, __w, __w, __w, __w, __w };
300}
301
302static __inline __m512i __DEFAULT_FN_ATTRS512
304{
305 return __extension__ (__m512i)(__v32hi){
306 __w, __w, __w, __w, __w, __w, __w, __w,
307 __w, __w, __w, __w, __w, __w, __w, __w,
308 __w, __w, __w, __w, __w, __w, __w, __w,
309 __w, __w, __w, __w, __w, __w, __w, __w };
310}
311
312static __inline __m512i __DEFAULT_FN_ATTRS512
314{
315 return __extension__ (__m512i)(__v16si){
316 __s, __s, __s, __s, __s, __s, __s, __s,
317 __s, __s, __s, __s, __s, __s, __s, __s };
318}
319
320static __inline __m512i __DEFAULT_FN_ATTRS512
322{
323 return (__m512i)__builtin_ia32_selectd_512(__M,
324 (__v16si)_mm512_set1_epi32(__A),
325 (__v16si)_mm512_setzero_si512());
326}
327
328static __inline __m512i __DEFAULT_FN_ATTRS512
329_mm512_set1_epi64(long long __d)
330{
331 return __extension__(__m512i)(__v8di){ __d, __d, __d, __d, __d, __d, __d, __d };
332}
333
334static __inline __m512i __DEFAULT_FN_ATTRS512
336{
337 return (__m512i)__builtin_ia32_selectq_512(__M,
338 (__v8di)_mm512_set1_epi64(__A),
339 (__v8di)_mm512_setzero_si512());
340}
341
342static __inline__ __m512 __DEFAULT_FN_ATTRS512
344{
345 return (__m512)__builtin_shufflevector((__v4sf) __A, (__v4sf) __A,
346 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
347}
348
349static __inline __m512i __DEFAULT_FN_ATTRS512
350_mm512_set4_epi32 (int __A, int __B, int __C, int __D)
351{
352 return __extension__ (__m512i)(__v16si)
353 { __D, __C, __B, __A, __D, __C, __B, __A,
354 __D, __C, __B, __A, __D, __C, __B, __A };
355}
356
357static __inline __m512i __DEFAULT_FN_ATTRS512
358_mm512_set4_epi64 (long long __A, long long __B, long long __C,
359 long long __D)
360{
361 return __extension__ (__m512i) (__v8di)
362 { __D, __C, __B, __A, __D, __C, __B, __A };
363}
364
365static __inline __m512d __DEFAULT_FN_ATTRS512
366_mm512_set4_pd (double __A, double __B, double __C, double __D)
367{
368 return __extension__ (__m512d)
369 { __D, __C, __B, __A, __D, __C, __B, __A };
370}
371
372static __inline __m512 __DEFAULT_FN_ATTRS512
373_mm512_set4_ps (float __A, float __B, float __C, float __D)
374{
375 return __extension__ (__m512)
376 { __D, __C, __B, __A, __D, __C, __B, __A,
377 __D, __C, __B, __A, __D, __C, __B, __A };
378}
379
380#define _mm512_setr4_epi32(e0,e1,e2,e3) \
381 _mm512_set4_epi32((e3),(e2),(e1),(e0))
382
383#define _mm512_setr4_epi64(e0,e1,e2,e3) \
384 _mm512_set4_epi64((e3),(e2),(e1),(e0))
385
386#define _mm512_setr4_pd(e0,e1,e2,e3) \
387 _mm512_set4_pd((e3),(e2),(e1),(e0))
388
389#define _mm512_setr4_ps(e0,e1,e2,e3) \
390 _mm512_set4_ps((e3),(e2),(e1),(e0))
391
392static __inline__ __m512d __DEFAULT_FN_ATTRS512
394{
395 return (__m512d)__builtin_shufflevector((__v2df) __A, (__v2df) __A,
396 0, 0, 0, 0, 0, 0, 0, 0);
397}
398
399/* Cast between vector types */
400
401static __inline __m512d __DEFAULT_FN_ATTRS512
403{
404 return __builtin_shufflevector(__a, __builtin_nondeterministic_value(__a), 0,
405 1, 2, 3, 4, 5, 6, 7);
406}
407
408static __inline __m512 __DEFAULT_FN_ATTRS512
410{
411 return __builtin_shufflevector(__a, __builtin_nondeterministic_value(__a), 0,
412 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
413}
414
415static __inline __m128d __DEFAULT_FN_ATTRS512
417{
418 return __builtin_shufflevector(__a, __a, 0, 1);
419}
420
421static __inline __m256d __DEFAULT_FN_ATTRS512
423{
424 return __builtin_shufflevector(__A, __A, 0, 1, 2, 3);
425}
426
427static __inline __m128 __DEFAULT_FN_ATTRS512
429{
430 return __builtin_shufflevector(__a, __a, 0, 1, 2, 3);
431}
432
433static __inline __m256 __DEFAULT_FN_ATTRS512
435{
436 return __builtin_shufflevector(__A, __A, 0, 1, 2, 3, 4, 5, 6, 7);
437}
438
439static __inline __m512 __DEFAULT_FN_ATTRS512
440_mm512_castpd_ps (__m512d __A)
441{
442 return (__m512) (__A);
443}
444
445static __inline __m512i __DEFAULT_FN_ATTRS512
447{
448 return (__m512i) (__A);
449}
450
451static __inline__ __m512d __DEFAULT_FN_ATTRS512
453{
454 __m256d __B = __builtin_nondeterministic_value(__B);
455 return __builtin_shufflevector(
456 __builtin_shufflevector(__A, __builtin_nondeterministic_value(__A), 0, 1, 2, 3),
457 __B, 0, 1, 2, 3, 4, 5, 6, 7);
458}
459
460static __inline __m512d __DEFAULT_FN_ATTRS512
462{
463 return (__m512d) (__A);
464}
465
466static __inline __m512i __DEFAULT_FN_ATTRS512
468{
469 return (__m512i) (__A);
470}
471
472static __inline__ __m512 __DEFAULT_FN_ATTRS512
474{
475 __m256 __B = __builtin_nondeterministic_value(__B);
476 return __builtin_shufflevector(
477 __builtin_shufflevector(__A, __builtin_nondeterministic_value(__A), 0, 1, 2, 3, 4, 5, 6, 7),
478 __B, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
479}
480
481static __inline__ __m512i __DEFAULT_FN_ATTRS512
483{
484 __m256i __B = __builtin_nondeterministic_value(__B);
485 return __builtin_shufflevector(
486 __builtin_shufflevector(__A, __builtin_nondeterministic_value(__A), 0, 1, 2, 3),
487 __B, 0, 1, 2, 3, 4, 5, 6, 7);
488}
489
490static __inline__ __m512i __DEFAULT_FN_ATTRS512
492{
493 return __builtin_shufflevector( __A, __builtin_nondeterministic_value(__A), 0, 1, 2, 3, 4, 5, 6, 7);
494}
495
496static __inline __m512 __DEFAULT_FN_ATTRS512
498{
499 return (__m512) (__A);
500}
501
502static __inline __m512d __DEFAULT_FN_ATTRS512
504{
505 return (__m512d) (__A);
506}
507
508static __inline __m128i __DEFAULT_FN_ATTRS512
510{
511 return (__m128i)__builtin_shufflevector(__A, __A , 0, 1);
512}
513
514static __inline __m256i __DEFAULT_FN_ATTRS512
516{
517 return (__m256i)__builtin_shufflevector(__A, __A , 0, 1, 2, 3);
518}
519
520static __inline__ __mmask16 __DEFAULT_FN_ATTRS
522{
523 return (__mmask16)__a;
524}
525
526static __inline__ int __DEFAULT_FN_ATTRS
528{
529 return (int)__a;
530}
531
532/// Constructs a 512-bit floating-point vector of [8 x double] from a
533/// 128-bit floating-point vector of [2 x double]. The lower 128 bits
534/// contain the value of the source vector. The upper 384 bits are set
535/// to zero.
536///
537/// \headerfile <x86intrin.h>
538///
539/// This intrinsic has no corresponding instruction.
540///
541/// \param __a
542/// A 128-bit vector of [2 x double].
543/// \returns A 512-bit floating-point vector of [8 x double]. The lower 128 bits
544/// contain the value of the parameter. The upper 384 bits are set to zero.
545static __inline __m512d __DEFAULT_FN_ATTRS512
547{
548 return __builtin_shufflevector((__v2df)__a, (__v2df)_mm_setzero_pd(), 0, 1, 2, 3, 2, 3, 2, 3);
549}
550
551/// Constructs a 512-bit floating-point vector of [8 x double] from a
552/// 256-bit floating-point vector of [4 x double]. The lower 256 bits
553/// contain the value of the source vector. The upper 256 bits are set
554/// to zero.
555///
556/// \headerfile <x86intrin.h>
557///
558/// This intrinsic has no corresponding instruction.
559///
560/// \param __a
561/// A 256-bit vector of [4 x double].
562/// \returns A 512-bit floating-point vector of [8 x double]. The lower 256 bits
563/// contain the value of the parameter. The upper 256 bits are set to zero.
564static __inline __m512d __DEFAULT_FN_ATTRS512
566{
567 return __builtin_shufflevector((__v4df)__a, (__v4df)_mm256_setzero_pd(), 0, 1, 2, 3, 4, 5, 6, 7);
568}
569
570/// Constructs a 512-bit floating-point vector of [16 x float] from a
571/// 128-bit floating-point vector of [4 x float]. The lower 128 bits contain
572/// the value of the source vector. The upper 384 bits are set to zero.
573///
574/// \headerfile <x86intrin.h>
575///
576/// This intrinsic has no corresponding instruction.
577///
578/// \param __a
579/// A 128-bit vector of [4 x float].
580/// \returns A 512-bit floating-point vector of [16 x float]. The lower 128 bits
581/// contain the value of the parameter. The upper 384 bits are set to zero.
582static __inline __m512 __DEFAULT_FN_ATTRS512
584{
585 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);
586}
587
588/// Constructs a 512-bit floating-point vector of [16 x float] from a
589/// 256-bit floating-point vector of [8 x float]. The lower 256 bits contain
590/// the value of the source vector. The upper 256 bits are set to zero.
591///
592/// \headerfile <x86intrin.h>
593///
594/// This intrinsic has no corresponding instruction.
595///
596/// \param __a
597/// A 256-bit vector of [8 x float].
598/// \returns A 512-bit floating-point vector of [16 x float]. The lower 256 bits
599/// contain the value of the parameter. The upper 256 bits are set to zero.
600static __inline __m512 __DEFAULT_FN_ATTRS512
602{
603 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);
604}
605
606/// Constructs a 512-bit integer vector from a 128-bit integer vector.
607/// The lower 128 bits contain the value of the source vector. The upper
608/// 384 bits are set to zero.
609///
610/// \headerfile <x86intrin.h>
611///
612/// This intrinsic has no corresponding instruction.
613///
614/// \param __a
615/// A 128-bit integer vector.
616/// \returns A 512-bit integer vector. The lower 128 bits contain the value of
617/// the parameter. The upper 384 bits are set to zero.
618static __inline __m512i __DEFAULT_FN_ATTRS512
620{
621 return __builtin_shufflevector((__v2di)__a, (__v2di)_mm_setzero_si128(), 0, 1, 2, 3, 2, 3, 2, 3);
622}
623
624/// Constructs a 512-bit integer vector from a 256-bit integer vector.
625/// The lower 256 bits contain the value of the source vector. The upper
626/// 256 bits are set to zero.
627///
628/// \headerfile <x86intrin.h>
629///
630/// This intrinsic has no corresponding instruction.
631///
632/// \param __a
633/// A 256-bit integer vector.
634/// \returns A 512-bit integer vector. The lower 256 bits contain the value of
635/// the parameter. The upper 256 bits are set to zero.
636static __inline __m512i __DEFAULT_FN_ATTRS512
638{
639 return __builtin_shufflevector((__v4di)__a, (__v4di)_mm256_setzero_si256(), 0, 1, 2, 3, 4, 5, 6, 7);
640}
641
642/* Bitwise operators */
643static __inline__ __m512i __DEFAULT_FN_ATTRS512
644_mm512_and_epi32(__m512i __a, __m512i __b)
645{
646 return (__m512i)((__v16su)__a & (__v16su)__b);
647}
648
649static __inline__ __m512i __DEFAULT_FN_ATTRS512
650_mm512_mask_and_epi32(__m512i __src, __mmask16 __k, __m512i __a, __m512i __b)
651{
652 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__k,
653 (__v16si) _mm512_and_epi32(__a, __b),
654 (__v16si) __src);
655}
656
657static __inline__ __m512i __DEFAULT_FN_ATTRS512
659{
661 __k, __a, __b);
662}
663
664static __inline__ __m512i __DEFAULT_FN_ATTRS512
665_mm512_and_epi64(__m512i __a, __m512i __b)
666{
667 return (__m512i)((__v8du)__a & (__v8du)__b);
668}
669
670static __inline__ __m512i __DEFAULT_FN_ATTRS512
671_mm512_mask_and_epi64(__m512i __src, __mmask8 __k, __m512i __a, __m512i __b)
672{
673 return (__m512i) __builtin_ia32_selectq_512 ((__mmask8) __k,
674 (__v8di) _mm512_and_epi64(__a, __b),
675 (__v8di) __src);
676}
677
678static __inline__ __m512i __DEFAULT_FN_ATTRS512
680{
682 __k, __a, __b);
683}
684
685static __inline__ __m512i __DEFAULT_FN_ATTRS512
686_mm512_andnot_si512 (__m512i __A, __m512i __B)
687{
688 return (__m512i)(~(__v8du)__A & (__v8du)__B);
689}
690
691static __inline__ __m512i __DEFAULT_FN_ATTRS512
692_mm512_andnot_epi32 (__m512i __A, __m512i __B)
693{
694 return (__m512i)(~(__v16su)__A & (__v16su)__B);
695}
696
697static __inline__ __m512i __DEFAULT_FN_ATTRS512
698_mm512_mask_andnot_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
699{
700 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
701 (__v16si)_mm512_andnot_epi32(__A, __B),
702 (__v16si)__W);
703}
704
705static __inline__ __m512i __DEFAULT_FN_ATTRS512
706_mm512_maskz_andnot_epi32(__mmask16 __U, __m512i __A, __m512i __B)
707{
709 __U, __A, __B);
710}
711
712static __inline__ __m512i __DEFAULT_FN_ATTRS512
713_mm512_andnot_epi64(__m512i __A, __m512i __B)
714{
715 return (__m512i)(~(__v8du)__A & (__v8du)__B);
716}
717
718static __inline__ __m512i __DEFAULT_FN_ATTRS512
719_mm512_mask_andnot_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
720{
721 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
722 (__v8di)_mm512_andnot_epi64(__A, __B),
723 (__v8di)__W);
724}
725
726static __inline__ __m512i __DEFAULT_FN_ATTRS512
727_mm512_maskz_andnot_epi64(__mmask8 __U, __m512i __A, __m512i __B)
728{
730 __U, __A, __B);
731}
732
733static __inline__ __m512i __DEFAULT_FN_ATTRS512
734_mm512_or_epi32(__m512i __a, __m512i __b)
735{
736 return (__m512i)((__v16su)__a | (__v16su)__b);
737}
738
739static __inline__ __m512i __DEFAULT_FN_ATTRS512
740_mm512_mask_or_epi32(__m512i __src, __mmask16 __k, __m512i __a, __m512i __b)
741{
742 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__k,
743 (__v16si)_mm512_or_epi32(__a, __b),
744 (__v16si)__src);
745}
746
747static __inline__ __m512i __DEFAULT_FN_ATTRS512
749{
750 return (__m512i)_mm512_mask_or_epi32(_mm512_setzero_si512(), __k, __a, __b);
751}
752
753static __inline__ __m512i __DEFAULT_FN_ATTRS512
754_mm512_or_epi64(__m512i __a, __m512i __b)
755{
756 return (__m512i)((__v8du)__a | (__v8du)__b);
757}
758
759static __inline__ __m512i __DEFAULT_FN_ATTRS512
760_mm512_mask_or_epi64(__m512i __src, __mmask8 __k, __m512i __a, __m512i __b)
761{
762 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__k,
763 (__v8di)_mm512_or_epi64(__a, __b),
764 (__v8di)__src);
765}
766
767static __inline__ __m512i __DEFAULT_FN_ATTRS512
768_mm512_maskz_or_epi64(__mmask8 __k, __m512i __a, __m512i __b)
769{
770 return (__m512i)_mm512_mask_or_epi64(_mm512_setzero_si512(), __k, __a, __b);
771}
772
773static __inline__ __m512i __DEFAULT_FN_ATTRS512
774_mm512_xor_epi32(__m512i __a, __m512i __b)
775{
776 return (__m512i)((__v16su)__a ^ (__v16su)__b);
777}
778
779static __inline__ __m512i __DEFAULT_FN_ATTRS512
780_mm512_mask_xor_epi32(__m512i __src, __mmask16 __k, __m512i __a, __m512i __b)
781{
782 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__k,
783 (__v16si)_mm512_xor_epi32(__a, __b),
784 (__v16si)__src);
785}
786
787static __inline__ __m512i __DEFAULT_FN_ATTRS512
789{
790 return (__m512i)_mm512_mask_xor_epi32(_mm512_setzero_si512(), __k, __a, __b);
791}
792
793static __inline__ __m512i __DEFAULT_FN_ATTRS512
794_mm512_xor_epi64(__m512i __a, __m512i __b)
795{
796 return (__m512i)((__v8du)__a ^ (__v8du)__b);
797}
798
799static __inline__ __m512i __DEFAULT_FN_ATTRS512
800_mm512_mask_xor_epi64(__m512i __src, __mmask8 __k, __m512i __a, __m512i __b)
801{
802 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__k,
803 (__v8di)_mm512_xor_epi64(__a, __b),
804 (__v8di)__src);
805}
806
807static __inline__ __m512i __DEFAULT_FN_ATTRS512
809{
810 return (__m512i)_mm512_mask_xor_epi64(_mm512_setzero_si512(), __k, __a, __b);
811}
812
813static __inline__ __m512i __DEFAULT_FN_ATTRS512
814_mm512_and_si512(__m512i __a, __m512i __b)
815{
816 return (__m512i)((__v8du)__a & (__v8du)__b);
817}
818
819static __inline__ __m512i __DEFAULT_FN_ATTRS512
820_mm512_or_si512(__m512i __a, __m512i __b)
821{
822 return (__m512i)((__v8du)__a | (__v8du)__b);
823}
824
825static __inline__ __m512i __DEFAULT_FN_ATTRS512
826_mm512_xor_si512(__m512i __a, __m512i __b)
827{
828 return (__m512i)((__v8du)__a ^ (__v8du)__b);
829}
830
831/* Arithmetic */
832
833static __inline __m512d __DEFAULT_FN_ATTRS512
834_mm512_add_pd(__m512d __a, __m512d __b)
835{
836 return (__m512d)((__v8df)__a + (__v8df)__b);
837}
838
839static __inline __m512 __DEFAULT_FN_ATTRS512
840_mm512_add_ps(__m512 __a, __m512 __b)
841{
842 return (__m512)((__v16sf)__a + (__v16sf)__b);
843}
844
845static __inline __m512d __DEFAULT_FN_ATTRS512
846_mm512_mul_pd(__m512d __a, __m512d __b)
847{
848 return (__m512d)((__v8df)__a * (__v8df)__b);
849}
850
851static __inline __m512 __DEFAULT_FN_ATTRS512
852_mm512_mul_ps(__m512 __a, __m512 __b)
853{
854 return (__m512)((__v16sf)__a * (__v16sf)__b);
855}
856
857static __inline __m512d __DEFAULT_FN_ATTRS512
858_mm512_sub_pd(__m512d __a, __m512d __b)
859{
860 return (__m512d)((__v8df)__a - (__v8df)__b);
861}
862
863static __inline __m512 __DEFAULT_FN_ATTRS512
864_mm512_sub_ps(__m512 __a, __m512 __b)
865{
866 return (__m512)((__v16sf)__a - (__v16sf)__b);
867}
868
869static __inline__ __m512i __DEFAULT_FN_ATTRS512
870_mm512_add_epi64 (__m512i __A, __m512i __B)
871{
872 return (__m512i) ((__v8du) __A + (__v8du) __B);
873}
874
875static __inline__ __m512i __DEFAULT_FN_ATTRS512
876_mm512_mask_add_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
877{
878 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
879 (__v8di)_mm512_add_epi64(__A, __B),
880 (__v8di)__W);
881}
882
883static __inline__ __m512i __DEFAULT_FN_ATTRS512
884_mm512_maskz_add_epi64(__mmask8 __U, __m512i __A, __m512i __B)
885{
886 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
887 (__v8di)_mm512_add_epi64(__A, __B),
888 (__v8di)_mm512_setzero_si512());
889}
890
891static __inline__ __m512i __DEFAULT_FN_ATTRS512
892_mm512_sub_epi64 (__m512i __A, __m512i __B)
893{
894 return (__m512i) ((__v8du) __A - (__v8du) __B);
895}
896
897static __inline__ __m512i __DEFAULT_FN_ATTRS512
898_mm512_mask_sub_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
899{
900 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
901 (__v8di)_mm512_sub_epi64(__A, __B),
902 (__v8di)__W);
903}
904
905static __inline__ __m512i __DEFAULT_FN_ATTRS512
906_mm512_maskz_sub_epi64(__mmask8 __U, __m512i __A, __m512i __B)
907{
908 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
909 (__v8di)_mm512_sub_epi64(__A, __B),
910 (__v8di)_mm512_setzero_si512());
911}
912
913static __inline__ __m512i __DEFAULT_FN_ATTRS512
914_mm512_add_epi32 (__m512i __A, __m512i __B)
915{
916 return (__m512i) ((__v16su) __A + (__v16su) __B);
917}
918
919static __inline__ __m512i __DEFAULT_FN_ATTRS512
920_mm512_mask_add_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
921{
922 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
923 (__v16si)_mm512_add_epi32(__A, __B),
924 (__v16si)__W);
925}
926
927static __inline__ __m512i __DEFAULT_FN_ATTRS512
928_mm512_maskz_add_epi32 (__mmask16 __U, __m512i __A, __m512i __B)
929{
930 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
931 (__v16si)_mm512_add_epi32(__A, __B),
932 (__v16si)_mm512_setzero_si512());
933}
934
935static __inline__ __m512i __DEFAULT_FN_ATTRS512
936_mm512_sub_epi32 (__m512i __A, __m512i __B)
937{
938 return (__m512i) ((__v16su) __A - (__v16su) __B);
939}
940
941static __inline__ __m512i __DEFAULT_FN_ATTRS512
942_mm512_mask_sub_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
943{
944 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
945 (__v16si)_mm512_sub_epi32(__A, __B),
946 (__v16si)__W);
947}
948
949static __inline__ __m512i __DEFAULT_FN_ATTRS512
950_mm512_maskz_sub_epi32(__mmask16 __U, __m512i __A, __m512i __B)
951{
952 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
953 (__v16si)_mm512_sub_epi32(__A, __B),
954 (__v16si)_mm512_setzero_si512());
955}
956
957#define _mm512_max_round_pd(A, B, R) \
958 ((__m512d)__builtin_ia32_maxpd512((__v8df)(__m512d)(A), \
959 (__v8df)(__m512d)(B), (int)(R)))
960
961#define _mm512_mask_max_round_pd(W, U, A, B, R) \
962 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
963 (__v8df)_mm512_max_round_pd((A), (B), (R)), \
964 (__v8df)(W)))
965
966#define _mm512_maskz_max_round_pd(U, A, B, R) \
967 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
968 (__v8df)_mm512_max_round_pd((A), (B), (R)), \
969 (__v8df)_mm512_setzero_pd()))
970
971static __inline__ __m512d __DEFAULT_FN_ATTRS512
972_mm512_max_pd(__m512d __A, __m512d __B)
973{
974 return (__m512d) __builtin_ia32_maxpd512((__v8df) __A, (__v8df) __B,
976}
977
978static __inline__ __m512d __DEFAULT_FN_ATTRS512
979_mm512_mask_max_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B)
980{
981 return (__m512d)__builtin_ia32_selectpd_512(__U,
982 (__v8df)_mm512_max_pd(__A, __B),
983 (__v8df)__W);
984}
985
986static __inline__ __m512d __DEFAULT_FN_ATTRS512
987_mm512_maskz_max_pd (__mmask8 __U, __m512d __A, __m512d __B)
988{
989 return (__m512d)__builtin_ia32_selectpd_512(__U,
990 (__v8df)_mm512_max_pd(__A, __B),
991 (__v8df)_mm512_setzero_pd());
992}
993
994#define _mm512_max_round_ps(A, B, R) \
995 ((__m512)__builtin_ia32_maxps512((__v16sf)(__m512)(A), \
996 (__v16sf)(__m512)(B), (int)(R)))
997
998#define _mm512_mask_max_round_ps(W, U, A, B, R) \
999 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
1000 (__v16sf)_mm512_max_round_ps((A), (B), (R)), \
1001 (__v16sf)(W)))
1002
1003#define _mm512_maskz_max_round_ps(U, A, B, R) \
1004 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
1005 (__v16sf)_mm512_max_round_ps((A), (B), (R)), \
1006 (__v16sf)_mm512_setzero_ps()))
1007
1008static __inline__ __m512 __DEFAULT_FN_ATTRS512
1009_mm512_max_ps(__m512 __A, __m512 __B)
1010{
1011 return (__m512) __builtin_ia32_maxps512((__v16sf) __A, (__v16sf) __B,
1013}
1014
1015static __inline__ __m512 __DEFAULT_FN_ATTRS512
1016_mm512_mask_max_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B)
1017{
1018 return (__m512)__builtin_ia32_selectps_512(__U,
1019 (__v16sf)_mm512_max_ps(__A, __B),
1020 (__v16sf)__W);
1021}
1022
1023static __inline__ __m512 __DEFAULT_FN_ATTRS512
1024_mm512_maskz_max_ps (__mmask16 __U, __m512 __A, __m512 __B)
1025{
1026 return (__m512)__builtin_ia32_selectps_512(__U,
1027 (__v16sf)_mm512_max_ps(__A, __B),
1028 (__v16sf)_mm512_setzero_ps());
1029}
1030
1031static __inline__ __m128 __DEFAULT_FN_ATTRS128
1032_mm_mask_max_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {
1033 return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A,
1034 (__v4sf) __B,
1035 (__v4sf) __W,
1036 (__mmask8) __U,
1038}
1039
1040static __inline__ __m128 __DEFAULT_FN_ATTRS128
1041_mm_maskz_max_ss(__mmask8 __U,__m128 __A, __m128 __B) {
1042 return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A,
1043 (__v4sf) __B,
1044 (__v4sf) _mm_setzero_ps (),
1045 (__mmask8) __U,
1047}
1048
1049#define _mm_max_round_ss(A, B, R) \
1050 ((__m128)__builtin_ia32_maxss_round_mask((__v4sf)(__m128)(A), \
1051 (__v4sf)(__m128)(B), \
1052 (__v4sf)_mm_setzero_ps(), \
1053 (__mmask8)-1, (int)(R)))
1054
1055#define _mm_mask_max_round_ss(W, U, A, B, R) \
1056 ((__m128)__builtin_ia32_maxss_round_mask((__v4sf)(__m128)(A), \
1057 (__v4sf)(__m128)(B), \
1058 (__v4sf)(__m128)(W), (__mmask8)(U), \
1059 (int)(R)))
1060
1061#define _mm_maskz_max_round_ss(U, A, B, R) \
1062 ((__m128)__builtin_ia32_maxss_round_mask((__v4sf)(__m128)(A), \
1063 (__v4sf)(__m128)(B), \
1064 (__v4sf)_mm_setzero_ps(), \
1065 (__mmask8)(U), (int)(R)))
1066
1067static __inline__ __m128d __DEFAULT_FN_ATTRS128
1068_mm_mask_max_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {
1069 return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A,
1070 (__v2df) __B,
1071 (__v2df) __W,
1072 (__mmask8) __U,
1074}
1075
1076static __inline__ __m128d __DEFAULT_FN_ATTRS128
1077_mm_maskz_max_sd(__mmask8 __U,__m128d __A, __m128d __B) {
1078 return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A,
1079 (__v2df) __B,
1080 (__v2df) _mm_setzero_pd (),
1081 (__mmask8) __U,
1083}
1084
1085#define _mm_max_round_sd(A, B, R) \
1086 ((__m128d)__builtin_ia32_maxsd_round_mask((__v2df)(__m128d)(A), \
1087 (__v2df)(__m128d)(B), \
1088 (__v2df)_mm_setzero_pd(), \
1089 (__mmask8)-1, (int)(R)))
1090
1091#define _mm_mask_max_round_sd(W, U, A, B, R) \
1092 ((__m128d)__builtin_ia32_maxsd_round_mask((__v2df)(__m128d)(A), \
1093 (__v2df)(__m128d)(B), \
1094 (__v2df)(__m128d)(W), \
1095 (__mmask8)(U), (int)(R)))
1096
1097#define _mm_maskz_max_round_sd(U, A, B, R) \
1098 ((__m128d)__builtin_ia32_maxsd_round_mask((__v2df)(__m128d)(A), \
1099 (__v2df)(__m128d)(B), \
1100 (__v2df)_mm_setzero_pd(), \
1101 (__mmask8)(U), (int)(R)))
1102
1103static __inline __m512i
1105_mm512_max_epi32(__m512i __A, __m512i __B)
1106{
1107 return (__m512i)__builtin_elementwise_max((__v16si)__A, (__v16si)__B);
1108}
1109
1110static __inline__ __m512i __DEFAULT_FN_ATTRS512
1111_mm512_mask_max_epi32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B)
1112{
1113 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1114 (__v16si)_mm512_max_epi32(__A, __B),
1115 (__v16si)__W);
1116}
1117
1118static __inline__ __m512i __DEFAULT_FN_ATTRS512
1119_mm512_maskz_max_epi32 (__mmask16 __M, __m512i __A, __m512i __B)
1120{
1121 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1122 (__v16si)_mm512_max_epi32(__A, __B),
1123 (__v16si)_mm512_setzero_si512());
1124}
1125
1126static __inline __m512i __DEFAULT_FN_ATTRS512
1127_mm512_max_epu32(__m512i __A, __m512i __B)
1128{
1129 return (__m512i)__builtin_elementwise_max((__v16su)__A, (__v16su)__B);
1130}
1131
1132static __inline__ __m512i __DEFAULT_FN_ATTRS512
1133_mm512_mask_max_epu32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B)
1134{
1135 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1136 (__v16si)_mm512_max_epu32(__A, __B),
1137 (__v16si)__W);
1138}
1139
1140static __inline__ __m512i __DEFAULT_FN_ATTRS512
1141_mm512_maskz_max_epu32 (__mmask16 __M, __m512i __A, __m512i __B)
1142{
1143 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1144 (__v16si)_mm512_max_epu32(__A, __B),
1145 (__v16si)_mm512_setzero_si512());
1146}
1147
1148static __inline __m512i __DEFAULT_FN_ATTRS512
1149_mm512_max_epi64(__m512i __A, __m512i __B)
1150{
1151 return (__m512i)__builtin_elementwise_max((__v8di)__A, (__v8di)__B);
1152}
1153
1154static __inline__ __m512i __DEFAULT_FN_ATTRS512
1155_mm512_mask_max_epi64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B)
1156{
1157 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1158 (__v8di)_mm512_max_epi64(__A, __B),
1159 (__v8di)__W);
1160}
1161
1162static __inline__ __m512i __DEFAULT_FN_ATTRS512
1163_mm512_maskz_max_epi64 (__mmask8 __M, __m512i __A, __m512i __B)
1164{
1165 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1166 (__v8di)_mm512_max_epi64(__A, __B),
1167 (__v8di)_mm512_setzero_si512());
1168}
1169
1170static __inline __m512i __DEFAULT_FN_ATTRS512
1171_mm512_max_epu64(__m512i __A, __m512i __B)
1172{
1173 return (__m512i)__builtin_elementwise_max((__v8du)__A, (__v8du)__B);
1174}
1175
1176static __inline__ __m512i __DEFAULT_FN_ATTRS512
1177_mm512_mask_max_epu64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B)
1178{
1179 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1180 (__v8di)_mm512_max_epu64(__A, __B),
1181 (__v8di)__W);
1182}
1183
1184static __inline__ __m512i __DEFAULT_FN_ATTRS512
1185_mm512_maskz_max_epu64 (__mmask8 __M, __m512i __A, __m512i __B)
1186{
1187 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1188 (__v8di)_mm512_max_epu64(__A, __B),
1189 (__v8di)_mm512_setzero_si512());
1190}
1191
1192#define _mm512_min_round_pd(A, B, R) \
1193 ((__m512d)__builtin_ia32_minpd512((__v8df)(__m512d)(A), \
1194 (__v8df)(__m512d)(B), (int)(R)))
1195
1196#define _mm512_mask_min_round_pd(W, U, A, B, R) \
1197 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
1198 (__v8df)_mm512_min_round_pd((A), (B), (R)), \
1199 (__v8df)(W)))
1200
1201#define _mm512_maskz_min_round_pd(U, A, B, R) \
1202 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
1203 (__v8df)_mm512_min_round_pd((A), (B), (R)), \
1204 (__v8df)_mm512_setzero_pd()))
1205
1206static __inline__ __m512d __DEFAULT_FN_ATTRS512
1207_mm512_min_pd(__m512d __A, __m512d __B)
1208{
1209 return (__m512d) __builtin_ia32_minpd512((__v8df) __A, (__v8df) __B,
1211}
1212
1213static __inline__ __m512d __DEFAULT_FN_ATTRS512
1214_mm512_mask_min_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B)
1215{
1216 return (__m512d)__builtin_ia32_selectpd_512(__U,
1217 (__v8df)_mm512_min_pd(__A, __B),
1218 (__v8df)__W);
1219}
1220
1221static __inline__ __m512d __DEFAULT_FN_ATTRS512
1222_mm512_maskz_min_pd (__mmask8 __U, __m512d __A, __m512d __B)
1223{
1224 return (__m512d)__builtin_ia32_selectpd_512(__U,
1225 (__v8df)_mm512_min_pd(__A, __B),
1226 (__v8df)_mm512_setzero_pd());
1227}
1228
1229#define _mm512_min_round_ps(A, B, R) \
1230 ((__m512)__builtin_ia32_minps512((__v16sf)(__m512)(A), \
1231 (__v16sf)(__m512)(B), (int)(R)))
1232
1233#define _mm512_mask_min_round_ps(W, U, A, B, R) \
1234 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
1235 (__v16sf)_mm512_min_round_ps((A), (B), (R)), \
1236 (__v16sf)(W)))
1237
1238#define _mm512_maskz_min_round_ps(U, A, B, R) \
1239 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
1240 (__v16sf)_mm512_min_round_ps((A), (B), (R)), \
1241 (__v16sf)_mm512_setzero_ps()))
1242
1243static __inline__ __m512 __DEFAULT_FN_ATTRS512
1244_mm512_min_ps(__m512 __A, __m512 __B)
1245{
1246 return (__m512) __builtin_ia32_minps512((__v16sf) __A, (__v16sf) __B,
1248}
1249
1250static __inline__ __m512 __DEFAULT_FN_ATTRS512
1251_mm512_mask_min_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B)
1252{
1253 return (__m512)__builtin_ia32_selectps_512(__U,
1254 (__v16sf)_mm512_min_ps(__A, __B),
1255 (__v16sf)__W);
1256}
1257
1258static __inline__ __m512 __DEFAULT_FN_ATTRS512
1259_mm512_maskz_min_ps (__mmask16 __U, __m512 __A, __m512 __B)
1260{
1261 return (__m512)__builtin_ia32_selectps_512(__U,
1262 (__v16sf)_mm512_min_ps(__A, __B),
1263 (__v16sf)_mm512_setzero_ps());
1264}
1265
1266static __inline__ __m128 __DEFAULT_FN_ATTRS128
1267_mm_mask_min_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {
1268 return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A,
1269 (__v4sf) __B,
1270 (__v4sf) __W,
1271 (__mmask8) __U,
1273}
1274
1275static __inline__ __m128 __DEFAULT_FN_ATTRS128
1276_mm_maskz_min_ss(__mmask8 __U,__m128 __A, __m128 __B) {
1277 return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A,
1278 (__v4sf) __B,
1279 (__v4sf) _mm_setzero_ps (),
1280 (__mmask8) __U,
1282}
1283
1284#define _mm_min_round_ss(A, B, R) \
1285 ((__m128)__builtin_ia32_minss_round_mask((__v4sf)(__m128)(A), \
1286 (__v4sf)(__m128)(B), \
1287 (__v4sf)_mm_setzero_ps(), \
1288 (__mmask8)-1, (int)(R)))
1289
1290#define _mm_mask_min_round_ss(W, U, A, B, R) \
1291 ((__m128)__builtin_ia32_minss_round_mask((__v4sf)(__m128)(A), \
1292 (__v4sf)(__m128)(B), \
1293 (__v4sf)(__m128)(W), (__mmask8)(U), \
1294 (int)(R)))
1295
1296#define _mm_maskz_min_round_ss(U, A, B, R) \
1297 ((__m128)__builtin_ia32_minss_round_mask((__v4sf)(__m128)(A), \
1298 (__v4sf)(__m128)(B), \
1299 (__v4sf)_mm_setzero_ps(), \
1300 (__mmask8)(U), (int)(R)))
1301
1302static __inline__ __m128d __DEFAULT_FN_ATTRS128
1303_mm_mask_min_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {
1304 return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A,
1305 (__v2df) __B,
1306 (__v2df) __W,
1307 (__mmask8) __U,
1309}
1310
1311static __inline__ __m128d __DEFAULT_FN_ATTRS128
1312_mm_maskz_min_sd(__mmask8 __U,__m128d __A, __m128d __B) {
1313 return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A,
1314 (__v2df) __B,
1315 (__v2df) _mm_setzero_pd (),
1316 (__mmask8) __U,
1318}
1319
1320#define _mm_min_round_sd(A, B, R) \
1321 ((__m128d)__builtin_ia32_minsd_round_mask((__v2df)(__m128d)(A), \
1322 (__v2df)(__m128d)(B), \
1323 (__v2df)_mm_setzero_pd(), \
1324 (__mmask8)-1, (int)(R)))
1325
1326#define _mm_mask_min_round_sd(W, U, A, B, R) \
1327 ((__m128d)__builtin_ia32_minsd_round_mask((__v2df)(__m128d)(A), \
1328 (__v2df)(__m128d)(B), \
1329 (__v2df)(__m128d)(W), \
1330 (__mmask8)(U), (int)(R)))
1331
1332#define _mm_maskz_min_round_sd(U, A, B, R) \
1333 ((__m128d)__builtin_ia32_minsd_round_mask((__v2df)(__m128d)(A), \
1334 (__v2df)(__m128d)(B), \
1335 (__v2df)_mm_setzero_pd(), \
1336 (__mmask8)(U), (int)(R)))
1337
1338static __inline __m512i
1340_mm512_min_epi32(__m512i __A, __m512i __B)
1341{
1342 return (__m512i)__builtin_elementwise_min((__v16si)__A, (__v16si)__B);
1343}
1344
1345static __inline__ __m512i __DEFAULT_FN_ATTRS512
1346_mm512_mask_min_epi32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B)
1347{
1348 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1349 (__v16si)_mm512_min_epi32(__A, __B),
1350 (__v16si)__W);
1351}
1352
1353static __inline__ __m512i __DEFAULT_FN_ATTRS512
1354_mm512_maskz_min_epi32 (__mmask16 __M, __m512i __A, __m512i __B)
1355{
1356 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1357 (__v16si)_mm512_min_epi32(__A, __B),
1358 (__v16si)_mm512_setzero_si512());
1359}
1360
1361static __inline __m512i __DEFAULT_FN_ATTRS512
1362_mm512_min_epu32(__m512i __A, __m512i __B)
1363{
1364 return (__m512i)__builtin_elementwise_min((__v16su)__A, (__v16su)__B);
1365}
1366
1367static __inline__ __m512i __DEFAULT_FN_ATTRS512
1368_mm512_mask_min_epu32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B)
1369{
1370 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1371 (__v16si)_mm512_min_epu32(__A, __B),
1372 (__v16si)__W);
1373}
1374
1375static __inline__ __m512i __DEFAULT_FN_ATTRS512
1376_mm512_maskz_min_epu32 (__mmask16 __M, __m512i __A, __m512i __B)
1377{
1378 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1379 (__v16si)_mm512_min_epu32(__A, __B),
1380 (__v16si)_mm512_setzero_si512());
1381}
1382
1383static __inline __m512i __DEFAULT_FN_ATTRS512
1384_mm512_min_epi64(__m512i __A, __m512i __B)
1385{
1386 return (__m512i)__builtin_elementwise_min((__v8di)__A, (__v8di)__B);
1387}
1388
1389static __inline__ __m512i __DEFAULT_FN_ATTRS512
1390_mm512_mask_min_epi64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B)
1391{
1392 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1393 (__v8di)_mm512_min_epi64(__A, __B),
1394 (__v8di)__W);
1395}
1396
1397static __inline__ __m512i __DEFAULT_FN_ATTRS512
1398_mm512_maskz_min_epi64 (__mmask8 __M, __m512i __A, __m512i __B)
1399{
1400 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1401 (__v8di)_mm512_min_epi64(__A, __B),
1402 (__v8di)_mm512_setzero_si512());
1403}
1404
1405static __inline __m512i __DEFAULT_FN_ATTRS512
1406_mm512_min_epu64(__m512i __A, __m512i __B)
1407{
1408 return (__m512i)__builtin_elementwise_min((__v8du)__A, (__v8du)__B);
1409}
1410
1411static __inline__ __m512i __DEFAULT_FN_ATTRS512
1412_mm512_mask_min_epu64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B)
1413{
1414 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1415 (__v8di)_mm512_min_epu64(__A, __B),
1416 (__v8di)__W);
1417}
1418
1419static __inline__ __m512i __DEFAULT_FN_ATTRS512
1420_mm512_maskz_min_epu64 (__mmask8 __M, __m512i __A, __m512i __B)
1421{
1422 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1423 (__v8di)_mm512_min_epu64(__A, __B),
1424 (__v8di)_mm512_setzero_si512());
1425}
1426
1427static __inline __m512i __DEFAULT_FN_ATTRS512
1428_mm512_mul_epi32(__m512i __X, __m512i __Y)
1429{
1430 return (__m512i)__builtin_ia32_pmuldq512((__v16si)__X, (__v16si) __Y);
1431}
1432
1433static __inline __m512i __DEFAULT_FN_ATTRS512
1434_mm512_mask_mul_epi32(__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y)
1435{
1436 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1437 (__v8di)_mm512_mul_epi32(__X, __Y),
1438 (__v8di)__W);
1439}
1440
1441static __inline __m512i __DEFAULT_FN_ATTRS512
1442_mm512_maskz_mul_epi32(__mmask8 __M, __m512i __X, __m512i __Y)
1443{
1444 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1445 (__v8di)_mm512_mul_epi32(__X, __Y),
1446 (__v8di)_mm512_setzero_si512 ());
1447}
1448
1449static __inline __m512i __DEFAULT_FN_ATTRS512
1450_mm512_mul_epu32(__m512i __X, __m512i __Y)
1451{
1452 return (__m512i)__builtin_ia32_pmuludq512((__v16si)__X, (__v16si)__Y);
1453}
1454
1455static __inline __m512i __DEFAULT_FN_ATTRS512
1456_mm512_mask_mul_epu32(__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y)
1457{
1458 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1459 (__v8di)_mm512_mul_epu32(__X, __Y),
1460 (__v8di)__W);
1461}
1462
1463static __inline __m512i __DEFAULT_FN_ATTRS512
1464_mm512_maskz_mul_epu32(__mmask8 __M, __m512i __X, __m512i __Y)
1465{
1466 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M,
1467 (__v8di)_mm512_mul_epu32(__X, __Y),
1468 (__v8di)_mm512_setzero_si512 ());
1469}
1470
1471static __inline __m512i __DEFAULT_FN_ATTRS512
1472_mm512_mullo_epi32 (__m512i __A, __m512i __B)
1473{
1474 return (__m512i) ((__v16su) __A * (__v16su) __B);
1475}
1476
1477static __inline __m512i __DEFAULT_FN_ATTRS512
1478_mm512_maskz_mullo_epi32(__mmask16 __M, __m512i __A, __m512i __B)
1479{
1480 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1481 (__v16si)_mm512_mullo_epi32(__A, __B),
1482 (__v16si)_mm512_setzero_si512());
1483}
1484
1485static __inline __m512i __DEFAULT_FN_ATTRS512
1486_mm512_mask_mullo_epi32(__m512i __W, __mmask16 __M, __m512i __A, __m512i __B)
1487{
1488 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M,
1489 (__v16si)_mm512_mullo_epi32(__A, __B),
1490 (__v16si)__W);
1491}
1492
1493static __inline__ __m512i __DEFAULT_FN_ATTRS512
1494_mm512_mullox_epi64 (__m512i __A, __m512i __B) {
1495 return (__m512i) ((__v8du) __A * (__v8du) __B);
1496}
1497
1498static __inline__ __m512i __DEFAULT_FN_ATTRS512
1499_mm512_mask_mullox_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) {
1500 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
1501 (__v8di)_mm512_mullox_epi64(__A, __B),
1502 (__v8di)__W);
1503}
1504
1505#define _mm512_sqrt_round_pd(A, R) \
1506 ((__m512d)__builtin_ia32_sqrtpd512((__v8df)(__m512d)(A), (int)(R)))
1507
1508#define _mm512_mask_sqrt_round_pd(W, U, A, R) \
1509 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
1510 (__v8df)_mm512_sqrt_round_pd((A), (R)), \
1511 (__v8df)(__m512d)(W)))
1512
1513#define _mm512_maskz_sqrt_round_pd(U, A, R) \
1514 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
1515 (__v8df)_mm512_sqrt_round_pd((A), (R)), \
1516 (__v8df)_mm512_setzero_pd()))
1517
1518static __inline__ __m512d __DEFAULT_FN_ATTRS512
1519_mm512_sqrt_pd(__m512d __A)
1520{
1521 return (__m512d)__builtin_ia32_sqrtpd512((__v8df)__A,
1523}
1524
1525static __inline__ __m512d __DEFAULT_FN_ATTRS512
1526_mm512_mask_sqrt_pd (__m512d __W, __mmask8 __U, __m512d __A)
1527{
1528 return (__m512d)__builtin_ia32_selectpd_512(__U,
1529 (__v8df)_mm512_sqrt_pd(__A),
1530 (__v8df)__W);
1531}
1532
1533static __inline__ __m512d __DEFAULT_FN_ATTRS512
1535{
1536 return (__m512d)__builtin_ia32_selectpd_512(__U,
1537 (__v8df)_mm512_sqrt_pd(__A),
1538 (__v8df)_mm512_setzero_pd());
1539}
1540
1541#define _mm512_sqrt_round_ps(A, R) \
1542 ((__m512)__builtin_ia32_sqrtps512((__v16sf)(__m512)(A), (int)(R)))
1543
1544#define _mm512_mask_sqrt_round_ps(W, U, A, R) \
1545 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
1546 (__v16sf)_mm512_sqrt_round_ps((A), (R)), \
1547 (__v16sf)(__m512)(W)))
1548
1549#define _mm512_maskz_sqrt_round_ps(U, A, R) \
1550 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
1551 (__v16sf)_mm512_sqrt_round_ps((A), (R)), \
1552 (__v16sf)_mm512_setzero_ps()))
1553
1554static __inline__ __m512 __DEFAULT_FN_ATTRS512
1556{
1557 return (__m512)__builtin_ia32_sqrtps512((__v16sf)__A,
1559}
1560
1561static __inline__ __m512 __DEFAULT_FN_ATTRS512
1562_mm512_mask_sqrt_ps(__m512 __W, __mmask16 __U, __m512 __A)
1563{
1564 return (__m512)__builtin_ia32_selectps_512(__U,
1565 (__v16sf)_mm512_sqrt_ps(__A),
1566 (__v16sf)__W);
1567}
1568
1569static __inline__ __m512 __DEFAULT_FN_ATTRS512
1571{
1572 return (__m512)__builtin_ia32_selectps_512(__U,
1573 (__v16sf)_mm512_sqrt_ps(__A),
1574 (__v16sf)_mm512_setzero_ps());
1575}
1576
1577static __inline__ __m512d __DEFAULT_FN_ATTRS512
1579{
1580 return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A,
1581 (__v8df)
1583 (__mmask8) -1);}
1584
1585static __inline__ __m512d __DEFAULT_FN_ATTRS512
1586_mm512_mask_rsqrt14_pd (__m512d __W, __mmask8 __U, __m512d __A)
1587{
1588 return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A,
1589 (__v8df) __W,
1590 (__mmask8) __U);
1591}
1592
1593static __inline__ __m512d __DEFAULT_FN_ATTRS512
1595{
1596 return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A,
1597 (__v8df)
1599 (__mmask8) __U);
1600}
1601
1602static __inline__ __m512 __DEFAULT_FN_ATTRS512
1604{
1605 return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A,
1606 (__v16sf)
1608 (__mmask16) -1);
1609}
1610
1611static __inline__ __m512 __DEFAULT_FN_ATTRS512
1612_mm512_mask_rsqrt14_ps (__m512 __W, __mmask16 __U, __m512 __A)
1613{
1614 return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A,
1615 (__v16sf) __W,
1616 (__mmask16) __U);
1617}
1618
1619static __inline__ __m512 __DEFAULT_FN_ATTRS512
1621{
1622 return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A,
1623 (__v16sf)
1625 (__mmask16) __U);
1626}
1627
1628static __inline__ __m128 __DEFAULT_FN_ATTRS128
1629_mm_rsqrt14_ss(__m128 __A, __m128 __B)
1630{
1631 return (__m128) __builtin_ia32_rsqrt14ss_mask ((__v4sf) __A,
1632 (__v4sf) __B,
1633 (__v4sf)
1634 _mm_setzero_ps (),
1635 (__mmask8) -1);
1636}
1637
1638static __inline__ __m128 __DEFAULT_FN_ATTRS128
1639_mm_mask_rsqrt14_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B)
1640{
1641 return (__m128) __builtin_ia32_rsqrt14ss_mask ((__v4sf) __A,
1642 (__v4sf) __B,
1643 (__v4sf) __W,
1644 (__mmask8) __U);
1645}
1646
1647static __inline__ __m128 __DEFAULT_FN_ATTRS128
1648_mm_maskz_rsqrt14_ss (__mmask8 __U, __m128 __A, __m128 __B)
1649{
1650 return (__m128) __builtin_ia32_rsqrt14ss_mask ((__v4sf) __A,
1651 (__v4sf) __B,
1652 (__v4sf) _mm_setzero_ps (),
1653 (__mmask8) __U);
1654}
1655
1656static __inline__ __m128d __DEFAULT_FN_ATTRS128
1657_mm_rsqrt14_sd(__m128d __A, __m128d __B)
1658{
1659 return (__m128d) __builtin_ia32_rsqrt14sd_mask ((__v2df) __A,
1660 (__v2df) __B,
1661 (__v2df)
1662 _mm_setzero_pd (),
1663 (__mmask8) -1);
1664}
1665
1666static __inline__ __m128d __DEFAULT_FN_ATTRS128
1667_mm_mask_rsqrt14_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B)
1668{
1669 return (__m128d) __builtin_ia32_rsqrt14sd_mask ( (__v2df) __A,
1670 (__v2df) __B,
1671 (__v2df) __W,
1672 (__mmask8) __U);
1673}
1674
1675static __inline__ __m128d __DEFAULT_FN_ATTRS128
1676_mm_maskz_rsqrt14_sd (__mmask8 __U, __m128d __A, __m128d __B)
1677{
1678 return (__m128d) __builtin_ia32_rsqrt14sd_mask ( (__v2df) __A,
1679 (__v2df) __B,
1680 (__v2df) _mm_setzero_pd (),
1681 (__mmask8) __U);
1682}
1683
1684static __inline__ __m512d __DEFAULT_FN_ATTRS512
1686{
1687 return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A,
1688 (__v8df)
1690 (__mmask8) -1);
1691}
1692
1693static __inline__ __m512d __DEFAULT_FN_ATTRS512
1694_mm512_mask_rcp14_pd (__m512d __W, __mmask8 __U, __m512d __A)
1695{
1696 return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A,
1697 (__v8df) __W,
1698 (__mmask8) __U);
1699}
1700
1701static __inline__ __m512d __DEFAULT_FN_ATTRS512
1703{
1704 return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A,
1705 (__v8df)
1707 (__mmask8) __U);
1708}
1709
1710static __inline__ __m512 __DEFAULT_FN_ATTRS512
1712{
1713 return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A,
1714 (__v16sf)
1716 (__mmask16) -1);
1717}
1718
1719static __inline__ __m512 __DEFAULT_FN_ATTRS512
1720_mm512_mask_rcp14_ps (__m512 __W, __mmask16 __U, __m512 __A)
1721{
1722 return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A,
1723 (__v16sf) __W,
1724 (__mmask16) __U);
1725}
1726
1727static __inline__ __m512 __DEFAULT_FN_ATTRS512
1729{
1730 return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A,
1731 (__v16sf)
1733 (__mmask16) __U);
1734}
1735
1736static __inline__ __m128 __DEFAULT_FN_ATTRS128
1737_mm_rcp14_ss(__m128 __A, __m128 __B)
1738{
1739 return (__m128) __builtin_ia32_rcp14ss_mask ((__v4sf) __A,
1740 (__v4sf) __B,
1741 (__v4sf)
1742 _mm_setzero_ps (),
1743 (__mmask8) -1);
1744}
1745
1746static __inline__ __m128 __DEFAULT_FN_ATTRS128
1747_mm_mask_rcp14_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B)
1748{
1749 return (__m128) __builtin_ia32_rcp14ss_mask ((__v4sf) __A,
1750 (__v4sf) __B,
1751 (__v4sf) __W,
1752 (__mmask8) __U);
1753}
1754
1755static __inline__ __m128 __DEFAULT_FN_ATTRS128
1756_mm_maskz_rcp14_ss (__mmask8 __U, __m128 __A, __m128 __B)
1757{
1758 return (__m128) __builtin_ia32_rcp14ss_mask ((__v4sf) __A,
1759 (__v4sf) __B,
1760 (__v4sf) _mm_setzero_ps (),
1761 (__mmask8) __U);
1762}
1763
1764static __inline__ __m128d __DEFAULT_FN_ATTRS128
1765_mm_rcp14_sd(__m128d __A, __m128d __B)
1766{
1767 return (__m128d) __builtin_ia32_rcp14sd_mask ((__v2df) __A,
1768 (__v2df) __B,
1769 (__v2df)
1770 _mm_setzero_pd (),
1771 (__mmask8) -1);
1772}
1773
1774static __inline__ __m128d __DEFAULT_FN_ATTRS128
1775_mm_mask_rcp14_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B)
1776{
1777 return (__m128d) __builtin_ia32_rcp14sd_mask ( (__v2df) __A,
1778 (__v2df) __B,
1779 (__v2df) __W,
1780 (__mmask8) __U);
1781}
1782
1783static __inline__ __m128d __DEFAULT_FN_ATTRS128
1784_mm_maskz_rcp14_sd (__mmask8 __U, __m128d __A, __m128d __B)
1785{
1786 return (__m128d) __builtin_ia32_rcp14sd_mask ( (__v2df) __A,
1787 (__v2df) __B,
1788 (__v2df) _mm_setzero_pd (),
1789 (__mmask8) __U);
1790}
1791
1792static __inline __m512 __DEFAULT_FN_ATTRS512
1794{
1795 return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A,
1797 (__v16sf) __A, (unsigned short)-1,
1799}
1800
1801static __inline__ __m512 __DEFAULT_FN_ATTRS512
1802_mm512_mask_floor_ps (__m512 __W, __mmask16 __U, __m512 __A)
1803{
1804 return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A,
1806 (__v16sf) __W, __U,
1808}
1809
1810static __inline __m512d __DEFAULT_FN_ATTRS512
1812{
1813 return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A,
1815 (__v8df) __A, (unsigned char)-1,
1817}
1818
1819static __inline__ __m512d __DEFAULT_FN_ATTRS512
1820_mm512_mask_floor_pd (__m512d __W, __mmask8 __U, __m512d __A)
1821{
1822 return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A,
1824 (__v8df) __W, __U,
1826}
1827
1828static __inline__ __m512 __DEFAULT_FN_ATTRS512
1829_mm512_mask_ceil_ps (__m512 __W, __mmask16 __U, __m512 __A)
1830{
1831 return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A,
1833 (__v16sf) __W, __U,
1835}
1836
1837static __inline __m512 __DEFAULT_FN_ATTRS512
1839{
1840 return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A,
1842 (__v16sf) __A, (unsigned short)-1,
1844}
1845
1846static __inline __m512d __DEFAULT_FN_ATTRS512
1847_mm512_ceil_pd(__m512d __A)
1848{
1849 return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A,
1851 (__v8df) __A, (unsigned char)-1,
1853}
1854
1855static __inline__ __m512d __DEFAULT_FN_ATTRS512
1856_mm512_mask_ceil_pd (__m512d __W, __mmask8 __U, __m512d __A)
1857{
1858 return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A,
1860 (__v8df) __W, __U,
1862}
1863
1864static __inline __m512i __DEFAULT_FN_ATTRS512
1866{
1867 return (__m512i)__builtin_elementwise_abs((__v8di)__A);
1868}
1869
1870static __inline__ __m512i __DEFAULT_FN_ATTRS512
1871_mm512_mask_abs_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
1872{
1873 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
1874 (__v8di)_mm512_abs_epi64(__A),
1875 (__v8di)__W);
1876}
1877
1878static __inline__ __m512i __DEFAULT_FN_ATTRS512
1880{
1881 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
1882 (__v8di)_mm512_abs_epi64(__A),
1883 (__v8di)_mm512_setzero_si512());
1884}
1885
1886static __inline __m512i __DEFAULT_FN_ATTRS512
1888{
1889 return (__m512i)__builtin_elementwise_abs((__v16si) __A);
1890}
1891
1892static __inline__ __m512i __DEFAULT_FN_ATTRS512
1893_mm512_mask_abs_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
1894{
1895 return (__m512i)__builtin_ia32_selectd_512(__U,
1896 (__v16si)_mm512_abs_epi32(__A),
1897 (__v16si)__W);
1898}
1899
1900static __inline__ __m512i __DEFAULT_FN_ATTRS512
1902{
1903 return (__m512i)__builtin_ia32_selectd_512(__U,
1904 (__v16si)_mm512_abs_epi32(__A),
1905 (__v16si)_mm512_setzero_si512());
1906}
1907
1908static __inline__ __m128 __DEFAULT_FN_ATTRS128
1909_mm_mask_add_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {
1910 __A = _mm_add_ss(__A, __B);
1911 return __builtin_ia32_selectss_128(__U, __A, __W);
1912}
1913
1914static __inline__ __m128 __DEFAULT_FN_ATTRS128
1915_mm_maskz_add_ss(__mmask8 __U,__m128 __A, __m128 __B) {
1916 __A = _mm_add_ss(__A, __B);
1917 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());
1918}
1919
1920#define _mm_add_round_ss(A, B, R) \
1921 ((__m128)__builtin_ia32_addss_round_mask((__v4sf)(__m128)(A), \
1922 (__v4sf)(__m128)(B), \
1923 (__v4sf)_mm_setzero_ps(), \
1924 (__mmask8)-1, (int)(R)))
1925
1926#define _mm_mask_add_round_ss(W, U, A, B, R) \
1927 ((__m128)__builtin_ia32_addss_round_mask((__v4sf)(__m128)(A), \
1928 (__v4sf)(__m128)(B), \
1929 (__v4sf)(__m128)(W), (__mmask8)(U), \
1930 (int)(R)))
1931
1932#define _mm_maskz_add_round_ss(U, A, B, R) \
1933 ((__m128)__builtin_ia32_addss_round_mask((__v4sf)(__m128)(A), \
1934 (__v4sf)(__m128)(B), \
1935 (__v4sf)_mm_setzero_ps(), \
1936 (__mmask8)(U), (int)(R)))
1937
1938static __inline__ __m128d __DEFAULT_FN_ATTRS128
1939_mm_mask_add_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {
1940 __A = _mm_add_sd(__A, __B);
1941 return __builtin_ia32_selectsd_128(__U, __A, __W);
1942}
1943
1944static __inline__ __m128d __DEFAULT_FN_ATTRS128
1945_mm_maskz_add_sd(__mmask8 __U,__m128d __A, __m128d __B) {
1946 __A = _mm_add_sd(__A, __B);
1947 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());
1948}
1949#define _mm_add_round_sd(A, B, R) \
1950 ((__m128d)__builtin_ia32_addsd_round_mask((__v2df)(__m128d)(A), \
1951 (__v2df)(__m128d)(B), \
1952 (__v2df)_mm_setzero_pd(), \
1953 (__mmask8)-1, (int)(R)))
1954
1955#define _mm_mask_add_round_sd(W, U, A, B, R) \
1956 ((__m128d)__builtin_ia32_addsd_round_mask((__v2df)(__m128d)(A), \
1957 (__v2df)(__m128d)(B), \
1958 (__v2df)(__m128d)(W), \
1959 (__mmask8)(U), (int)(R)))
1960
1961#define _mm_maskz_add_round_sd(U, A, B, R) \
1962 ((__m128d)__builtin_ia32_addsd_round_mask((__v2df)(__m128d)(A), \
1963 (__v2df)(__m128d)(B), \
1964 (__v2df)_mm_setzero_pd(), \
1965 (__mmask8)(U), (int)(R)))
1966
1967static __inline__ __m512d __DEFAULT_FN_ATTRS512
1968_mm512_mask_add_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {
1969 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
1970 (__v8df)_mm512_add_pd(__A, __B),
1971 (__v8df)__W);
1972}
1973
1974static __inline__ __m512d __DEFAULT_FN_ATTRS512
1975_mm512_maskz_add_pd(__mmask8 __U, __m512d __A, __m512d __B) {
1976 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
1977 (__v8df)_mm512_add_pd(__A, __B),
1978 (__v8df)_mm512_setzero_pd());
1979}
1980
1981static __inline__ __m512 __DEFAULT_FN_ATTRS512
1982_mm512_mask_add_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {
1983 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
1984 (__v16sf)_mm512_add_ps(__A, __B),
1985 (__v16sf)__W);
1986}
1987
1988static __inline__ __m512 __DEFAULT_FN_ATTRS512
1989_mm512_maskz_add_ps(__mmask16 __U, __m512 __A, __m512 __B) {
1990 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
1991 (__v16sf)_mm512_add_ps(__A, __B),
1992 (__v16sf)_mm512_setzero_ps());
1993}
1994
1995#define _mm512_add_round_pd(A, B, R) \
1996 ((__m512d)__builtin_ia32_addpd512((__v8df)(__m512d)(A), \
1997 (__v8df)(__m512d)(B), (int)(R)))
1998
1999#define _mm512_mask_add_round_pd(W, U, A, B, R) \
2000 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2001 (__v8df)_mm512_add_round_pd((A), (B), (R)), \
2002 (__v8df)(__m512d)(W)))
2003
2004#define _mm512_maskz_add_round_pd(U, A, B, R) \
2005 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2006 (__v8df)_mm512_add_round_pd((A), (B), (R)), \
2007 (__v8df)_mm512_setzero_pd()))
2008
2009#define _mm512_add_round_ps(A, B, R) \
2010 ((__m512)__builtin_ia32_addps512((__v16sf)(__m512)(A), \
2011 (__v16sf)(__m512)(B), (int)(R)))
2012
2013#define _mm512_mask_add_round_ps(W, U, A, B, R) \
2014 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2015 (__v16sf)_mm512_add_round_ps((A), (B), (R)), \
2016 (__v16sf)(__m512)(W)))
2017
2018#define _mm512_maskz_add_round_ps(U, A, B, R) \
2019 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2020 (__v16sf)_mm512_add_round_ps((A), (B), (R)), \
2021 (__v16sf)_mm512_setzero_ps()))
2022
2023static __inline__ __m128 __DEFAULT_FN_ATTRS128
2024_mm_mask_sub_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {
2025 __A = _mm_sub_ss(__A, __B);
2026 return __builtin_ia32_selectss_128(__U, __A, __W);
2027}
2028
2029static __inline__ __m128 __DEFAULT_FN_ATTRS128
2030_mm_maskz_sub_ss(__mmask8 __U,__m128 __A, __m128 __B) {
2031 __A = _mm_sub_ss(__A, __B);
2032 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());
2033}
2034#define _mm_sub_round_ss(A, B, R) \
2035 ((__m128)__builtin_ia32_subss_round_mask((__v4sf)(__m128)(A), \
2036 (__v4sf)(__m128)(B), \
2037 (__v4sf)_mm_setzero_ps(), \
2038 (__mmask8)-1, (int)(R)))
2039
2040#define _mm_mask_sub_round_ss(W, U, A, B, R) \
2041 ((__m128)__builtin_ia32_subss_round_mask((__v4sf)(__m128)(A), \
2042 (__v4sf)(__m128)(B), \
2043 (__v4sf)(__m128)(W), (__mmask8)(U), \
2044 (int)(R)))
2045
2046#define _mm_maskz_sub_round_ss(U, A, B, R) \
2047 ((__m128)__builtin_ia32_subss_round_mask((__v4sf)(__m128)(A), \
2048 (__v4sf)(__m128)(B), \
2049 (__v4sf)_mm_setzero_ps(), \
2050 (__mmask8)(U), (int)(R)))
2051
2052static __inline__ __m128d __DEFAULT_FN_ATTRS128
2053_mm_mask_sub_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {
2054 __A = _mm_sub_sd(__A, __B);
2055 return __builtin_ia32_selectsd_128(__U, __A, __W);
2056}
2057
2058static __inline__ __m128d __DEFAULT_FN_ATTRS128
2059_mm_maskz_sub_sd(__mmask8 __U,__m128d __A, __m128d __B) {
2060 __A = _mm_sub_sd(__A, __B);
2061 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());
2062}
2063
2064#define _mm_sub_round_sd(A, B, R) \
2065 ((__m128d)__builtin_ia32_subsd_round_mask((__v2df)(__m128d)(A), \
2066 (__v2df)(__m128d)(B), \
2067 (__v2df)_mm_setzero_pd(), \
2068 (__mmask8)-1, (int)(R)))
2069
2070#define _mm_mask_sub_round_sd(W, U, A, B, R) \
2071 ((__m128d)__builtin_ia32_subsd_round_mask((__v2df)(__m128d)(A), \
2072 (__v2df)(__m128d)(B), \
2073 (__v2df)(__m128d)(W), \
2074 (__mmask8)(U), (int)(R)))
2075
2076#define _mm_maskz_sub_round_sd(U, A, B, R) \
2077 ((__m128d)__builtin_ia32_subsd_round_mask((__v2df)(__m128d)(A), \
2078 (__v2df)(__m128d)(B), \
2079 (__v2df)_mm_setzero_pd(), \
2080 (__mmask8)(U), (int)(R)))
2081
2082static __inline__ __m512d __DEFAULT_FN_ATTRS512
2083_mm512_mask_sub_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {
2084 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2085 (__v8df)_mm512_sub_pd(__A, __B),
2086 (__v8df)__W);
2087}
2088
2089static __inline__ __m512d __DEFAULT_FN_ATTRS512
2090_mm512_maskz_sub_pd(__mmask8 __U, __m512d __A, __m512d __B) {
2091 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2092 (__v8df)_mm512_sub_pd(__A, __B),
2093 (__v8df)_mm512_setzero_pd());
2094}
2095
2096static __inline__ __m512 __DEFAULT_FN_ATTRS512
2097_mm512_mask_sub_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {
2098 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2099 (__v16sf)_mm512_sub_ps(__A, __B),
2100 (__v16sf)__W);
2101}
2102
2103static __inline__ __m512 __DEFAULT_FN_ATTRS512
2104_mm512_maskz_sub_ps(__mmask16 __U, __m512 __A, __m512 __B) {
2105 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2106 (__v16sf)_mm512_sub_ps(__A, __B),
2107 (__v16sf)_mm512_setzero_ps());
2108}
2109
2110#define _mm512_sub_round_pd(A, B, R) \
2111 ((__m512d)__builtin_ia32_subpd512((__v8df)(__m512d)(A), \
2112 (__v8df)(__m512d)(B), (int)(R)))
2113
2114#define _mm512_mask_sub_round_pd(W, U, A, B, R) \
2115 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2116 (__v8df)_mm512_sub_round_pd((A), (B), (R)), \
2117 (__v8df)(__m512d)(W)))
2118
2119#define _mm512_maskz_sub_round_pd(U, A, B, R) \
2120 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2121 (__v8df)_mm512_sub_round_pd((A), (B), (R)), \
2122 (__v8df)_mm512_setzero_pd()))
2123
2124#define _mm512_sub_round_ps(A, B, R) \
2125 ((__m512)__builtin_ia32_subps512((__v16sf)(__m512)(A), \
2126 (__v16sf)(__m512)(B), (int)(R)))
2127
2128#define _mm512_mask_sub_round_ps(W, U, A, B, R) \
2129 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2130 (__v16sf)_mm512_sub_round_ps((A), (B), (R)), \
2131 (__v16sf)(__m512)(W)))
2132
2133#define _mm512_maskz_sub_round_ps(U, A, B, R) \
2134 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2135 (__v16sf)_mm512_sub_round_ps((A), (B), (R)), \
2136 (__v16sf)_mm512_setzero_ps()))
2137
2138static __inline__ __m128 __DEFAULT_FN_ATTRS128
2139_mm_mask_mul_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {
2140 __A = _mm_mul_ss(__A, __B);
2141 return __builtin_ia32_selectss_128(__U, __A, __W);
2142}
2143
2144static __inline__ __m128 __DEFAULT_FN_ATTRS128
2145_mm_maskz_mul_ss(__mmask8 __U,__m128 __A, __m128 __B) {
2146 __A = _mm_mul_ss(__A, __B);
2147 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());
2148}
2149#define _mm_mul_round_ss(A, B, R) \
2150 ((__m128)__builtin_ia32_mulss_round_mask((__v4sf)(__m128)(A), \
2151 (__v4sf)(__m128)(B), \
2152 (__v4sf)_mm_setzero_ps(), \
2153 (__mmask8)-1, (int)(R)))
2154
2155#define _mm_mask_mul_round_ss(W, U, A, B, R) \
2156 ((__m128)__builtin_ia32_mulss_round_mask((__v4sf)(__m128)(A), \
2157 (__v4sf)(__m128)(B), \
2158 (__v4sf)(__m128)(W), (__mmask8)(U), \
2159 (int)(R)))
2160
2161#define _mm_maskz_mul_round_ss(U, A, B, R) \
2162 ((__m128)__builtin_ia32_mulss_round_mask((__v4sf)(__m128)(A), \
2163 (__v4sf)(__m128)(B), \
2164 (__v4sf)_mm_setzero_ps(), \
2165 (__mmask8)(U), (int)(R)))
2166
2167static __inline__ __m128d __DEFAULT_FN_ATTRS128
2168_mm_mask_mul_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {
2169 __A = _mm_mul_sd(__A, __B);
2170 return __builtin_ia32_selectsd_128(__U, __A, __W);
2171}
2172
2173static __inline__ __m128d __DEFAULT_FN_ATTRS128
2174_mm_maskz_mul_sd(__mmask8 __U,__m128d __A, __m128d __B) {
2175 __A = _mm_mul_sd(__A, __B);
2176 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());
2177}
2178
2179#define _mm_mul_round_sd(A, B, R) \
2180 ((__m128d)__builtin_ia32_mulsd_round_mask((__v2df)(__m128d)(A), \
2181 (__v2df)(__m128d)(B), \
2182 (__v2df)_mm_setzero_pd(), \
2183 (__mmask8)-1, (int)(R)))
2184
2185#define _mm_mask_mul_round_sd(W, U, A, B, R) \
2186 ((__m128d)__builtin_ia32_mulsd_round_mask((__v2df)(__m128d)(A), \
2187 (__v2df)(__m128d)(B), \
2188 (__v2df)(__m128d)(W), \
2189 (__mmask8)(U), (int)(R)))
2190
2191#define _mm_maskz_mul_round_sd(U, A, B, R) \
2192 ((__m128d)__builtin_ia32_mulsd_round_mask((__v2df)(__m128d)(A), \
2193 (__v2df)(__m128d)(B), \
2194 (__v2df)_mm_setzero_pd(), \
2195 (__mmask8)(U), (int)(R)))
2196
2197static __inline__ __m512d __DEFAULT_FN_ATTRS512
2198_mm512_mask_mul_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {
2199 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2200 (__v8df)_mm512_mul_pd(__A, __B),
2201 (__v8df)__W);
2202}
2203
2204static __inline__ __m512d __DEFAULT_FN_ATTRS512
2205_mm512_maskz_mul_pd(__mmask8 __U, __m512d __A, __m512d __B) {
2206 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2207 (__v8df)_mm512_mul_pd(__A, __B),
2208 (__v8df)_mm512_setzero_pd());
2209}
2210
2211static __inline__ __m512 __DEFAULT_FN_ATTRS512
2212_mm512_mask_mul_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {
2213 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2214 (__v16sf)_mm512_mul_ps(__A, __B),
2215 (__v16sf)__W);
2216}
2217
2218static __inline__ __m512 __DEFAULT_FN_ATTRS512
2219_mm512_maskz_mul_ps(__mmask16 __U, __m512 __A, __m512 __B) {
2220 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2221 (__v16sf)_mm512_mul_ps(__A, __B),
2222 (__v16sf)_mm512_setzero_ps());
2223}
2224
2225#define _mm512_mul_round_pd(A, B, R) \
2226 ((__m512d)__builtin_ia32_mulpd512((__v8df)(__m512d)(A), \
2227 (__v8df)(__m512d)(B), (int)(R)))
2228
2229#define _mm512_mask_mul_round_pd(W, U, A, B, R) \
2230 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2231 (__v8df)_mm512_mul_round_pd((A), (B), (R)), \
2232 (__v8df)(__m512d)(W)))
2233
2234#define _mm512_maskz_mul_round_pd(U, A, B, R) \
2235 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2236 (__v8df)_mm512_mul_round_pd((A), (B), (R)), \
2237 (__v8df)_mm512_setzero_pd()))
2238
2239#define _mm512_mul_round_ps(A, B, R) \
2240 ((__m512)__builtin_ia32_mulps512((__v16sf)(__m512)(A), \
2241 (__v16sf)(__m512)(B), (int)(R)))
2242
2243#define _mm512_mask_mul_round_ps(W, U, A, B, R) \
2244 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2245 (__v16sf)_mm512_mul_round_ps((A), (B), (R)), \
2246 (__v16sf)(__m512)(W)))
2247
2248#define _mm512_maskz_mul_round_ps(U, A, B, R) \
2249 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2250 (__v16sf)_mm512_mul_round_ps((A), (B), (R)), \
2251 (__v16sf)_mm512_setzero_ps()))
2252
2253static __inline__ __m128 __DEFAULT_FN_ATTRS128
2254_mm_mask_div_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) {
2255 __A = _mm_div_ss(__A, __B);
2256 return __builtin_ia32_selectss_128(__U, __A, __W);
2257}
2258
2259static __inline__ __m128 __DEFAULT_FN_ATTRS128
2260_mm_maskz_div_ss(__mmask8 __U,__m128 __A, __m128 __B) {
2261 __A = _mm_div_ss(__A, __B);
2262 return __builtin_ia32_selectss_128(__U, __A, _mm_setzero_ps());
2263}
2264
2265#define _mm_div_round_ss(A, B, R) \
2266 ((__m128)__builtin_ia32_divss_round_mask((__v4sf)(__m128)(A), \
2267 (__v4sf)(__m128)(B), \
2268 (__v4sf)_mm_setzero_ps(), \
2269 (__mmask8)-1, (int)(R)))
2270
2271#define _mm_mask_div_round_ss(W, U, A, B, R) \
2272 ((__m128)__builtin_ia32_divss_round_mask((__v4sf)(__m128)(A), \
2273 (__v4sf)(__m128)(B), \
2274 (__v4sf)(__m128)(W), (__mmask8)(U), \
2275 (int)(R)))
2276
2277#define _mm_maskz_div_round_ss(U, A, B, R) \
2278 ((__m128)__builtin_ia32_divss_round_mask((__v4sf)(__m128)(A), \
2279 (__v4sf)(__m128)(B), \
2280 (__v4sf)_mm_setzero_ps(), \
2281 (__mmask8)(U), (int)(R)))
2282
2283static __inline__ __m128d __DEFAULT_FN_ATTRS128
2284_mm_mask_div_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) {
2285 __A = _mm_div_sd(__A, __B);
2286 return __builtin_ia32_selectsd_128(__U, __A, __W);
2287}
2288
2289static __inline__ __m128d __DEFAULT_FN_ATTRS128
2290_mm_maskz_div_sd(__mmask8 __U,__m128d __A, __m128d __B) {
2291 __A = _mm_div_sd(__A, __B);
2292 return __builtin_ia32_selectsd_128(__U, __A, _mm_setzero_pd());
2293}
2294
2295#define _mm_div_round_sd(A, B, R) \
2296 ((__m128d)__builtin_ia32_divsd_round_mask((__v2df)(__m128d)(A), \
2297 (__v2df)(__m128d)(B), \
2298 (__v2df)_mm_setzero_pd(), \
2299 (__mmask8)-1, (int)(R)))
2300
2301#define _mm_mask_div_round_sd(W, U, A, B, R) \
2302 ((__m128d)__builtin_ia32_divsd_round_mask((__v2df)(__m128d)(A), \
2303 (__v2df)(__m128d)(B), \
2304 (__v2df)(__m128d)(W), \
2305 (__mmask8)(U), (int)(R)))
2306
2307#define _mm_maskz_div_round_sd(U, A, B, R) \
2308 ((__m128d)__builtin_ia32_divsd_round_mask((__v2df)(__m128d)(A), \
2309 (__v2df)(__m128d)(B), \
2310 (__v2df)_mm_setzero_pd(), \
2311 (__mmask8)(U), (int)(R)))
2312
2313static __inline __m512d __DEFAULT_FN_ATTRS512
2314_mm512_div_pd(__m512d __a, __m512d __b)
2315{
2316 return (__m512d)((__v8df)__a/(__v8df)__b);
2317}
2318
2319static __inline__ __m512d __DEFAULT_FN_ATTRS512
2320_mm512_mask_div_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) {
2321 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2322 (__v8df)_mm512_div_pd(__A, __B),
2323 (__v8df)__W);
2324}
2325
2326static __inline__ __m512d __DEFAULT_FN_ATTRS512
2327_mm512_maskz_div_pd(__mmask8 __U, __m512d __A, __m512d __B) {
2328 return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U,
2329 (__v8df)_mm512_div_pd(__A, __B),
2330 (__v8df)_mm512_setzero_pd());
2331}
2332
2333static __inline __m512 __DEFAULT_FN_ATTRS512
2334_mm512_div_ps(__m512 __a, __m512 __b)
2335{
2336 return (__m512)((__v16sf)__a/(__v16sf)__b);
2337}
2338
2339static __inline__ __m512 __DEFAULT_FN_ATTRS512
2340_mm512_mask_div_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) {
2341 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2342 (__v16sf)_mm512_div_ps(__A, __B),
2343 (__v16sf)__W);
2344}
2345
2346static __inline__ __m512 __DEFAULT_FN_ATTRS512
2347_mm512_maskz_div_ps(__mmask16 __U, __m512 __A, __m512 __B) {
2348 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
2349 (__v16sf)_mm512_div_ps(__A, __B),
2350 (__v16sf)_mm512_setzero_ps());
2351}
2352
2353#define _mm512_div_round_pd(A, B, R) \
2354 ((__m512d)__builtin_ia32_divpd512((__v8df)(__m512d)(A), \
2355 (__v8df)(__m512d)(B), (int)(R)))
2356
2357#define _mm512_mask_div_round_pd(W, U, A, B, R) \
2358 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2359 (__v8df)_mm512_div_round_pd((A), (B), (R)), \
2360 (__v8df)(__m512d)(W)))
2361
2362#define _mm512_maskz_div_round_pd(U, A, B, R) \
2363 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2364 (__v8df)_mm512_div_round_pd((A), (B), (R)), \
2365 (__v8df)_mm512_setzero_pd()))
2366
2367#define _mm512_div_round_ps(A, B, R) \
2368 ((__m512)__builtin_ia32_divps512((__v16sf)(__m512)(A), \
2369 (__v16sf)(__m512)(B), (int)(R)))
2370
2371#define _mm512_mask_div_round_ps(W, U, A, B, R) \
2372 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2373 (__v16sf)_mm512_div_round_ps((A), (B), (R)), \
2374 (__v16sf)(__m512)(W)))
2375
2376#define _mm512_maskz_div_round_ps(U, A, B, R) \
2377 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2378 (__v16sf)_mm512_div_round_ps((A), (B), (R)), \
2379 (__v16sf)_mm512_setzero_ps()))
2380
2381#define _mm512_roundscale_ps(A, B) \
2382 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(A), (int)(B), \
2383 (__v16sf)_mm512_undefined_ps(), \
2384 (__mmask16)-1, \
2385 _MM_FROUND_CUR_DIRECTION))
2386
2387#define _mm512_mask_roundscale_ps(A, B, C, imm) \
2388 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(C), (int)(imm), \
2389 (__v16sf)(__m512)(A), (__mmask16)(B), \
2390 _MM_FROUND_CUR_DIRECTION))
2391
2392#define _mm512_maskz_roundscale_ps(A, B, imm) \
2393 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(B), (int)(imm), \
2394 (__v16sf)_mm512_setzero_ps(), \
2395 (__mmask16)(A), \
2396 _MM_FROUND_CUR_DIRECTION))
2397
2398#define _mm512_mask_roundscale_round_ps(A, B, C, imm, R) \
2399 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(C), (int)(imm), \
2400 (__v16sf)(__m512)(A), (__mmask16)(B), \
2401 (int)(R)))
2402
2403#define _mm512_maskz_roundscale_round_ps(A, B, imm, R) \
2404 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(B), (int)(imm), \
2405 (__v16sf)_mm512_setzero_ps(), \
2406 (__mmask16)(A), (int)(R)))
2407
2408#define _mm512_roundscale_round_ps(A, imm, R) \
2409 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(A), (int)(imm), \
2410 (__v16sf)_mm512_undefined_ps(), \
2411 (__mmask16)-1, (int)(R)))
2412
2413#define _mm512_roundscale_pd(A, B) \
2414 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(A), (int)(B), \
2415 (__v8df)_mm512_undefined_pd(), \
2416 (__mmask8)-1, \
2417 _MM_FROUND_CUR_DIRECTION))
2418
2419#define _mm512_mask_roundscale_pd(A, B, C, imm) \
2420 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(C), (int)(imm), \
2421 (__v8df)(__m512d)(A), (__mmask8)(B), \
2422 _MM_FROUND_CUR_DIRECTION))
2423
2424#define _mm512_maskz_roundscale_pd(A, B, imm) \
2425 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(B), (int)(imm), \
2426 (__v8df)_mm512_setzero_pd(), \
2427 (__mmask8)(A), \
2428 _MM_FROUND_CUR_DIRECTION))
2429
2430#define _mm512_mask_roundscale_round_pd(A, B, C, imm, R) \
2431 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(C), (int)(imm), \
2432 (__v8df)(__m512d)(A), (__mmask8)(B), \
2433 (int)(R)))
2434
2435#define _mm512_maskz_roundscale_round_pd(A, B, imm, R) \
2436 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(B), (int)(imm), \
2437 (__v8df)_mm512_setzero_pd(), \
2438 (__mmask8)(A), (int)(R)))
2439
2440#define _mm512_roundscale_round_pd(A, imm, R) \
2441 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(A), (int)(imm), \
2442 (__v8df)_mm512_undefined_pd(), \
2443 (__mmask8)-1, (int)(R)))
2444
2445#define _mm512_fmadd_round_pd(A, B, C, R) \
2446 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
2447 (__v8df)(__m512d)(B), \
2448 (__v8df)(__m512d)(C), \
2449 (__mmask8)-1, (int)(R)))
2450
2451
2452#define _mm512_mask_fmadd_round_pd(A, U, B, C, R) \
2453 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
2454 (__v8df)(__m512d)(B), \
2455 (__v8df)(__m512d)(C), \
2456 (__mmask8)(U), (int)(R)))
2457
2458
2459#define _mm512_mask3_fmadd_round_pd(A, B, C, U, R) \
2460 ((__m512d)__builtin_ia32_vfmaddpd512_mask3((__v8df)(__m512d)(A), \
2461 (__v8df)(__m512d)(B), \
2462 (__v8df)(__m512d)(C), \
2463 (__mmask8)(U), (int)(R)))
2464
2465
2466#define _mm512_maskz_fmadd_round_pd(U, A, B, C, R) \
2467 ((__m512d)__builtin_ia32_vfmaddpd512_maskz((__v8df)(__m512d)(A), \
2468 (__v8df)(__m512d)(B), \
2469 (__v8df)(__m512d)(C), \
2470 (__mmask8)(U), (int)(R)))
2471
2472
2473#define _mm512_fmsub_round_pd(A, B, C, R) \
2474 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
2475 (__v8df)(__m512d)(B), \
2476 -(__v8df)(__m512d)(C), \
2477 (__mmask8)-1, (int)(R)))
2478
2479
2480#define _mm512_mask_fmsub_round_pd(A, U, B, C, R) \
2481 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
2482 (__v8df)(__m512d)(B), \
2483 -(__v8df)(__m512d)(C), \
2484 (__mmask8)(U), (int)(R)))
2485
2486
2487#define _mm512_maskz_fmsub_round_pd(U, A, B, C, R) \
2488 ((__m512d)__builtin_ia32_vfmaddpd512_maskz((__v8df)(__m512d)(A), \
2489 (__v8df)(__m512d)(B), \
2490 -(__v8df)(__m512d)(C), \
2491 (__mmask8)(U), (int)(R)))
2492
2493
2494#define _mm512_fnmadd_round_pd(A, B, C, R) \
2495 ((__m512d)__builtin_ia32_vfmaddpd512_mask(-(__v8df)(__m512d)(A), \
2496 (__v8df)(__m512d)(B), \
2497 (__v8df)(__m512d)(C), \
2498 (__mmask8)-1, (int)(R)))
2499
2500
2501#define _mm512_mask3_fnmadd_round_pd(A, B, C, U, R) \
2502 ((__m512d)__builtin_ia32_vfmaddpd512_mask3(-(__v8df)(__m512d)(A), \
2503 (__v8df)(__m512d)(B), \
2504 (__v8df)(__m512d)(C), \
2505 (__mmask8)(U), (int)(R)))
2506
2507
2508#define _mm512_maskz_fnmadd_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)))
2513
2514
2515#define _mm512_fnmsub_round_pd(A, B, C, R) \
2516 ((__m512d)__builtin_ia32_vfmaddpd512_mask(-(__v8df)(__m512d)(A), \
2517 (__v8df)(__m512d)(B), \
2518 -(__v8df)(__m512d)(C), \
2519 (__mmask8)-1, (int)(R)))
2520
2521
2522#define _mm512_maskz_fnmsub_round_pd(U, A, B, C, R) \
2523 ((__m512d)__builtin_ia32_vfmaddpd512_maskz(-(__v8df)(__m512d)(A), \
2524 (__v8df)(__m512d)(B), \
2525 -(__v8df)(__m512d)(C), \
2526 (__mmask8)(U), (int)(R)))
2527
2528
2529static __inline__ __m512d __DEFAULT_FN_ATTRS512
2530_mm512_fmadd_pd(__m512d __A, __m512d __B, __m512d __C)
2531{
2532 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,
2533 (__v8df) __B,
2534 (__v8df) __C,
2535 (__mmask8) -1,
2537}
2538
2539static __inline__ __m512d __DEFAULT_FN_ATTRS512
2540_mm512_mask_fmadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C)
2541{
2542 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,
2543 (__v8df) __B,
2544 (__v8df) __C,
2545 (__mmask8) __U,
2547}
2548
2549static __inline__ __m512d __DEFAULT_FN_ATTRS512
2550_mm512_mask3_fmadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)
2551{
2552 return (__m512d) __builtin_ia32_vfmaddpd512_mask3 ((__v8df) __A,
2553 (__v8df) __B,
2554 (__v8df) __C,
2555 (__mmask8) __U,
2557}
2558
2559static __inline__ __m512d __DEFAULT_FN_ATTRS512
2560_mm512_maskz_fmadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)
2561{
2562 return (__m512d) __builtin_ia32_vfmaddpd512_maskz ((__v8df) __A,
2563 (__v8df) __B,
2564 (__v8df) __C,
2565 (__mmask8) __U,
2567}
2568
2569static __inline__ __m512d __DEFAULT_FN_ATTRS512
2570_mm512_fmsub_pd(__m512d __A, __m512d __B, __m512d __C)
2571{
2572 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,
2573 (__v8df) __B,
2574 -(__v8df) __C,
2575 (__mmask8) -1,
2577}
2578
2579static __inline__ __m512d __DEFAULT_FN_ATTRS512
2580_mm512_mask_fmsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C)
2581{
2582 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,
2583 (__v8df) __B,
2584 -(__v8df) __C,
2585 (__mmask8) __U,
2587}
2588
2589static __inline__ __m512d __DEFAULT_FN_ATTRS512
2590_mm512_maskz_fmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)
2591{
2592 return (__m512d) __builtin_ia32_vfmaddpd512_maskz ((__v8df) __A,
2593 (__v8df) __B,
2594 -(__v8df) __C,
2595 (__mmask8) __U,
2597}
2598
2599static __inline__ __m512d __DEFAULT_FN_ATTRS512
2600_mm512_fnmadd_pd(__m512d __A, __m512d __B, __m512d __C)
2601{
2602 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,
2603 -(__v8df) __B,
2604 (__v8df) __C,
2605 (__mmask8) -1,
2607}
2608
2609static __inline__ __m512d __DEFAULT_FN_ATTRS512
2610_mm512_mask3_fnmadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)
2611{
2612 return (__m512d) __builtin_ia32_vfmaddpd512_mask3 (-(__v8df) __A,
2613 (__v8df) __B,
2614 (__v8df) __C,
2615 (__mmask8) __U,
2617}
2618
2619static __inline__ __m512d __DEFAULT_FN_ATTRS512
2620_mm512_maskz_fnmadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)
2621{
2622 return (__m512d) __builtin_ia32_vfmaddpd512_maskz (-(__v8df) __A,
2623 (__v8df) __B,
2624 (__v8df) __C,
2625 (__mmask8) __U,
2627}
2628
2629static __inline__ __m512d __DEFAULT_FN_ATTRS512
2630_mm512_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C)
2631{
2632 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,
2633 -(__v8df) __B,
2634 -(__v8df) __C,
2635 (__mmask8) -1,
2637}
2638
2639static __inline__ __m512d __DEFAULT_FN_ATTRS512
2640_mm512_maskz_fnmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)
2641{
2642 return (__m512d) __builtin_ia32_vfmaddpd512_maskz (-(__v8df) __A,
2643 (__v8df) __B,
2644 -(__v8df) __C,
2645 (__mmask8) __U,
2647}
2648
2649#define _mm512_fmadd_round_ps(A, B, C, R) \
2650 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2651 (__v16sf)(__m512)(B), \
2652 (__v16sf)(__m512)(C), \
2653 (__mmask16)-1, (int)(R)))
2654
2655
2656#define _mm512_mask_fmadd_round_ps(A, U, B, C, R) \
2657 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2658 (__v16sf)(__m512)(B), \
2659 (__v16sf)(__m512)(C), \
2660 (__mmask16)(U), (int)(R)))
2661
2662
2663#define _mm512_mask3_fmadd_round_ps(A, B, C, U, R) \
2664 ((__m512)__builtin_ia32_vfmaddps512_mask3((__v16sf)(__m512)(A), \
2665 (__v16sf)(__m512)(B), \
2666 (__v16sf)(__m512)(C), \
2667 (__mmask16)(U), (int)(R)))
2668
2669
2670#define _mm512_maskz_fmadd_round_ps(U, A, B, C, R) \
2671 ((__m512)__builtin_ia32_vfmaddps512_maskz((__v16sf)(__m512)(A), \
2672 (__v16sf)(__m512)(B), \
2673 (__v16sf)(__m512)(C), \
2674 (__mmask16)(U), (int)(R)))
2675
2676
2677#define _mm512_fmsub_round_ps(A, B, C, R) \
2678 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2679 (__v16sf)(__m512)(B), \
2680 -(__v16sf)(__m512)(C), \
2681 (__mmask16)-1, (int)(R)))
2682
2683
2684#define _mm512_mask_fmsub_round_ps(A, U, B, C, R) \
2685 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2686 (__v16sf)(__m512)(B), \
2687 -(__v16sf)(__m512)(C), \
2688 (__mmask16)(U), (int)(R)))
2689
2690
2691#define _mm512_maskz_fmsub_round_ps(U, A, B, C, R) \
2692 ((__m512)__builtin_ia32_vfmaddps512_maskz((__v16sf)(__m512)(A), \
2693 (__v16sf)(__m512)(B), \
2694 -(__v16sf)(__m512)(C), \
2695 (__mmask16)(U), (int)(R)))
2696
2697
2698#define _mm512_fnmadd_round_ps(A, B, C, R) \
2699 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2700 -(__v16sf)(__m512)(B), \
2701 (__v16sf)(__m512)(C), \
2702 (__mmask16)-1, (int)(R)))
2703
2704
2705#define _mm512_mask3_fnmadd_round_ps(A, B, C, U, R) \
2706 ((__m512)__builtin_ia32_vfmaddps512_mask3(-(__v16sf)(__m512)(A), \
2707 (__v16sf)(__m512)(B), \
2708 (__v16sf)(__m512)(C), \
2709 (__mmask16)(U), (int)(R)))
2710
2711
2712#define _mm512_maskz_fnmadd_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)))
2717
2718
2719#define _mm512_fnmsub_round_ps(A, B, C, R) \
2720 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2721 -(__v16sf)(__m512)(B), \
2722 -(__v16sf)(__m512)(C), \
2723 (__mmask16)-1, (int)(R)))
2724
2725
2726#define _mm512_maskz_fnmsub_round_ps(U, A, B, C, R) \
2727 ((__m512)__builtin_ia32_vfmaddps512_maskz(-(__v16sf)(__m512)(A), \
2728 (__v16sf)(__m512)(B), \
2729 -(__v16sf)(__m512)(C), \
2730 (__mmask16)(U), (int)(R)))
2731
2732
2733static __inline__ __m512 __DEFAULT_FN_ATTRS512
2734_mm512_fmadd_ps(__m512 __A, __m512 __B, __m512 __C)
2735{
2736 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,
2737 (__v16sf) __B,
2738 (__v16sf) __C,
2739 (__mmask16) -1,
2741}
2742
2743static __inline__ __m512 __DEFAULT_FN_ATTRS512
2744_mm512_mask_fmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)
2745{
2746 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,
2747 (__v16sf) __B,
2748 (__v16sf) __C,
2749 (__mmask16) __U,
2751}
2752
2753static __inline__ __m512 __DEFAULT_FN_ATTRS512
2754_mm512_mask3_fmadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)
2755{
2756 return (__m512) __builtin_ia32_vfmaddps512_mask3 ((__v16sf) __A,
2757 (__v16sf) __B,
2758 (__v16sf) __C,
2759 (__mmask16) __U,
2761}
2762
2763static __inline__ __m512 __DEFAULT_FN_ATTRS512
2764_mm512_maskz_fmadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)
2765{
2766 return (__m512) __builtin_ia32_vfmaddps512_maskz ((__v16sf) __A,
2767 (__v16sf) __B,
2768 (__v16sf) __C,
2769 (__mmask16) __U,
2771}
2772
2773static __inline__ __m512 __DEFAULT_FN_ATTRS512
2774_mm512_fmsub_ps(__m512 __A, __m512 __B, __m512 __C)
2775{
2776 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,
2777 (__v16sf) __B,
2778 -(__v16sf) __C,
2779 (__mmask16) -1,
2781}
2782
2783static __inline__ __m512 __DEFAULT_FN_ATTRS512
2784_mm512_mask_fmsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)
2785{
2786 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,
2787 (__v16sf) __B,
2788 -(__v16sf) __C,
2789 (__mmask16) __U,
2791}
2792
2793static __inline__ __m512 __DEFAULT_FN_ATTRS512
2794_mm512_maskz_fmsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)
2795{
2796 return (__m512) __builtin_ia32_vfmaddps512_maskz ((__v16sf) __A,
2797 (__v16sf) __B,
2798 -(__v16sf) __C,
2799 (__mmask16) __U,
2801}
2802
2803static __inline__ __m512 __DEFAULT_FN_ATTRS512
2804_mm512_fnmadd_ps(__m512 __A, __m512 __B, __m512 __C)
2805{
2806 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,
2807 -(__v16sf) __B,
2808 (__v16sf) __C,
2809 (__mmask16) -1,
2811}
2812
2813static __inline__ __m512 __DEFAULT_FN_ATTRS512
2814_mm512_mask3_fnmadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)
2815{
2816 return (__m512) __builtin_ia32_vfmaddps512_mask3 (-(__v16sf) __A,
2817 (__v16sf) __B,
2818 (__v16sf) __C,
2819 (__mmask16) __U,
2821}
2822
2823static __inline__ __m512 __DEFAULT_FN_ATTRS512
2824_mm512_maskz_fnmadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)
2825{
2826 return (__m512) __builtin_ia32_vfmaddps512_maskz (-(__v16sf) __A,
2827 (__v16sf) __B,
2828 (__v16sf) __C,
2829 (__mmask16) __U,
2831}
2832
2833static __inline__ __m512 __DEFAULT_FN_ATTRS512
2834_mm512_fnmsub_ps(__m512 __A, __m512 __B, __m512 __C)
2835{
2836 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,
2837 -(__v16sf) __B,
2838 -(__v16sf) __C,
2839 (__mmask16) -1,
2841}
2842
2843static __inline__ __m512 __DEFAULT_FN_ATTRS512
2844_mm512_maskz_fnmsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)
2845{
2846 return (__m512) __builtin_ia32_vfmaddps512_maskz (-(__v16sf) __A,
2847 (__v16sf) __B,
2848 -(__v16sf) __C,
2849 (__mmask16) __U,
2851}
2852
2853#define _mm512_fmaddsub_round_pd(A, B, C, R) \
2854 ((__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \
2855 (__v8df)(__m512d)(B), \
2856 (__v8df)(__m512d)(C), \
2857 (__mmask8)-1, (int)(R)))
2858
2859
2860#define _mm512_mask_fmaddsub_round_pd(A, U, B, C, R) \
2861 ((__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \
2862 (__v8df)(__m512d)(B), \
2863 (__v8df)(__m512d)(C), \
2864 (__mmask8)(U), (int)(R)))
2865
2866
2867#define _mm512_mask3_fmaddsub_round_pd(A, B, C, U, R) \
2868 ((__m512d)__builtin_ia32_vfmaddsubpd512_mask3((__v8df)(__m512d)(A), \
2869 (__v8df)(__m512d)(B), \
2870 (__v8df)(__m512d)(C), \
2871 (__mmask8)(U), (int)(R)))
2872
2873
2874#define _mm512_maskz_fmaddsub_round_pd(U, A, B, C, R) \
2875 ((__m512d)__builtin_ia32_vfmaddsubpd512_maskz((__v8df)(__m512d)(A), \
2876 (__v8df)(__m512d)(B), \
2877 (__v8df)(__m512d)(C), \
2878 (__mmask8)(U), (int)(R)))
2879
2880
2881#define _mm512_fmsubadd_round_pd(A, B, C, R) \
2882 ((__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \
2883 (__v8df)(__m512d)(B), \
2884 -(__v8df)(__m512d)(C), \
2885 (__mmask8)-1, (int)(R)))
2886
2887
2888#define _mm512_mask_fmsubadd_round_pd(A, U, B, C, R) \
2889 ((__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \
2890 (__v8df)(__m512d)(B), \
2891 -(__v8df)(__m512d)(C), \
2892 (__mmask8)(U), (int)(R)))
2893
2894
2895#define _mm512_maskz_fmsubadd_round_pd(U, A, B, C, R) \
2896 ((__m512d)__builtin_ia32_vfmaddsubpd512_maskz((__v8df)(__m512d)(A), \
2897 (__v8df)(__m512d)(B), \
2898 -(__v8df)(__m512d)(C), \
2899 (__mmask8)(U), (int)(R)))
2900
2901
2902static __inline__ __m512d __DEFAULT_FN_ATTRS512
2903_mm512_fmaddsub_pd(__m512d __A, __m512d __B, __m512d __C)
2904{
2905 return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A,
2906 (__v8df) __B,
2907 (__v8df) __C,
2908 (__mmask8) -1,
2910}
2911
2912static __inline__ __m512d __DEFAULT_FN_ATTRS512
2913_mm512_mask_fmaddsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C)
2914{
2915 return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A,
2916 (__v8df) __B,
2917 (__v8df) __C,
2918 (__mmask8) __U,
2920}
2921
2922static __inline__ __m512d __DEFAULT_FN_ATTRS512
2923_mm512_mask3_fmaddsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)
2924{
2925 return (__m512d) __builtin_ia32_vfmaddsubpd512_mask3 ((__v8df) __A,
2926 (__v8df) __B,
2927 (__v8df) __C,
2928 (__mmask8) __U,
2930}
2931
2932static __inline__ __m512d __DEFAULT_FN_ATTRS512
2933_mm512_maskz_fmaddsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)
2934{
2935 return (__m512d) __builtin_ia32_vfmaddsubpd512_maskz ((__v8df) __A,
2936 (__v8df) __B,
2937 (__v8df) __C,
2938 (__mmask8) __U,
2940}
2941
2942static __inline__ __m512d __DEFAULT_FN_ATTRS512
2943_mm512_fmsubadd_pd(__m512d __A, __m512d __B, __m512d __C)
2944{
2945 return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A,
2946 (__v8df) __B,
2947 -(__v8df) __C,
2948 (__mmask8) -1,
2950}
2951
2952static __inline__ __m512d __DEFAULT_FN_ATTRS512
2953_mm512_mask_fmsubadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C)
2954{
2955 return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A,
2956 (__v8df) __B,
2957 -(__v8df) __C,
2958 (__mmask8) __U,
2960}
2961
2962static __inline__ __m512d __DEFAULT_FN_ATTRS512
2963_mm512_maskz_fmsubadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C)
2964{
2965 return (__m512d) __builtin_ia32_vfmaddsubpd512_maskz ((__v8df) __A,
2966 (__v8df) __B,
2967 -(__v8df) __C,
2968 (__mmask8) __U,
2970}
2971
2972#define _mm512_fmaddsub_round_ps(A, B, C, R) \
2973 ((__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \
2974 (__v16sf)(__m512)(B), \
2975 (__v16sf)(__m512)(C), \
2976 (__mmask16)-1, (int)(R)))
2977
2978
2979#define _mm512_mask_fmaddsub_round_ps(A, U, B, C, R) \
2980 ((__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \
2981 (__v16sf)(__m512)(B), \
2982 (__v16sf)(__m512)(C), \
2983 (__mmask16)(U), (int)(R)))
2984
2985
2986#define _mm512_mask3_fmaddsub_round_ps(A, B, C, U, R) \
2987 ((__m512)__builtin_ia32_vfmaddsubps512_mask3((__v16sf)(__m512)(A), \
2988 (__v16sf)(__m512)(B), \
2989 (__v16sf)(__m512)(C), \
2990 (__mmask16)(U), (int)(R)))
2991
2992
2993#define _mm512_maskz_fmaddsub_round_ps(U, A, B, C, R) \
2994 ((__m512)__builtin_ia32_vfmaddsubps512_maskz((__v16sf)(__m512)(A), \
2995 (__v16sf)(__m512)(B), \
2996 (__v16sf)(__m512)(C), \
2997 (__mmask16)(U), (int)(R)))
2998
2999
3000#define _mm512_fmsubadd_round_ps(A, B, C, R) \
3001 ((__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \
3002 (__v16sf)(__m512)(B), \
3003 -(__v16sf)(__m512)(C), \
3004 (__mmask16)-1, (int)(R)))
3005
3006
3007#define _mm512_mask_fmsubadd_round_ps(A, U, B, C, R) \
3008 ((__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \
3009 (__v16sf)(__m512)(B), \
3010 -(__v16sf)(__m512)(C), \
3011 (__mmask16)(U), (int)(R)))
3012
3013
3014#define _mm512_maskz_fmsubadd_round_ps(U, A, B, C, R) \
3015 ((__m512)__builtin_ia32_vfmaddsubps512_maskz((__v16sf)(__m512)(A), \
3016 (__v16sf)(__m512)(B), \
3017 -(__v16sf)(__m512)(C), \
3018 (__mmask16)(U), (int)(R)))
3019
3020
3021static __inline__ __m512 __DEFAULT_FN_ATTRS512
3022_mm512_fmaddsub_ps(__m512 __A, __m512 __B, __m512 __C)
3023{
3024 return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A,
3025 (__v16sf) __B,
3026 (__v16sf) __C,
3027 (__mmask16) -1,
3029}
3030
3031static __inline__ __m512 __DEFAULT_FN_ATTRS512
3032_mm512_mask_fmaddsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)
3033{
3034 return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A,
3035 (__v16sf) __B,
3036 (__v16sf) __C,
3037 (__mmask16) __U,
3039}
3040
3041static __inline__ __m512 __DEFAULT_FN_ATTRS512
3042_mm512_mask3_fmaddsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)
3043{
3044 return (__m512) __builtin_ia32_vfmaddsubps512_mask3 ((__v16sf) __A,
3045 (__v16sf) __B,
3046 (__v16sf) __C,
3047 (__mmask16) __U,
3049}
3050
3051static __inline__ __m512 __DEFAULT_FN_ATTRS512
3052_mm512_maskz_fmaddsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)
3053{
3054 return (__m512) __builtin_ia32_vfmaddsubps512_maskz ((__v16sf) __A,
3055 (__v16sf) __B,
3056 (__v16sf) __C,
3057 (__mmask16) __U,
3059}
3060
3061static __inline__ __m512 __DEFAULT_FN_ATTRS512
3062_mm512_fmsubadd_ps(__m512 __A, __m512 __B, __m512 __C)
3063{
3064 return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A,
3065 (__v16sf) __B,
3066 -(__v16sf) __C,
3067 (__mmask16) -1,
3069}
3070
3071static __inline__ __m512 __DEFAULT_FN_ATTRS512
3072_mm512_mask_fmsubadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)
3073{
3074 return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A,
3075 (__v16sf) __B,
3076 -(__v16sf) __C,
3077 (__mmask16) __U,
3079}
3080
3081static __inline__ __m512 __DEFAULT_FN_ATTRS512
3082_mm512_maskz_fmsubadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C)
3083{
3084 return (__m512) __builtin_ia32_vfmaddsubps512_maskz ((__v16sf) __A,
3085 (__v16sf) __B,
3086 -(__v16sf) __C,
3087 (__mmask16) __U,
3089}
3090
3091#define _mm512_mask3_fmsub_round_pd(A, B, C, U, R) \
3092 ((__m512d)__builtin_ia32_vfmsubpd512_mask3((__v8df)(__m512d)(A), \
3093 (__v8df)(__m512d)(B), \
3094 (__v8df)(__m512d)(C), \
3095 (__mmask8)(U), (int)(R)))
3096
3097
3098static __inline__ __m512d __DEFAULT_FN_ATTRS512
3099_mm512_mask3_fmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)
3100{
3101 return (__m512d)__builtin_ia32_vfmsubpd512_mask3 ((__v8df) __A,
3102 (__v8df) __B,
3103 (__v8df) __C,
3104 (__mmask8) __U,
3106}
3107
3108#define _mm512_mask3_fmsub_round_ps(A, B, C, U, R) \
3109 ((__m512)__builtin_ia32_vfmsubps512_mask3((__v16sf)(__m512)(A), \
3110 (__v16sf)(__m512)(B), \
3111 (__v16sf)(__m512)(C), \
3112 (__mmask16)(U), (int)(R)))
3113
3114static __inline__ __m512 __DEFAULT_FN_ATTRS512
3115_mm512_mask3_fmsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)
3116{
3117 return (__m512)__builtin_ia32_vfmsubps512_mask3 ((__v16sf) __A,
3118 (__v16sf) __B,
3119 (__v16sf) __C,
3120 (__mmask16) __U,
3122}
3123
3124#define _mm512_mask3_fmsubadd_round_pd(A, B, C, U, R) \
3125 ((__m512d)__builtin_ia32_vfmsubaddpd512_mask3((__v8df)(__m512d)(A), \
3126 (__v8df)(__m512d)(B), \
3127 (__v8df)(__m512d)(C), \
3128 (__mmask8)(U), (int)(R)))
3129
3130
3131static __inline__ __m512d __DEFAULT_FN_ATTRS512
3132_mm512_mask3_fmsubadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)
3133{
3134 return (__m512d)__builtin_ia32_vfmsubaddpd512_mask3 ((__v8df) __A,
3135 (__v8df) __B,
3136 (__v8df) __C,
3137 (__mmask8) __U,
3139}
3140
3141#define _mm512_mask3_fmsubadd_round_ps(A, B, C, U, R) \
3142 ((__m512)__builtin_ia32_vfmsubaddps512_mask3((__v16sf)(__m512)(A), \
3143 (__v16sf)(__m512)(B), \
3144 (__v16sf)(__m512)(C), \
3145 (__mmask16)(U), (int)(R)))
3146
3147
3148static __inline__ __m512 __DEFAULT_FN_ATTRS512
3149_mm512_mask3_fmsubadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)
3150{
3151 return (__m512)__builtin_ia32_vfmsubaddps512_mask3 ((__v16sf) __A,
3152 (__v16sf) __B,
3153 (__v16sf) __C,
3154 (__mmask16) __U,
3156}
3157
3158#define _mm512_mask_fnmadd_round_pd(A, U, B, C, R) \
3159 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
3160 -(__v8df)(__m512d)(B), \
3161 (__v8df)(__m512d)(C), \
3162 (__mmask8)(U), (int)(R)))
3163
3164
3165static __inline__ __m512d __DEFAULT_FN_ATTRS512
3166_mm512_mask_fnmadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C)
3167{
3168 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,
3169 -(__v8df) __B,
3170 (__v8df) __C,
3171 (__mmask8) __U,
3173}
3174
3175#define _mm512_mask_fnmadd_round_ps(A, U, B, C, R) \
3176 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
3177 -(__v16sf)(__m512)(B), \
3178 (__v16sf)(__m512)(C), \
3179 (__mmask16)(U), (int)(R)))
3180
3181
3182static __inline__ __m512 __DEFAULT_FN_ATTRS512
3183_mm512_mask_fnmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)
3184{
3185 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,
3186 -(__v16sf) __B,
3187 (__v16sf) __C,
3188 (__mmask16) __U,
3190}
3191
3192#define _mm512_mask_fnmsub_round_pd(A, U, B, C, R) \
3193 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
3194 -(__v8df)(__m512d)(B), \
3195 -(__v8df)(__m512d)(C), \
3196 (__mmask8)(U), (int)(R)))
3197
3198
3199#define _mm512_mask3_fnmsub_round_pd(A, B, C, U, R) \
3200 ((__m512d)__builtin_ia32_vfmsubpd512_mask3(-(__v8df)(__m512d)(A), \
3201 (__v8df)(__m512d)(B), \
3202 (__v8df)(__m512d)(C), \
3203 (__mmask8)(U), (int)(R)))
3204
3205
3206static __inline__ __m512d __DEFAULT_FN_ATTRS512
3207_mm512_mask_fnmsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C)
3208{
3209 return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A,
3210 -(__v8df) __B,
3211 -(__v8df) __C,
3212 (__mmask8) __U,
3214}
3215
3216static __inline__ __m512d __DEFAULT_FN_ATTRS512
3217_mm512_mask3_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U)
3218{
3219 return (__m512d) __builtin_ia32_vfmsubpd512_mask3 (-(__v8df) __A,
3220 (__v8df) __B,
3221 (__v8df) __C,
3222 (__mmask8) __U,
3224}
3225
3226#define _mm512_mask_fnmsub_round_ps(A, U, B, C, R) \
3227 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
3228 -(__v16sf)(__m512)(B), \
3229 -(__v16sf)(__m512)(C), \
3230 (__mmask16)(U), (int)(R)))
3231
3232
3233#define _mm512_mask3_fnmsub_round_ps(A, B, C, U, R) \
3234 ((__m512)__builtin_ia32_vfmsubps512_mask3(-(__v16sf)(__m512)(A), \
3235 (__v16sf)(__m512)(B), \
3236 (__v16sf)(__m512)(C), \
3237 (__mmask16)(U), (int)(R)))
3238
3239
3240static __inline__ __m512 __DEFAULT_FN_ATTRS512
3241_mm512_mask_fnmsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C)
3242{
3243 return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A,
3244 -(__v16sf) __B,
3245 -(__v16sf) __C,
3246 (__mmask16) __U,
3248}
3249
3250static __inline__ __m512 __DEFAULT_FN_ATTRS512
3251_mm512_mask3_fnmsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U)
3252{
3253 return (__m512) __builtin_ia32_vfmsubps512_mask3 (-(__v16sf) __A,
3254 (__v16sf) __B,
3255 (__v16sf) __C,
3256 (__mmask16) __U,
3258}
3259
3260
3261
3262/* Vector permutations */
3263
3264static __inline __m512i __DEFAULT_FN_ATTRS512
3265_mm512_permutex2var_epi32(__m512i __A, __m512i __I, __m512i __B)
3266{
3267 return (__m512i)__builtin_ia32_vpermi2vard512((__v16si)__A, (__v16si) __I,
3268 (__v16si) __B);
3269}
3270
3271static __inline__ __m512i __DEFAULT_FN_ATTRS512
3272_mm512_mask_permutex2var_epi32(__m512i __A, __mmask16 __U, __m512i __I,
3273 __m512i __B)
3274{
3275 return (__m512i)__builtin_ia32_selectd_512(__U,
3276 (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),
3277 (__v16si)__A);
3278}
3279
3280static __inline__ __m512i __DEFAULT_FN_ATTRS512
3281_mm512_mask2_permutex2var_epi32(__m512i __A, __m512i __I, __mmask16 __U,
3282 __m512i __B)
3283{
3284 return (__m512i)__builtin_ia32_selectd_512(__U,
3285 (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),
3286 (__v16si)__I);
3287}
3288
3289static __inline__ __m512i __DEFAULT_FN_ATTRS512
3290_mm512_maskz_permutex2var_epi32(__mmask16 __U, __m512i __A, __m512i __I,
3291 __m512i __B)
3292{
3293 return (__m512i)__builtin_ia32_selectd_512(__U,
3294 (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),
3295 (__v16si)_mm512_setzero_si512());
3296}
3297
3298static __inline __m512i __DEFAULT_FN_ATTRS512
3299_mm512_permutex2var_epi64(__m512i __A, __m512i __I, __m512i __B)
3300{
3301 return (__m512i)__builtin_ia32_vpermi2varq512((__v8di)__A, (__v8di) __I,
3302 (__v8di) __B);
3303}
3304
3305static __inline__ __m512i __DEFAULT_FN_ATTRS512
3306_mm512_mask_permutex2var_epi64(__m512i __A, __mmask8 __U, __m512i __I,
3307 __m512i __B)
3308{
3309 return (__m512i)__builtin_ia32_selectq_512(__U,
3310 (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),
3311 (__v8di)__A);
3312}
3313
3314static __inline__ __m512i __DEFAULT_FN_ATTRS512
3315_mm512_mask2_permutex2var_epi64(__m512i __A, __m512i __I, __mmask8 __U,
3316 __m512i __B)
3317{
3318 return (__m512i)__builtin_ia32_selectq_512(__U,
3319 (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),
3320 (__v8di)__I);
3321}
3322
3323static __inline__ __m512i __DEFAULT_FN_ATTRS512
3324_mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I,
3325 __m512i __B)
3326{
3327 return (__m512i)__builtin_ia32_selectq_512(__U,
3328 (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),
3329 (__v8di)_mm512_setzero_si512());
3330}
3331
3332#define _mm512_alignr_epi64(A, B, I) \
3333 ((__m512i)__builtin_ia32_alignq512((__v8di)(__m512i)(A), \
3334 (__v8di)(__m512i)(B), (int)(I)))
3335
3336#define _mm512_mask_alignr_epi64(W, U, A, B, imm) \
3337 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
3338 (__v8di)_mm512_alignr_epi64((A), (B), (imm)), \
3339 (__v8di)(__m512i)(W)))
3340
3341#define _mm512_maskz_alignr_epi64(U, A, B, imm) \
3342 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
3343 (__v8di)_mm512_alignr_epi64((A), (B), (imm)), \
3344 (__v8di)_mm512_setzero_si512()))
3345
3346#define _mm512_alignr_epi32(A, B, I) \
3347 ((__m512i)__builtin_ia32_alignd512((__v16si)(__m512i)(A), \
3348 (__v16si)(__m512i)(B), (int)(I)))
3349
3350#define _mm512_mask_alignr_epi32(W, U, A, B, imm) \
3351 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
3352 (__v16si)_mm512_alignr_epi32((A), (B), (imm)), \
3353 (__v16si)(__m512i)(W)))
3354
3355#define _mm512_maskz_alignr_epi32(U, A, B, imm) \
3356 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
3357 (__v16si)_mm512_alignr_epi32((A), (B), (imm)), \
3358 (__v16si)_mm512_setzero_si512()))
3359/* Vector Extract */
3360
3361#define _mm512_extractf64x4_pd(A, I) \
3362 ((__m256d)__builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), (int)(I), \
3363 (__v4df)_mm256_undefined_pd(), \
3364 (__mmask8)-1))
3365
3366#define _mm512_mask_extractf64x4_pd(W, U, A, imm) \
3367 ((__m256d)__builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), (int)(imm), \
3368 (__v4df)(__m256d)(W), \
3369 (__mmask8)(U)))
3370
3371#define _mm512_maskz_extractf64x4_pd(U, A, imm) \
3372 ((__m256d)__builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), (int)(imm), \
3373 (__v4df)_mm256_setzero_pd(), \
3374 (__mmask8)(U)))
3375
3376#define _mm512_extractf32x4_ps(A, I) \
3377 ((__m128)__builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), (int)(I), \
3378 (__v4sf)_mm_undefined_ps(), \
3379 (__mmask8)-1))
3380
3381#define _mm512_mask_extractf32x4_ps(W, U, A, imm) \
3382 ((__m128)__builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), (int)(imm), \
3383 (__v4sf)(__m128)(W), \
3384 (__mmask8)(U)))
3385
3386#define _mm512_maskz_extractf32x4_ps(U, A, imm) \
3387 ((__m128)__builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), (int)(imm), \
3388 (__v4sf)_mm_setzero_ps(), \
3389 (__mmask8)(U)))
3390
3391/* Vector Blend */
3392
3393static __inline __m512d __DEFAULT_FN_ATTRS512
3394_mm512_mask_blend_pd(__mmask8 __U, __m512d __A, __m512d __W)
3395{
3396 return (__m512d) __builtin_ia32_selectpd_512 ((__mmask8) __U,
3397 (__v8df) __W,
3398 (__v8df) __A);
3399}
3400
3401static __inline __m512 __DEFAULT_FN_ATTRS512
3402_mm512_mask_blend_ps(__mmask16 __U, __m512 __A, __m512 __W)
3403{
3404 return (__m512) __builtin_ia32_selectps_512 ((__mmask16) __U,
3405 (__v16sf) __W,
3406 (__v16sf) __A);
3407}
3408
3409static __inline __m512i __DEFAULT_FN_ATTRS512
3410_mm512_mask_blend_epi64(__mmask8 __U, __m512i __A, __m512i __W)
3411{
3412 return (__m512i) __builtin_ia32_selectq_512 ((__mmask8) __U,
3413 (__v8di) __W,
3414 (__v8di) __A);
3415}
3416
3417static __inline __m512i __DEFAULT_FN_ATTRS512
3418_mm512_mask_blend_epi32(__mmask16 __U, __m512i __A, __m512i __W)
3419{
3420 return (__m512i) __builtin_ia32_selectd_512 ((__mmask16) __U,
3421 (__v16si) __W,
3422 (__v16si) __A);
3423}
3424
3425/* Compare */
3426
3427#define _mm512_cmp_round_ps_mask(A, B, P, R) \
3428 ((__mmask16)__builtin_ia32_cmpps512_mask((__v16sf)(__m512)(A), \
3429 (__v16sf)(__m512)(B), (int)(P), \
3430 (__mmask16)-1, (int)(R)))
3431
3432#define _mm512_mask_cmp_round_ps_mask(U, A, B, P, R) \
3433 ((__mmask16)__builtin_ia32_cmpps512_mask((__v16sf)(__m512)(A), \
3434 (__v16sf)(__m512)(B), (int)(P), \
3435 (__mmask16)(U), (int)(R)))
3436
3437#define _mm512_cmp_ps_mask(A, B, P) \
3438 _mm512_cmp_round_ps_mask((A), (B), (P), _MM_FROUND_CUR_DIRECTION)
3439#define _mm512_mask_cmp_ps_mask(U, A, B, P) \
3440 _mm512_mask_cmp_round_ps_mask((U), (A), (B), (P), _MM_FROUND_CUR_DIRECTION)
3441
3442#define _mm512_cmpeq_ps_mask(A, B) \
3443 _mm512_cmp_ps_mask((A), (B), _CMP_EQ_OQ)
3444#define _mm512_mask_cmpeq_ps_mask(k, A, B) \
3445 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_EQ_OQ)
3446
3447#define _mm512_cmplt_ps_mask(A, B) \
3448 _mm512_cmp_ps_mask((A), (B), _CMP_LT_OS)
3449#define _mm512_mask_cmplt_ps_mask(k, A, B) \
3450 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_LT_OS)
3451
3452#define _mm512_cmple_ps_mask(A, B) \
3453 _mm512_cmp_ps_mask((A), (B), _CMP_LE_OS)
3454#define _mm512_mask_cmple_ps_mask(k, A, B) \
3455 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_LE_OS)
3456
3457#define _mm512_cmpunord_ps_mask(A, B) \
3458 _mm512_cmp_ps_mask((A), (B), _CMP_UNORD_Q)
3459#define _mm512_mask_cmpunord_ps_mask(k, A, B) \
3460 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_UNORD_Q)
3461
3462#define _mm512_cmpneq_ps_mask(A, B) \
3463 _mm512_cmp_ps_mask((A), (B), _CMP_NEQ_UQ)
3464#define _mm512_mask_cmpneq_ps_mask(k, A, B) \
3465 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_NEQ_UQ)
3466
3467#define _mm512_cmpnlt_ps_mask(A, B) \
3468 _mm512_cmp_ps_mask((A), (B), _CMP_NLT_US)
3469#define _mm512_mask_cmpnlt_ps_mask(k, A, B) \
3470 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_NLT_US)
3471
3472#define _mm512_cmpnle_ps_mask(A, B) \
3473 _mm512_cmp_ps_mask((A), (B), _CMP_NLE_US)
3474#define _mm512_mask_cmpnle_ps_mask(k, A, B) \
3475 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_NLE_US)
3476
3477#define _mm512_cmpord_ps_mask(A, B) \
3478 _mm512_cmp_ps_mask((A), (B), _CMP_ORD_Q)
3479#define _mm512_mask_cmpord_ps_mask(k, A, B) \
3480 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_ORD_Q)
3481
3482#define _mm512_cmp_round_pd_mask(A, B, P, R) \
3483 ((__mmask8)__builtin_ia32_cmppd512_mask((__v8df)(__m512d)(A), \
3484 (__v8df)(__m512d)(B), (int)(P), \
3485 (__mmask8)-1, (int)(R)))
3486
3487#define _mm512_mask_cmp_round_pd_mask(U, A, B, P, R) \
3488 ((__mmask8)__builtin_ia32_cmppd512_mask((__v8df)(__m512d)(A), \
3489 (__v8df)(__m512d)(B), (int)(P), \
3490 (__mmask8)(U), (int)(R)))
3491
3492#define _mm512_cmp_pd_mask(A, B, P) \
3493 _mm512_cmp_round_pd_mask((A), (B), (P), _MM_FROUND_CUR_DIRECTION)
3494#define _mm512_mask_cmp_pd_mask(U, A, B, P) \
3495 _mm512_mask_cmp_round_pd_mask((U), (A), (B), (P), _MM_FROUND_CUR_DIRECTION)
3496
3497#define _mm512_cmpeq_pd_mask(A, B) \
3498 _mm512_cmp_pd_mask((A), (B), _CMP_EQ_OQ)
3499#define _mm512_mask_cmpeq_pd_mask(k, A, B) \
3500 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_EQ_OQ)
3501
3502#define _mm512_cmplt_pd_mask(A, B) \
3503 _mm512_cmp_pd_mask((A), (B), _CMP_LT_OS)
3504#define _mm512_mask_cmplt_pd_mask(k, A, B) \
3505 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_LT_OS)
3506
3507#define _mm512_cmple_pd_mask(A, B) \
3508 _mm512_cmp_pd_mask((A), (B), _CMP_LE_OS)
3509#define _mm512_mask_cmple_pd_mask(k, A, B) \
3510 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_LE_OS)
3511
3512#define _mm512_cmpunord_pd_mask(A, B) \
3513 _mm512_cmp_pd_mask((A), (B), _CMP_UNORD_Q)
3514#define _mm512_mask_cmpunord_pd_mask(k, A, B) \
3515 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_UNORD_Q)
3516
3517#define _mm512_cmpneq_pd_mask(A, B) \
3518 _mm512_cmp_pd_mask((A), (B), _CMP_NEQ_UQ)
3519#define _mm512_mask_cmpneq_pd_mask(k, A, B) \
3520 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_NEQ_UQ)
3521
3522#define _mm512_cmpnlt_pd_mask(A, B) \
3523 _mm512_cmp_pd_mask((A), (B), _CMP_NLT_US)
3524#define _mm512_mask_cmpnlt_pd_mask(k, A, B) \
3525 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_NLT_US)
3526
3527#define _mm512_cmpnle_pd_mask(A, B) \
3528 _mm512_cmp_pd_mask((A), (B), _CMP_NLE_US)
3529#define _mm512_mask_cmpnle_pd_mask(k, A, B) \
3530 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_NLE_US)
3531
3532#define _mm512_cmpord_pd_mask(A, B) \
3533 _mm512_cmp_pd_mask((A), (B), _CMP_ORD_Q)
3534#define _mm512_mask_cmpord_pd_mask(k, A, B) \
3535 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_ORD_Q)
3536
3537/* Conversion */
3538
3539#define _mm512_cvtt_roundps_epu32(A, R) \
3540 ((__m512i)__builtin_ia32_cvttps2udq512_mask((__v16sf)(__m512)(A), \
3541 (__v16si)_mm512_undefined_epi32(), \
3542 (__mmask16)-1, (int)(R)))
3543
3544#define _mm512_mask_cvtt_roundps_epu32(W, U, A, R) \
3545 ((__m512i)__builtin_ia32_cvttps2udq512_mask((__v16sf)(__m512)(A), \
3546 (__v16si)(__m512i)(W), \
3547 (__mmask16)(U), (int)(R)))
3548
3549#define _mm512_maskz_cvtt_roundps_epu32(U, A, R) \
3550 ((__m512i)__builtin_ia32_cvttps2udq512_mask((__v16sf)(__m512)(A), \
3551 (__v16si)_mm512_setzero_si512(), \
3552 (__mmask16)(U), (int)(R)))
3553
3554
3555static __inline __m512i __DEFAULT_FN_ATTRS512
3557{
3558 return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A,
3559 (__v16si)
3561 (__mmask16) -1,
3563}
3564
3565static __inline__ __m512i __DEFAULT_FN_ATTRS512
3566_mm512_mask_cvttps_epu32 (__m512i __W, __mmask16 __U, __m512 __A)
3567{
3568 return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A,
3569 (__v16si) __W,
3570 (__mmask16) __U,
3572}
3573
3574static __inline__ __m512i __DEFAULT_FN_ATTRS512
3576{
3577 return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A,
3578 (__v16si) _mm512_setzero_si512 (),
3579 (__mmask16) __U,
3581}
3582
3583#define _mm512_cvt_roundepi32_ps(A, R) \
3584 ((__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(__m512i)(A), \
3585 (__v16sf)_mm512_setzero_ps(), \
3586 (__mmask16)-1, (int)(R)))
3587
3588#define _mm512_mask_cvt_roundepi32_ps(W, U, A, R) \
3589 ((__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(__m512i)(A), \
3590 (__v16sf)(__m512)(W), \
3591 (__mmask16)(U), (int)(R)))
3592
3593#define _mm512_maskz_cvt_roundepi32_ps(U, A, R) \
3594 ((__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(__m512i)(A), \
3595 (__v16sf)_mm512_setzero_ps(), \
3596 (__mmask16)(U), (int)(R)))
3597
3598#define _mm512_cvt_roundepu32_ps(A, R) \
3599 ((__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(__m512i)(A), \
3600 (__v16sf)_mm512_setzero_ps(), \
3601 (__mmask16)-1, (int)(R)))
3602
3603#define _mm512_mask_cvt_roundepu32_ps(W, U, A, R) \
3604 ((__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(__m512i)(A), \
3605 (__v16sf)(__m512)(W), \
3606 (__mmask16)(U), (int)(R)))
3607
3608#define _mm512_maskz_cvt_roundepu32_ps(U, A, R) \
3609 ((__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(__m512i)(A), \
3610 (__v16sf)_mm512_setzero_ps(), \
3611 (__mmask16)(U), (int)(R)))
3612
3613static __inline__ __m512 __DEFAULT_FN_ATTRS512
3615{
3616 return (__m512)__builtin_convertvector((__v16su)__A, __v16sf);
3617}
3618
3619static __inline__ __m512 __DEFAULT_FN_ATTRS512
3620_mm512_mask_cvtepu32_ps (__m512 __W, __mmask16 __U, __m512i __A)
3621{
3622 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
3623 (__v16sf)_mm512_cvtepu32_ps(__A),
3624 (__v16sf)__W);
3625}
3626
3627static __inline__ __m512 __DEFAULT_FN_ATTRS512
3629{
3630 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
3631 (__v16sf)_mm512_cvtepu32_ps(__A),
3632 (__v16sf)_mm512_setzero_ps());
3633}
3634
3635static __inline __m512d __DEFAULT_FN_ATTRS512
3637{
3638 return (__m512d)__builtin_convertvector((__v8si)__A, __v8df);
3639}
3640
3641static __inline__ __m512d __DEFAULT_FN_ATTRS512
3642_mm512_mask_cvtepi32_pd (__m512d __W, __mmask8 __U, __m256i __A)
3643{
3644 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
3645 (__v8df)_mm512_cvtepi32_pd(__A),
3646 (__v8df)__W);
3647}
3648
3649static __inline__ __m512d __DEFAULT_FN_ATTRS512
3651{
3652 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
3653 (__v8df)_mm512_cvtepi32_pd(__A),
3654 (__v8df)_mm512_setzero_pd());
3655}
3656
3657static __inline__ __m512d __DEFAULT_FN_ATTRS512
3659{
3660 return (__m512d) _mm512_cvtepi32_pd(_mm512_castsi512_si256(__A));
3661}
3662
3663static __inline__ __m512d __DEFAULT_FN_ATTRS512
3664_mm512_mask_cvtepi32lo_pd(__m512d __W, __mmask8 __U,__m512i __A)
3665{
3666 return (__m512d) _mm512_mask_cvtepi32_pd(__W, __U, _mm512_castsi512_si256(__A));
3667}
3668
3669static __inline__ __m512 __DEFAULT_FN_ATTRS512
3671{
3672 return (__m512)__builtin_convertvector((__v16si)__A, __v16sf);
3673}
3674
3675static __inline__ __m512 __DEFAULT_FN_ATTRS512
3676_mm512_mask_cvtepi32_ps (__m512 __W, __mmask16 __U, __m512i __A)
3677{
3678 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
3679 (__v16sf)_mm512_cvtepi32_ps(__A),
3680 (__v16sf)__W);
3681}
3682
3683static __inline__ __m512 __DEFAULT_FN_ATTRS512
3685{
3686 return (__m512)__builtin_ia32_selectps_512((__mmask16)__U,
3687 (__v16sf)_mm512_cvtepi32_ps(__A),
3688 (__v16sf)_mm512_setzero_ps());
3689}
3690
3691static __inline __m512d __DEFAULT_FN_ATTRS512
3693{
3694 return (__m512d)__builtin_convertvector((__v8su)__A, __v8df);
3695}
3696
3697static __inline__ __m512d __DEFAULT_FN_ATTRS512
3698_mm512_mask_cvtepu32_pd (__m512d __W, __mmask8 __U, __m256i __A)
3699{
3700 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
3701 (__v8df)_mm512_cvtepu32_pd(__A),
3702 (__v8df)__W);
3703}
3704
3705static __inline__ __m512d __DEFAULT_FN_ATTRS512
3707{
3708 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
3709 (__v8df)_mm512_cvtepu32_pd(__A),
3710 (__v8df)_mm512_setzero_pd());
3711}
3712
3713static __inline__ __m512d __DEFAULT_FN_ATTRS512
3715{
3716 return (__m512d) _mm512_cvtepu32_pd(_mm512_castsi512_si256(__A));
3717}
3718
3719static __inline__ __m512d __DEFAULT_FN_ATTRS512
3720_mm512_mask_cvtepu32lo_pd(__m512d __W, __mmask8 __U,__m512i __A)
3721{
3722 return (__m512d) _mm512_mask_cvtepu32_pd(__W, __U, _mm512_castsi512_si256(__A));
3723}
3724
3725#define _mm512_cvt_roundpd_ps(A, R) \
3726 ((__m256)__builtin_ia32_cvtpd2ps512_mask((__v8df)(__m512d)(A), \
3727 (__v8sf)_mm256_setzero_ps(), \
3728 (__mmask8)-1, (int)(R)))
3729
3730#define _mm512_mask_cvt_roundpd_ps(W, U, A, R) \
3731 ((__m256)__builtin_ia32_cvtpd2ps512_mask((__v8df)(__m512d)(A), \
3732 (__v8sf)(__m256)(W), (__mmask8)(U), \
3733 (int)(R)))
3734
3735#define _mm512_maskz_cvt_roundpd_ps(U, A, R) \
3736 ((__m256)__builtin_ia32_cvtpd2ps512_mask((__v8df)(__m512d)(A), \
3737 (__v8sf)_mm256_setzero_ps(), \
3738 (__mmask8)(U), (int)(R)))
3739
3740static __inline__ __m256 __DEFAULT_FN_ATTRS512
3741_mm512_cvtpd_ps (__m512d __A)
3742{
3743 return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A,
3744 (__v8sf) _mm256_undefined_ps (),
3745 (__mmask8) -1,
3747}
3748
3749static __inline__ __m256 __DEFAULT_FN_ATTRS512
3750_mm512_mask_cvtpd_ps (__m256 __W, __mmask8 __U, __m512d __A)
3751{
3752 return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A,
3753 (__v8sf) __W,
3754 (__mmask8) __U,
3756}
3757
3758static __inline__ __m256 __DEFAULT_FN_ATTRS512
3760{
3761 return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A,
3762 (__v8sf) _mm256_setzero_ps (),
3763 (__mmask8) __U,
3765}
3766
3767static __inline__ __m512 __DEFAULT_FN_ATTRS512
3769{
3770 return (__m512) __builtin_shufflevector((__v8sf) _mm512_cvtpd_ps(__A),
3771 (__v8sf) _mm256_setzero_ps (),
3772 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
3773}
3774
3775static __inline__ __m512 __DEFAULT_FN_ATTRS512
3776_mm512_mask_cvtpd_pslo (__m512 __W, __mmask8 __U,__m512d __A)
3777{
3778 return (__m512) __builtin_shufflevector (
3780 __U, __A),
3781 (__v8sf) _mm256_setzero_ps (),
3782 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
3783}
3784
3785#define _mm512_cvt_roundps_ph(A, I) \
3786 ((__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \
3787 (__v16hi)_mm256_undefined_si256(), \
3788 (__mmask16)-1))
3789
3790#define _mm512_mask_cvt_roundps_ph(U, W, A, I) \
3791 ((__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \
3792 (__v16hi)(__m256i)(U), \
3793 (__mmask16)(W)))
3794
3795#define _mm512_maskz_cvt_roundps_ph(W, A, I) \
3796 ((__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \
3797 (__v16hi)_mm256_setzero_si256(), \
3798 (__mmask16)(W)))
3799
3800#define _mm512_cvtps_ph _mm512_cvt_roundps_ph
3801#define _mm512_mask_cvtps_ph _mm512_mask_cvt_roundps_ph
3802#define _mm512_maskz_cvtps_ph _mm512_maskz_cvt_roundps_ph
3803
3804#define _mm512_cvt_roundph_ps(A, R) \
3805 ((__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(__m256i)(A), \
3806 (__v16sf)_mm512_undefined_ps(), \
3807 (__mmask16)-1, (int)(R)))
3808
3809#define _mm512_mask_cvt_roundph_ps(W, U, A, R) \
3810 ((__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(__m256i)(A), \
3811 (__v16sf)(__m512)(W), \
3812 (__mmask16)(U), (int)(R)))
3813
3814#define _mm512_maskz_cvt_roundph_ps(U, A, R) \
3815 ((__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(__m256i)(A), \
3816 (__v16sf)_mm512_setzero_ps(), \
3817 (__mmask16)(U), (int)(R)))
3818
3819
3820static __inline __m512 __DEFAULT_FN_ATTRS512
3822{
3823 return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A,
3824 (__v16sf)
3826 (__mmask16) -1,
3828}
3829
3830static __inline__ __m512 __DEFAULT_FN_ATTRS512
3831_mm512_mask_cvtph_ps (__m512 __W, __mmask16 __U, __m256i __A)
3832{
3833 return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A,
3834 (__v16sf) __W,
3835 (__mmask16) __U,
3837}
3838
3839static __inline__ __m512 __DEFAULT_FN_ATTRS512
3841{
3842 return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A,
3843 (__v16sf) _mm512_setzero_ps (),
3844 (__mmask16) __U,
3846}
3847
3848#define _mm512_cvtt_roundpd_epi32(A, R) \
3849 ((__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df)(__m512d)(A), \
3850 (__v8si)_mm256_setzero_si256(), \
3851 (__mmask8)-1, (int)(R)))
3852
3853#define _mm512_mask_cvtt_roundpd_epi32(W, U, A, R) \
3854 ((__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df)(__m512d)(A), \
3855 (__v8si)(__m256i)(W), \
3856 (__mmask8)(U), (int)(R)))
3857
3858#define _mm512_maskz_cvtt_roundpd_epi32(U, A, R) \
3859 ((__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df)(__m512d)(A), \
3860 (__v8si)_mm256_setzero_si256(), \
3861 (__mmask8)(U), (int)(R)))
3862
3863static __inline __m256i __DEFAULT_FN_ATTRS512
3865{
3866 return (__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df) __a,
3867 (__v8si)_mm256_setzero_si256(),
3868 (__mmask8) -1,
3870}
3871
3872static __inline__ __m256i __DEFAULT_FN_ATTRS512
3873_mm512_mask_cvttpd_epi32 (__m256i __W, __mmask8 __U, __m512d __A)
3874{
3875 return (__m256i) __builtin_ia32_cvttpd2dq512_mask ((__v8df) __A,
3876 (__v8si) __W,
3877 (__mmask8) __U,
3879}
3880
3881static __inline__ __m256i __DEFAULT_FN_ATTRS512
3883{
3884 return (__m256i) __builtin_ia32_cvttpd2dq512_mask ((__v8df) __A,
3885 (__v8si) _mm256_setzero_si256 (),
3886 (__mmask8) __U,
3888}
3889
3890#define _mm512_cvtt_roundps_epi32(A, R) \
3891 ((__m512i)__builtin_ia32_cvttps2dq512_mask((__v16sf)(__m512)(A), \
3892 (__v16si)_mm512_setzero_si512(), \
3893 (__mmask16)-1, (int)(R)))
3894
3895#define _mm512_mask_cvtt_roundps_epi32(W, U, A, R) \
3896 ((__m512i)__builtin_ia32_cvttps2dq512_mask((__v16sf)(__m512)(A), \
3897 (__v16si)(__m512i)(W), \
3898 (__mmask16)(U), (int)(R)))
3899
3900#define _mm512_maskz_cvtt_roundps_epi32(U, A, R) \
3901 ((__m512i)__builtin_ia32_cvttps2dq512_mask((__v16sf)(__m512)(A), \
3902 (__v16si)_mm512_setzero_si512(), \
3903 (__mmask16)(U), (int)(R)))
3904
3905static __inline __m512i __DEFAULT_FN_ATTRS512
3907{
3908 return (__m512i)
3909 __builtin_ia32_cvttps2dq512_mask((__v16sf) __a,
3910 (__v16si) _mm512_setzero_si512 (),
3912}
3913
3914static __inline__ __m512i __DEFAULT_FN_ATTRS512
3915_mm512_mask_cvttps_epi32 (__m512i __W, __mmask16 __U, __m512 __A)
3916{
3917 return (__m512i) __builtin_ia32_cvttps2dq512_mask ((__v16sf) __A,
3918 (__v16si) __W,
3919 (__mmask16) __U,
3921}
3922
3923static __inline__ __m512i __DEFAULT_FN_ATTRS512
3925{
3926 return (__m512i) __builtin_ia32_cvttps2dq512_mask ((__v16sf) __A,
3927 (__v16si) _mm512_setzero_si512 (),
3928 (__mmask16) __U,
3930}
3931
3932#define _mm512_cvt_roundps_epi32(A, R) \
3933 ((__m512i)__builtin_ia32_cvtps2dq512_mask((__v16sf)(__m512)(A), \
3934 (__v16si)_mm512_setzero_si512(), \
3935 (__mmask16)-1, (int)(R)))
3936
3937#define _mm512_mask_cvt_roundps_epi32(W, U, A, R) \
3938 ((__m512i)__builtin_ia32_cvtps2dq512_mask((__v16sf)(__m512)(A), \
3939 (__v16si)(__m512i)(W), \
3940 (__mmask16)(U), (int)(R)))
3941
3942#define _mm512_maskz_cvt_roundps_epi32(U, A, R) \
3943 ((__m512i)__builtin_ia32_cvtps2dq512_mask((__v16sf)(__m512)(A), \
3944 (__v16si)_mm512_setzero_si512(), \
3945 (__mmask16)(U), (int)(R)))
3946
3947static __inline__ __m512i __DEFAULT_FN_ATTRS512
3949{
3950 return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A,
3951 (__v16si) _mm512_undefined_epi32 (),
3952 (__mmask16) -1,
3954}
3955
3956static __inline__ __m512i __DEFAULT_FN_ATTRS512
3957_mm512_mask_cvtps_epi32 (__m512i __W, __mmask16 __U, __m512 __A)
3958{
3959 return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A,
3960 (__v16si) __W,
3961 (__mmask16) __U,
3963}
3964
3965static __inline__ __m512i __DEFAULT_FN_ATTRS512
3967{
3968 return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A,
3969 (__v16si)
3971 (__mmask16) __U,
3973}
3974
3975#define _mm512_cvt_roundpd_epi32(A, R) \
3976 ((__m256i)__builtin_ia32_cvtpd2dq512_mask((__v8df)(__m512d)(A), \
3977 (__v8si)_mm256_setzero_si256(), \
3978 (__mmask8)-1, (int)(R)))
3979
3980#define _mm512_mask_cvt_roundpd_epi32(W, U, A, R) \
3981 ((__m256i)__builtin_ia32_cvtpd2dq512_mask((__v8df)(__m512d)(A), \
3982 (__v8si)(__m256i)(W), \
3983 (__mmask8)(U), (int)(R)))
3984
3985#define _mm512_maskz_cvt_roundpd_epi32(U, A, R) \
3986 ((__m256i)__builtin_ia32_cvtpd2dq512_mask((__v8df)(__m512d)(A), \
3987 (__v8si)_mm256_setzero_si256(), \
3988 (__mmask8)(U), (int)(R)))
3989
3990static __inline__ __m256i __DEFAULT_FN_ATTRS512
3992{
3993 return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A,
3994 (__v8si)
3996 (__mmask8) -1,
3998}
3999
4000static __inline__ __m256i __DEFAULT_FN_ATTRS512
4001_mm512_mask_cvtpd_epi32 (__m256i __W, __mmask8 __U, __m512d __A)
4002{
4003 return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A,
4004 (__v8si) __W,
4005 (__mmask8) __U,
4007}
4008
4009static __inline__ __m256i __DEFAULT_FN_ATTRS512
4011{
4012 return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A,
4013 (__v8si)
4015 (__mmask8) __U,
4017}
4018
4019#define _mm512_cvt_roundps_epu32(A, R) \
4020 ((__m512i)__builtin_ia32_cvtps2udq512_mask((__v16sf)(__m512)(A), \
4021 (__v16si)_mm512_setzero_si512(), \
4022 (__mmask16)-1, (int)(R)))
4023
4024#define _mm512_mask_cvt_roundps_epu32(W, U, A, R) \
4025 ((__m512i)__builtin_ia32_cvtps2udq512_mask((__v16sf)(__m512)(A), \
4026 (__v16si)(__m512i)(W), \
4027 (__mmask16)(U), (int)(R)))
4028
4029#define _mm512_maskz_cvt_roundps_epu32(U, A, R) \
4030 ((__m512i)__builtin_ia32_cvtps2udq512_mask((__v16sf)(__m512)(A), \
4031 (__v16si)_mm512_setzero_si512(), \
4032 (__mmask16)(U), (int)(R)))
4033
4034static __inline__ __m512i __DEFAULT_FN_ATTRS512
4036{
4037 return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A,\
4038 (__v16si)\
4040 (__mmask16) -1,\
4042}
4043
4044static __inline__ __m512i __DEFAULT_FN_ATTRS512
4045_mm512_mask_cvtps_epu32 (__m512i __W, __mmask16 __U, __m512 __A)
4046{
4047 return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A,
4048 (__v16si) __W,
4049 (__mmask16) __U,
4051}
4052
4053static __inline__ __m512i __DEFAULT_FN_ATTRS512
4055{
4056 return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A,
4057 (__v16si)
4059 (__mmask16) __U ,
4061}
4062
4063#define _mm512_cvt_roundpd_epu32(A, R) \
4064 ((__m256i)__builtin_ia32_cvtpd2udq512_mask((__v8df)(__m512d)(A), \
4065 (__v8si)_mm256_setzero_si256(), \
4066 (__mmask8)-1, (int)(R)))
4067
4068#define _mm512_mask_cvt_roundpd_epu32(W, U, A, R) \
4069 ((__m256i)__builtin_ia32_cvtpd2udq512_mask((__v8df)(__m512d)(A), \
4070 (__v8si)(__m256i)(W), \
4071 (__mmask8)(U), (int)(R)))
4072
4073#define _mm512_maskz_cvt_roundpd_epu32(U, A, R) \
4074 ((__m256i)__builtin_ia32_cvtpd2udq512_mask((__v8df)(__m512d)(A), \
4075 (__v8si)_mm256_setzero_si256(), \
4076 (__mmask8)(U), (int)(R)))
4077
4078static __inline__ __m256i __DEFAULT_FN_ATTRS512
4080{
4081 return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A,
4082 (__v8si)
4084 (__mmask8) -1,
4086}
4087
4088static __inline__ __m256i __DEFAULT_FN_ATTRS512
4089_mm512_mask_cvtpd_epu32 (__m256i __W, __mmask8 __U, __m512d __A)
4090{
4091 return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A,
4092 (__v8si) __W,
4093 (__mmask8) __U,
4095}
4096
4097static __inline__ __m256i __DEFAULT_FN_ATTRS512
4099{
4100 return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A,
4101 (__v8si)
4103 (__mmask8) __U,
4105}
4106
4107static __inline__ double __DEFAULT_FN_ATTRS512
4109{
4110 return __a[0];
4111}
4112
4113static __inline__ float __DEFAULT_FN_ATTRS512
4115{
4116 return __a[0];
4117}
4118
4119/* Unpack and Interleave */
4120
4121static __inline __m512d __DEFAULT_FN_ATTRS512
4122_mm512_unpackhi_pd(__m512d __a, __m512d __b)
4123{
4124 return (__m512d)__builtin_shufflevector((__v8df)__a, (__v8df)__b,
4125 1, 9, 1+2, 9+2, 1+4, 9+4, 1+6, 9+6);
4126}
4127
4128static __inline__ __m512d __DEFAULT_FN_ATTRS512
4129_mm512_mask_unpackhi_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B)
4130{
4131 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
4132 (__v8df)_mm512_unpackhi_pd(__A, __B),
4133 (__v8df)__W);
4134}
4135
4136static __inline__ __m512d __DEFAULT_FN_ATTRS512
4137_mm512_maskz_unpackhi_pd(__mmask8 __U, __m512d __A, __m512d __B)
4138{
4139 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
4140 (__v8df)_mm512_unpackhi_pd(__A, __B),
4141 (__v8df)_mm512_setzero_pd());
4142}
4143
4144static __inline __m512d __DEFAULT_FN_ATTRS512
4145_mm512_unpacklo_pd(__m512d __a, __m512d __b)
4146{
4147 return (__m512d)__builtin_shufflevector((__v8df)__a, (__v8df)__b,
4148 0, 8, 0+2, 8+2, 0+4, 8+4, 0+6, 8+6);
4149}
4150
4151static __inline__ __m512d __DEFAULT_FN_ATTRS512
4152_mm512_mask_unpacklo_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B)
4153{
4154 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
4155 (__v8df)_mm512_unpacklo_pd(__A, __B),
4156 (__v8df)__W);
4157}
4158
4159static __inline__ __m512d __DEFAULT_FN_ATTRS512
4160_mm512_maskz_unpacklo_pd (__mmask8 __U, __m512d __A, __m512d __B)
4161{
4162 return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U,
4163 (__v8df)_mm512_unpacklo_pd(__A, __B),
4164 (__v8df)_mm512_setzero_pd());
4165}
4166
4167static __inline __m512 __DEFAULT_FN_ATTRS512
4169{
4170 return (__m512)__builtin_shufflevector((__v16sf)__a, (__v16sf)__b,
4171 2, 18, 3, 19,
4172 2+4, 18+4, 3+4, 19+4,
4173 2+8, 18+8, 3+8, 19+8,
4174 2+12, 18+12, 3+12, 19+12);
4175}
4176
4177static __inline__ __m512 __DEFAULT_FN_ATTRS512
4178_mm512_mask_unpackhi_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B)
4179{
4180 return (__m512)__builtin_ia32_selectps_512((__mmask16) __U,
4181 (__v16sf)_mm512_unpackhi_ps(__A, __B),
4182 (__v16sf)__W);
4183}
4184
4185static __inline__ __m512 __DEFAULT_FN_ATTRS512
4186_mm512_maskz_unpackhi_ps (__mmask16 __U, __m512 __A, __m512 __B)
4187{
4188 return (__m512)__builtin_ia32_selectps_512((__mmask16) __U,
4189 (__v16sf)_mm512_unpackhi_ps(__A, __B),
4190 (__v16sf)_mm512_setzero_ps());
4191}
4192
4193static __inline __m512 __DEFAULT_FN_ATTRS512
4195{
4196 return (__m512)__builtin_shufflevector((__v16sf)__a, (__v16sf)__b,
4197 0, 16, 1, 17,
4198 0+4, 16+4, 1+4, 17+4,
4199 0+8, 16+8, 1+8, 17+8,
4200 0+12, 16+12, 1+12, 17+12);
4201}
4202
4203static __inline__ __m512 __DEFAULT_FN_ATTRS512
4204_mm512_mask_unpacklo_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B)
4205{
4206 return (__m512)__builtin_ia32_selectps_512((__mmask16) __U,
4207 (__v16sf)_mm512_unpacklo_ps(__A, __B),
4208 (__v16sf)__W);
4209}
4210
4211static __inline__ __m512 __DEFAULT_FN_ATTRS512
4212_mm512_maskz_unpacklo_ps (__mmask16 __U, __m512 __A, __m512 __B)
4213{
4214 return (__m512)__builtin_ia32_selectps_512((__mmask16) __U,
4215 (__v16sf)_mm512_unpacklo_ps(__A, __B),
4216 (__v16sf)_mm512_setzero_ps());
4217}
4218
4219static __inline__ __m512i __DEFAULT_FN_ATTRS512
4220_mm512_unpackhi_epi32(__m512i __A, __m512i __B)
4221{
4222 return (__m512i)__builtin_shufflevector((__v16si)__A, (__v16si)__B,
4223 2, 18, 3, 19,
4224 2+4, 18+4, 3+4, 19+4,
4225 2+8, 18+8, 3+8, 19+8,
4226 2+12, 18+12, 3+12, 19+12);
4227}
4228
4229static __inline__ __m512i __DEFAULT_FN_ATTRS512
4230_mm512_mask_unpackhi_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
4231{
4232 return (__m512i)__builtin_ia32_selectd_512((__mmask16) __U,
4233 (__v16si)_mm512_unpackhi_epi32(__A, __B),
4234 (__v16si)__W);
4235}
4236
4237static __inline__ __m512i __DEFAULT_FN_ATTRS512
4238_mm512_maskz_unpackhi_epi32(__mmask16 __U, __m512i __A, __m512i __B)
4239{
4240 return (__m512i)__builtin_ia32_selectd_512((__mmask16) __U,
4241 (__v16si)_mm512_unpackhi_epi32(__A, __B),
4242 (__v16si)_mm512_setzero_si512());
4243}
4244
4245static __inline__ __m512i __DEFAULT_FN_ATTRS512
4246_mm512_unpacklo_epi32(__m512i __A, __m512i __B)
4247{
4248 return (__m512i)__builtin_shufflevector((__v16si)__A, (__v16si)__B,
4249 0, 16, 1, 17,
4250 0+4, 16+4, 1+4, 17+4,
4251 0+8, 16+8, 1+8, 17+8,
4252 0+12, 16+12, 1+12, 17+12);
4253}
4254
4255static __inline__ __m512i __DEFAULT_FN_ATTRS512
4256_mm512_mask_unpacklo_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
4257{
4258 return (__m512i)__builtin_ia32_selectd_512((__mmask16) __U,
4259 (__v16si)_mm512_unpacklo_epi32(__A, __B),
4260 (__v16si)__W);
4261}
4262
4263static __inline__ __m512i __DEFAULT_FN_ATTRS512
4264_mm512_maskz_unpacklo_epi32(__mmask16 __U, __m512i __A, __m512i __B)
4265{
4266 return (__m512i)__builtin_ia32_selectd_512((__mmask16) __U,
4267 (__v16si)_mm512_unpacklo_epi32(__A, __B),
4268 (__v16si)_mm512_setzero_si512());
4269}
4270
4271static __inline__ __m512i __DEFAULT_FN_ATTRS512
4272_mm512_unpackhi_epi64(__m512i __A, __m512i __B)
4273{
4274 return (__m512i)__builtin_shufflevector((__v8di)__A, (__v8di)__B,
4275 1, 9, 1+2, 9+2, 1+4, 9+4, 1+6, 9+6);
4276}
4277
4278static __inline__ __m512i __DEFAULT_FN_ATTRS512
4279_mm512_mask_unpackhi_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
4280{
4281 return (__m512i)__builtin_ia32_selectq_512((__mmask8) __U,
4282 (__v8di)_mm512_unpackhi_epi64(__A, __B),
4283 (__v8di)__W);
4284}
4285
4286static __inline__ __m512i __DEFAULT_FN_ATTRS512
4287_mm512_maskz_unpackhi_epi64(__mmask8 __U, __m512i __A, __m512i __B)
4288{
4289 return (__m512i)__builtin_ia32_selectq_512((__mmask8) __U,
4290 (__v8di)_mm512_unpackhi_epi64(__A, __B),
4291 (__v8di)_mm512_setzero_si512());
4292}
4293
4294static __inline__ __m512i __DEFAULT_FN_ATTRS512
4295_mm512_unpacklo_epi64 (__m512i __A, __m512i __B)
4296{
4297 return (__m512i)__builtin_shufflevector((__v8di)__A, (__v8di)__B,
4298 0, 8, 0+2, 8+2, 0+4, 8+4, 0+6, 8+6);
4299}
4300
4301static __inline__ __m512i __DEFAULT_FN_ATTRS512
4302_mm512_mask_unpacklo_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
4303{
4304 return (__m512i)__builtin_ia32_selectq_512((__mmask8) __U,
4305 (__v8di)_mm512_unpacklo_epi64(__A, __B),
4306 (__v8di)__W);
4307}
4308
4309static __inline__ __m512i __DEFAULT_FN_ATTRS512
4310_mm512_maskz_unpacklo_epi64 (__mmask8 __U, __m512i __A, __m512i __B)
4311{
4312 return (__m512i)__builtin_ia32_selectq_512((__mmask8) __U,
4313 (__v8di)_mm512_unpacklo_epi64(__A, __B),
4314 (__v8di)_mm512_setzero_si512());
4315}
4316
4317
4318/* SIMD load ops */
4319
4320static __inline __m512i __DEFAULT_FN_ATTRS512
4322{
4323 struct __loadu_si512 {
4324 __m512i_u __v;
4325 } __attribute__((__packed__, __may_alias__));
4326 return ((const struct __loadu_si512*)__P)->__v;
4327}
4328
4329static __inline __m512i __DEFAULT_FN_ATTRS512
4331{
4332 struct __loadu_epi32 {
4333 __m512i_u __v;
4334 } __attribute__((__packed__, __may_alias__));
4335 return ((const struct __loadu_epi32*)__P)->__v;
4336}
4337
4338static __inline __m512i __DEFAULT_FN_ATTRS512
4339_mm512_mask_loadu_epi32 (__m512i __W, __mmask16 __U, void const *__P)
4340{
4341 return (__m512i) __builtin_ia32_loaddqusi512_mask ((const int *) __P,
4342 (__v16si) __W,
4343 (__mmask16) __U);
4344}
4345
4346
4347static __inline __m512i __DEFAULT_FN_ATTRS512
4349{
4350 return (__m512i) __builtin_ia32_loaddqusi512_mask ((const int *)__P,
4351 (__v16si)
4353 (__mmask16) __U);
4354}
4355
4356static __inline __m512i __DEFAULT_FN_ATTRS512
4358{
4359 struct __loadu_epi64 {
4360 __m512i_u __v;
4361 } __attribute__((__packed__, __may_alias__));
4362 return ((const struct __loadu_epi64*)__P)->__v;
4363}
4364
4365static __inline __m512i __DEFAULT_FN_ATTRS512
4366_mm512_mask_loadu_epi64 (__m512i __W, __mmask8 __U, void const *__P)
4367{
4368 return (__m512i) __builtin_ia32_loaddqudi512_mask ((const long long *) __P,
4369 (__v8di) __W,
4370 (__mmask8) __U);
4371}
4372
4373static __inline __m512i __DEFAULT_FN_ATTRS512
4375{
4376 return (__m512i) __builtin_ia32_loaddqudi512_mask ((const long long *)__P,
4377 (__v8di)
4379 (__mmask8) __U);
4380}
4381
4382static __inline __m512 __DEFAULT_FN_ATTRS512
4383_mm512_mask_loadu_ps (__m512 __W, __mmask16 __U, void const *__P)
4384{
4385 return (__m512) __builtin_ia32_loadups512_mask ((const float *) __P,
4386 (__v16sf) __W,
4387 (__mmask16) __U);
4388}
4389
4390static __inline __m512 __DEFAULT_FN_ATTRS512
4392{
4393 return (__m512) __builtin_ia32_loadups512_mask ((const float *)__P,
4394 (__v16sf)
4396 (__mmask16) __U);
4397}
4398
4399static __inline __m512d __DEFAULT_FN_ATTRS512
4400_mm512_mask_loadu_pd (__m512d __W, __mmask8 __U, void const *__P)
4401{
4402 return (__m512d) __builtin_ia32_loadupd512_mask ((const double *) __P,
4403 (__v8df) __W,
4404 (__mmask8) __U);
4405}
4406
4407static __inline __m512d __DEFAULT_FN_ATTRS512
4409{
4410 return (__m512d) __builtin_ia32_loadupd512_mask ((const double *)__P,
4411 (__v8df)
4413 (__mmask8) __U);
4414}
4415
4416static __inline __m512d __DEFAULT_FN_ATTRS512
4418{
4419 struct __loadu_pd {
4420 __m512d_u __v;
4421 } __attribute__((__packed__, __may_alias__));
4422 return ((const struct __loadu_pd*)__p)->__v;
4423}
4424
4425static __inline __m512 __DEFAULT_FN_ATTRS512
4427{
4428 struct __loadu_ps {
4429 __m512_u __v;
4430 } __attribute__((__packed__, __may_alias__));
4431 return ((const struct __loadu_ps*)__p)->__v;
4432}
4433
4434static __inline __m512 __DEFAULT_FN_ATTRS512
4436{
4437 return *(const __m512*)__p;
4438}
4439
4440static __inline __m512 __DEFAULT_FN_ATTRS512
4441_mm512_mask_load_ps (__m512 __W, __mmask16 __U, void const *__P)
4442{
4443 return (__m512) __builtin_ia32_loadaps512_mask ((const __v16sf *) __P,
4444 (__v16sf) __W,
4445 (__mmask16) __U);
4446}
4447
4448static __inline __m512 __DEFAULT_FN_ATTRS512
4450{
4451 return (__m512) __builtin_ia32_loadaps512_mask ((const __v16sf *)__P,
4452 (__v16sf)
4454 (__mmask16) __U);
4455}
4456
4457static __inline __m512d __DEFAULT_FN_ATTRS512
4459{
4460 return *(const __m512d*)__p;
4461}
4462
4463static __inline __m512d __DEFAULT_FN_ATTRS512
4464_mm512_mask_load_pd (__m512d __W, __mmask8 __U, void const *__P)
4465{
4466 return (__m512d) __builtin_ia32_loadapd512_mask ((const __v8df *) __P,
4467 (__v8df) __W,
4468 (__mmask8) __U);
4469}
4470
4471static __inline __m512d __DEFAULT_FN_ATTRS512
4473{
4474 return (__m512d) __builtin_ia32_loadapd512_mask ((const __v8df *)__P,
4475 (__v8df)
4477 (__mmask8) __U);
4478}
4479
4480static __inline __m512i __DEFAULT_FN_ATTRS512
4482{
4483 return *(const __m512i *) __P;
4484}
4485
4486static __inline __m512i __DEFAULT_FN_ATTRS512
4488{
4489 return *(const __m512i *) __P;
4490}
4491
4492static __inline __m512i __DEFAULT_FN_ATTRS512
4494{
4495 return *(const __m512i *) __P;
4496}
4497
4498/* SIMD store ops */
4499
4500static __inline void __DEFAULT_FN_ATTRS512
4501_mm512_storeu_epi64 (void *__P, __m512i __A)
4502{
4503 struct __storeu_epi64 {
4504 __m512i_u __v;
4505 } __attribute__((__packed__, __may_alias__));
4506 ((struct __storeu_epi64*)__P)->__v = __A;
4507}
4508
4509static __inline void __DEFAULT_FN_ATTRS512
4510_mm512_mask_storeu_epi64(void *__P, __mmask8 __U, __m512i __A)
4511{
4512 __builtin_ia32_storedqudi512_mask ((long long *)__P, (__v8di) __A,
4513 (__mmask8) __U);
4514}
4515
4516static __inline void __DEFAULT_FN_ATTRS512
4517_mm512_storeu_si512 (void *__P, __m512i __A)
4518{
4519 struct __storeu_si512 {
4520 __m512i_u __v;
4521 } __attribute__((__packed__, __may_alias__));
4522 ((struct __storeu_si512*)__P)->__v = __A;
4523}
4524
4525static __inline void __DEFAULT_FN_ATTRS512
4526_mm512_storeu_epi32 (void *__P, __m512i __A)
4527{
4528 struct __storeu_epi32 {
4529 __m512i_u __v;
4530 } __attribute__((__packed__, __may_alias__));
4531 ((struct __storeu_epi32*)__P)->__v = __A;
4532}
4533
4534static __inline void __DEFAULT_FN_ATTRS512
4536{
4537 __builtin_ia32_storedqusi512_mask ((int *)__P, (__v16si) __A,
4538 (__mmask16) __U);
4539}
4540
4541static __inline void __DEFAULT_FN_ATTRS512
4542_mm512_mask_storeu_pd(void *__P, __mmask8 __U, __m512d __A)
4543{
4544 __builtin_ia32_storeupd512_mask ((double *)__P, (__v8df) __A, (__mmask8) __U);
4545}
4546
4547static __inline void __DEFAULT_FN_ATTRS512
4548_mm512_storeu_pd(void *__P, __m512d __A)
4549{
4550 struct __storeu_pd {
4551 __m512d_u __v;
4552 } __attribute__((__packed__, __may_alias__));
4553 ((struct __storeu_pd*)__P)->__v = __A;
4554}
4555
4556static __inline void __DEFAULT_FN_ATTRS512
4557_mm512_mask_storeu_ps(void *__P, __mmask16 __U, __m512 __A)
4558{
4559 __builtin_ia32_storeups512_mask ((float *)__P, (__v16sf) __A,
4560 (__mmask16) __U);
4561}
4562
4563static __inline void __DEFAULT_FN_ATTRS512
4564_mm512_storeu_ps(void *__P, __m512 __A)
4565{
4566 struct __storeu_ps {
4567 __m512_u __v;
4568 } __attribute__((__packed__, __may_alias__));
4569 ((struct __storeu_ps*)__P)->__v = __A;
4570}
4571
4572static __inline void __DEFAULT_FN_ATTRS512
4573_mm512_mask_store_pd(void *__P, __mmask8 __U, __m512d __A)
4574{
4575 __builtin_ia32_storeapd512_mask ((__v8df *)__P, (__v8df) __A, (__mmask8) __U);
4576}
4577
4578static __inline void __DEFAULT_FN_ATTRS512
4579_mm512_store_pd(void *__P, __m512d __A)
4580{
4581 *(__m512d*)__P = __A;
4582}
4583
4584static __inline void __DEFAULT_FN_ATTRS512
4585_mm512_mask_store_ps(void *__P, __mmask16 __U, __m512 __A)
4586{
4587 __builtin_ia32_storeaps512_mask ((__v16sf *)__P, (__v16sf) __A,
4588 (__mmask16) __U);
4589}
4590
4591static __inline void __DEFAULT_FN_ATTRS512
4592_mm512_store_ps(void *__P, __m512 __A)
4593{
4594 *(__m512*)__P = __A;
4595}
4596
4597static __inline void __DEFAULT_FN_ATTRS512
4598_mm512_store_si512 (void *__P, __m512i __A)
4599{
4600 *(__m512i *) __P = __A;
4601}
4602
4603static __inline void __DEFAULT_FN_ATTRS512
4604_mm512_store_epi32 (void *__P, __m512i __A)
4605{
4606 *(__m512i *) __P = __A;
4607}
4608
4609static __inline void __DEFAULT_FN_ATTRS512
4610_mm512_store_epi64 (void *__P, __m512i __A)
4611{
4612 *(__m512i *) __P = __A;
4613}
4614
4615/* Mask ops */
4616
4617static __inline __mmask16 __DEFAULT_FN_ATTRS
4619{
4620 return __builtin_ia32_knothi(__M);
4621}
4622
4623/* Integer compare */
4624
4625#define _mm512_cmpeq_epi32_mask(A, B) \
4626 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_EQ)
4627#define _mm512_mask_cmpeq_epi32_mask(k, A, B) \
4628 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_EQ)
4629#define _mm512_cmpge_epi32_mask(A, B) \
4630 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_GE)
4631#define _mm512_mask_cmpge_epi32_mask(k, A, B) \
4632 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_GE)
4633#define _mm512_cmpgt_epi32_mask(A, B) \
4634 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_GT)
4635#define _mm512_mask_cmpgt_epi32_mask(k, A, B) \
4636 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_GT)
4637#define _mm512_cmple_epi32_mask(A, B) \
4638 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_LE)
4639#define _mm512_mask_cmple_epi32_mask(k, A, B) \
4640 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_LE)
4641#define _mm512_cmplt_epi32_mask(A, B) \
4642 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_LT)
4643#define _mm512_mask_cmplt_epi32_mask(k, A, B) \
4644 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_LT)
4645#define _mm512_cmpneq_epi32_mask(A, B) \
4646 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_NE)
4647#define _mm512_mask_cmpneq_epi32_mask(k, A, B) \
4648 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_NE)
4649
4650#define _mm512_cmpeq_epu32_mask(A, B) \
4651 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_EQ)
4652#define _mm512_mask_cmpeq_epu32_mask(k, A, B) \
4653 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_EQ)
4654#define _mm512_cmpge_epu32_mask(A, B) \
4655 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_GE)
4656#define _mm512_mask_cmpge_epu32_mask(k, A, B) \
4657 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_GE)
4658#define _mm512_cmpgt_epu32_mask(A, B) \
4659 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_GT)
4660#define _mm512_mask_cmpgt_epu32_mask(k, A, B) \
4661 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_GT)
4662#define _mm512_cmple_epu32_mask(A, B) \
4663 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_LE)
4664#define _mm512_mask_cmple_epu32_mask(k, A, B) \
4665 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_LE)
4666#define _mm512_cmplt_epu32_mask(A, B) \
4667 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_LT)
4668#define _mm512_mask_cmplt_epu32_mask(k, A, B) \
4669 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_LT)
4670#define _mm512_cmpneq_epu32_mask(A, B) \
4671 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_NE)
4672#define _mm512_mask_cmpneq_epu32_mask(k, A, B) \
4673 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_NE)
4674
4675#define _mm512_cmpeq_epi64_mask(A, B) \
4676 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_EQ)
4677#define _mm512_mask_cmpeq_epi64_mask(k, A, B) \
4678 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_EQ)
4679#define _mm512_cmpge_epi64_mask(A, B) \
4680 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_GE)
4681#define _mm512_mask_cmpge_epi64_mask(k, A, B) \
4682 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_GE)
4683#define _mm512_cmpgt_epi64_mask(A, B) \
4684 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_GT)
4685#define _mm512_mask_cmpgt_epi64_mask(k, A, B) \
4686 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_GT)
4687#define _mm512_cmple_epi64_mask(A, B) \
4688 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_LE)
4689#define _mm512_mask_cmple_epi64_mask(k, A, B) \
4690 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_LE)
4691#define _mm512_cmplt_epi64_mask(A, B) \
4692 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_LT)
4693#define _mm512_mask_cmplt_epi64_mask(k, A, B) \
4694 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_LT)
4695#define _mm512_cmpneq_epi64_mask(A, B) \
4696 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_NE)
4697#define _mm512_mask_cmpneq_epi64_mask(k, A, B) \
4698 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_NE)
4699
4700#define _mm512_cmpeq_epu64_mask(A, B) \
4701 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_EQ)
4702#define _mm512_mask_cmpeq_epu64_mask(k, A, B) \
4703 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_EQ)
4704#define _mm512_cmpge_epu64_mask(A, B) \
4705 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_GE)
4706#define _mm512_mask_cmpge_epu64_mask(k, A, B) \
4707 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_GE)
4708#define _mm512_cmpgt_epu64_mask(A, B) \
4709 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_GT)
4710#define _mm512_mask_cmpgt_epu64_mask(k, A, B) \
4711 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_GT)
4712#define _mm512_cmple_epu64_mask(A, B) \
4713 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_LE)
4714#define _mm512_mask_cmple_epu64_mask(k, A, B) \
4715 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_LE)
4716#define _mm512_cmplt_epu64_mask(A, B) \
4717 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_LT)
4718#define _mm512_mask_cmplt_epu64_mask(k, A, B) \
4719 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_LT)
4720#define _mm512_cmpneq_epu64_mask(A, B) \
4721 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_NE)
4722#define _mm512_mask_cmpneq_epu64_mask(k, A, B) \
4723 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_NE)
4724
4725static __inline__ __m512i __DEFAULT_FN_ATTRS512
4727{
4728 /* This function always performs a signed extension, but __v16qi is a char
4729 which may be signed or unsigned, so use __v16qs. */
4730 return (__m512i)__builtin_convertvector((__v16qs)__A, __v16si);
4731}
4732
4733static __inline__ __m512i __DEFAULT_FN_ATTRS512
4734_mm512_mask_cvtepi8_epi32(__m512i __W, __mmask16 __U, __m128i __A)
4735{
4736 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4737 (__v16si)_mm512_cvtepi8_epi32(__A),
4738 (__v16si)__W);
4739}
4740
4741static __inline__ __m512i __DEFAULT_FN_ATTRS512
4743{
4744 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4745 (__v16si)_mm512_cvtepi8_epi32(__A),
4746 (__v16si)_mm512_setzero_si512());
4747}
4748
4749static __inline__ __m512i __DEFAULT_FN_ATTRS512
4751{
4752 /* This function always performs a signed extension, but __v16qi is a char
4753 which may be signed or unsigned, so use __v16qs. */
4754 return (__m512i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__A, (__v16qs)__A, 0, 1, 2, 3, 4, 5, 6, 7), __v8di);
4755}
4756
4757static __inline__ __m512i __DEFAULT_FN_ATTRS512
4758_mm512_mask_cvtepi8_epi64(__m512i __W, __mmask8 __U, __m128i __A)
4759{
4760 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4761 (__v8di)_mm512_cvtepi8_epi64(__A),
4762 (__v8di)__W);
4763}
4764
4765static __inline__ __m512i __DEFAULT_FN_ATTRS512
4767{
4768 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4769 (__v8di)_mm512_cvtepi8_epi64(__A),
4770 (__v8di)_mm512_setzero_si512 ());
4771}
4772
4773static __inline__ __m512i __DEFAULT_FN_ATTRS512
4775{
4776 return (__m512i)__builtin_convertvector((__v8si)__X, __v8di);
4777}
4778
4779static __inline__ __m512i __DEFAULT_FN_ATTRS512
4780_mm512_mask_cvtepi32_epi64(__m512i __W, __mmask8 __U, __m256i __X)
4781{
4782 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4783 (__v8di)_mm512_cvtepi32_epi64(__X),
4784 (__v8di)__W);
4785}
4786
4787static __inline__ __m512i __DEFAULT_FN_ATTRS512
4789{
4790 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4791 (__v8di)_mm512_cvtepi32_epi64(__X),
4792 (__v8di)_mm512_setzero_si512());
4793}
4794
4795static __inline__ __m512i __DEFAULT_FN_ATTRS512
4797{
4798 return (__m512i)__builtin_convertvector((__v16hi)__A, __v16si);
4799}
4800
4801static __inline__ __m512i __DEFAULT_FN_ATTRS512
4802_mm512_mask_cvtepi16_epi32(__m512i __W, __mmask16 __U, __m256i __A)
4803{
4804 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4805 (__v16si)_mm512_cvtepi16_epi32(__A),
4806 (__v16si)__W);
4807}
4808
4809static __inline__ __m512i __DEFAULT_FN_ATTRS512
4811{
4812 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4813 (__v16si)_mm512_cvtepi16_epi32(__A),
4814 (__v16si)_mm512_setzero_si512 ());
4815}
4816
4817static __inline__ __m512i __DEFAULT_FN_ATTRS512
4819{
4820 return (__m512i)__builtin_convertvector((__v8hi)__A, __v8di);
4821}
4822
4823static __inline__ __m512i __DEFAULT_FN_ATTRS512
4824_mm512_mask_cvtepi16_epi64(__m512i __W, __mmask8 __U, __m128i __A)
4825{
4826 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4827 (__v8di)_mm512_cvtepi16_epi64(__A),
4828 (__v8di)__W);
4829}
4830
4831static __inline__ __m512i __DEFAULT_FN_ATTRS512
4833{
4834 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4835 (__v8di)_mm512_cvtepi16_epi64(__A),
4836 (__v8di)_mm512_setzero_si512());
4837}
4838
4839static __inline__ __m512i __DEFAULT_FN_ATTRS512
4841{
4842 return (__m512i)__builtin_convertvector((__v16qu)__A, __v16si);
4843}
4844
4845static __inline__ __m512i __DEFAULT_FN_ATTRS512
4846_mm512_mask_cvtepu8_epi32(__m512i __W, __mmask16 __U, __m128i __A)
4847{
4848 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4849 (__v16si)_mm512_cvtepu8_epi32(__A),
4850 (__v16si)__W);
4851}
4852
4853static __inline__ __m512i __DEFAULT_FN_ATTRS512
4855{
4856 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4857 (__v16si)_mm512_cvtepu8_epi32(__A),
4858 (__v16si)_mm512_setzero_si512());
4859}
4860
4861static __inline__ __m512i __DEFAULT_FN_ATTRS512
4863{
4864 return (__m512i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__A, (__v16qu)__A, 0, 1, 2, 3, 4, 5, 6, 7), __v8di);
4865}
4866
4867static __inline__ __m512i __DEFAULT_FN_ATTRS512
4868_mm512_mask_cvtepu8_epi64(__m512i __W, __mmask8 __U, __m128i __A)
4869{
4870 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4871 (__v8di)_mm512_cvtepu8_epi64(__A),
4872 (__v8di)__W);
4873}
4874
4875static __inline__ __m512i __DEFAULT_FN_ATTRS512
4877{
4878 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4879 (__v8di)_mm512_cvtepu8_epi64(__A),
4880 (__v8di)_mm512_setzero_si512());
4881}
4882
4883static __inline__ __m512i __DEFAULT_FN_ATTRS512
4885{
4886 return (__m512i)__builtin_convertvector((__v8su)__X, __v8di);
4887}
4888
4889static __inline__ __m512i __DEFAULT_FN_ATTRS512
4890_mm512_mask_cvtepu32_epi64(__m512i __W, __mmask8 __U, __m256i __X)
4891{
4892 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4893 (__v8di)_mm512_cvtepu32_epi64(__X),
4894 (__v8di)__W);
4895}
4896
4897static __inline__ __m512i __DEFAULT_FN_ATTRS512
4899{
4900 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4901 (__v8di)_mm512_cvtepu32_epi64(__X),
4902 (__v8di)_mm512_setzero_si512());
4903}
4904
4905static __inline__ __m512i __DEFAULT_FN_ATTRS512
4907{
4908 return (__m512i)__builtin_convertvector((__v16hu)__A, __v16si);
4909}
4910
4911static __inline__ __m512i __DEFAULT_FN_ATTRS512
4912_mm512_mask_cvtepu16_epi32(__m512i __W, __mmask16 __U, __m256i __A)
4913{
4914 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4915 (__v16si)_mm512_cvtepu16_epi32(__A),
4916 (__v16si)__W);
4917}
4918
4919static __inline__ __m512i __DEFAULT_FN_ATTRS512
4921{
4922 return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
4923 (__v16si)_mm512_cvtepu16_epi32(__A),
4924 (__v16si)_mm512_setzero_si512());
4925}
4926
4927static __inline__ __m512i __DEFAULT_FN_ATTRS512
4929{
4930 return (__m512i)__builtin_convertvector((__v8hu)__A, __v8di);
4931}
4932
4933static __inline__ __m512i __DEFAULT_FN_ATTRS512
4934_mm512_mask_cvtepu16_epi64(__m512i __W, __mmask8 __U, __m128i __A)
4935{
4936 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4937 (__v8di)_mm512_cvtepu16_epi64(__A),
4938 (__v8di)__W);
4939}
4940
4941static __inline__ __m512i __DEFAULT_FN_ATTRS512
4943{
4944 return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
4945 (__v8di)_mm512_cvtepu16_epi64(__A),
4946 (__v8di)_mm512_setzero_si512());
4947}
4948
4949static __inline__ __m512i __DEFAULT_FN_ATTRS512
4950_mm512_rorv_epi32 (__m512i __A, __m512i __B)
4951{
4952 return (__m512i)__builtin_ia32_prorvd512((__v16si)__A, (__v16si)__B);
4953}
4954
4955static __inline__ __m512i __DEFAULT_FN_ATTRS512
4956_mm512_mask_rorv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
4957{
4958 return (__m512i)__builtin_ia32_selectd_512(__U,
4959 (__v16si)_mm512_rorv_epi32(__A, __B),
4960 (__v16si)__W);
4961}
4962
4963static __inline__ __m512i __DEFAULT_FN_ATTRS512
4964_mm512_maskz_rorv_epi32 (__mmask16 __U, __m512i __A, __m512i __B)
4965{
4966 return (__m512i)__builtin_ia32_selectd_512(__U,
4967 (__v16si)_mm512_rorv_epi32(__A, __B),
4968 (__v16si)_mm512_setzero_si512());
4969}
4970
4971static __inline__ __m512i __DEFAULT_FN_ATTRS512
4972_mm512_rorv_epi64 (__m512i __A, __m512i __B)
4973{
4974 return (__m512i)__builtin_ia32_prorvq512((__v8di)__A, (__v8di)__B);
4975}
4976
4977static __inline__ __m512i __DEFAULT_FN_ATTRS512
4978_mm512_mask_rorv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
4979{
4980 return (__m512i)__builtin_ia32_selectq_512(__U,
4981 (__v8di)_mm512_rorv_epi64(__A, __B),
4982 (__v8di)__W);
4983}
4984
4985static __inline__ __m512i __DEFAULT_FN_ATTRS512
4986_mm512_maskz_rorv_epi64 (__mmask8 __U, __m512i __A, __m512i __B)
4987{
4988 return (__m512i)__builtin_ia32_selectq_512(__U,
4989 (__v8di)_mm512_rorv_epi64(__A, __B),
4990 (__v8di)_mm512_setzero_si512());
4991}
4992
4993
4994
4995#define _mm512_cmp_epi32_mask(a, b, p) \
4996 ((__mmask16)__builtin_ia32_cmpd512_mask((__v16si)(__m512i)(a), \
4997 (__v16si)(__m512i)(b), (int)(p), \
4998 (__mmask16)-1))
4999
5000#define _mm512_cmp_epu32_mask(a, b, p) \
5001 ((__mmask16)__builtin_ia32_ucmpd512_mask((__v16si)(__m512i)(a), \
5002 (__v16si)(__m512i)(b), (int)(p), \
5003 (__mmask16)-1))
5004
5005#define _mm512_cmp_epi64_mask(a, b, p) \
5006 ((__mmask8)__builtin_ia32_cmpq512_mask((__v8di)(__m512i)(a), \
5007 (__v8di)(__m512i)(b), (int)(p), \
5008 (__mmask8)-1))
5009
5010#define _mm512_cmp_epu64_mask(a, b, p) \
5011 ((__mmask8)__builtin_ia32_ucmpq512_mask((__v8di)(__m512i)(a), \
5012 (__v8di)(__m512i)(b), (int)(p), \
5013 (__mmask8)-1))
5014
5015#define _mm512_mask_cmp_epi32_mask(m, a, b, p) \
5016 ((__mmask16)__builtin_ia32_cmpd512_mask((__v16si)(__m512i)(a), \
5017 (__v16si)(__m512i)(b), (int)(p), \
5018 (__mmask16)(m)))
5019
5020#define _mm512_mask_cmp_epu32_mask(m, a, b, p) \
5021 ((__mmask16)__builtin_ia32_ucmpd512_mask((__v16si)(__m512i)(a), \
5022 (__v16si)(__m512i)(b), (int)(p), \
5023 (__mmask16)(m)))
5024
5025#define _mm512_mask_cmp_epi64_mask(m, a, b, p) \
5026 ((__mmask8)__builtin_ia32_cmpq512_mask((__v8di)(__m512i)(a), \
5027 (__v8di)(__m512i)(b), (int)(p), \
5028 (__mmask8)(m)))
5029
5030#define _mm512_mask_cmp_epu64_mask(m, a, b, p) \
5031 ((__mmask8)__builtin_ia32_ucmpq512_mask((__v8di)(__m512i)(a), \
5032 (__v8di)(__m512i)(b), (int)(p), \
5033 (__mmask8)(m)))
5034
5035#define _mm512_rol_epi32(a, b) \
5036 ((__m512i)__builtin_ia32_prold512((__v16si)(__m512i)(a), (int)(b)))
5037
5038#define _mm512_mask_rol_epi32(W, U, a, b) \
5039 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
5040 (__v16si)_mm512_rol_epi32((a), (b)), \
5041 (__v16si)(__m512i)(W)))
5042
5043#define _mm512_maskz_rol_epi32(U, a, b) \
5044 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
5045 (__v16si)_mm512_rol_epi32((a), (b)), \
5046 (__v16si)_mm512_setzero_si512()))
5047
5048#define _mm512_rol_epi64(a, b) \
5049 ((__m512i)__builtin_ia32_prolq512((__v8di)(__m512i)(a), (int)(b)))
5050
5051#define _mm512_mask_rol_epi64(W, U, a, b) \
5052 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
5053 (__v8di)_mm512_rol_epi64((a), (b)), \
5054 (__v8di)(__m512i)(W)))
5055
5056#define _mm512_maskz_rol_epi64(U, a, b) \
5057 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
5058 (__v8di)_mm512_rol_epi64((a), (b)), \
5059 (__v8di)_mm512_setzero_si512()))
5060
5061static __inline__ __m512i __DEFAULT_FN_ATTRS512
5062_mm512_rolv_epi32 (__m512i __A, __m512i __B)
5063{
5064 return (__m512i)__builtin_ia32_prolvd512((__v16si)__A, (__v16si)__B);
5065}
5066
5067static __inline__ __m512i __DEFAULT_FN_ATTRS512
5068_mm512_mask_rolv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B)
5069{
5070 return (__m512i)__builtin_ia32_selectd_512(__U,
5071 (__v16si)_mm512_rolv_epi32(__A, __B),
5072 (__v16si)__W);
5073}
5074
5075static __inline__ __m512i __DEFAULT_FN_ATTRS512
5076_mm512_maskz_rolv_epi32 (__mmask16 __U, __m512i __A, __m512i __B)
5077{
5078 return (__m512i)__builtin_ia32_selectd_512(__U,
5079 (__v16si)_mm512_rolv_epi32(__A, __B),
5080 (__v16si)_mm512_setzero_si512());
5081}
5082
5083static __inline__ __m512i __DEFAULT_FN_ATTRS512
5084_mm512_rolv_epi64 (__m512i __A, __m512i __B)
5085{
5086 return (__m512i)__builtin_ia32_prolvq512((__v8di)__A, (__v8di)__B);
5087}
5088
5089static __inline__ __m512i __DEFAULT_FN_ATTRS512
5090_mm512_mask_rolv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B)
5091{
5092 return (__m512i)__builtin_ia32_selectq_512(__U,
5093 (__v8di)_mm512_rolv_epi64(__A, __B),
5094 (__v8di)__W);
5095}
5096
5097static __inline__ __m512i __DEFAULT_FN_ATTRS512