xref: /freebsd/contrib/llvm-project/clang/lib/Headers/avx512ifmaintrin.h (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
10b57cec5SDimitry Andric /*===------------- avx512ifmaintrin.h - IFMA intrinsics ------------------===
20b57cec5SDimitry Andric  *
30b57cec5SDimitry Andric  *
40b57cec5SDimitry Andric  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
50b57cec5SDimitry Andric  * See https://llvm.org/LICENSE.txt for license information.
60b57cec5SDimitry Andric  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
70b57cec5SDimitry Andric  *
80b57cec5SDimitry Andric  *===-----------------------------------------------------------------------===
90b57cec5SDimitry Andric  */
100b57cec5SDimitry Andric #ifndef __IMMINTRIN_H
110b57cec5SDimitry Andric #error "Never use <avx512ifmaintrin.h> directly; include <immintrin.h> instead."
120b57cec5SDimitry Andric #endif
130b57cec5SDimitry Andric 
140b57cec5SDimitry Andric #ifndef __IFMAINTRIN_H
150b57cec5SDimitry Andric #define __IFMAINTRIN_H
160b57cec5SDimitry Andric 
170b57cec5SDimitry Andric /* Define the default attributes for the functions in this file. */
18*5f757f3fSDimitry Andric #define __DEFAULT_FN_ATTRS                                                     \
19*5f757f3fSDimitry Andric   __attribute__((__always_inline__, __nodebug__,                               \
20*5f757f3fSDimitry Andric                  __target__("avx512ifma,evex512"), __min_vector_width__(512)))
210b57cec5SDimitry Andric 
220b57cec5SDimitry Andric static __inline__ __m512i __DEFAULT_FN_ATTRS
230b57cec5SDimitry Andric _mm512_madd52hi_epu64 (__m512i __X, __m512i __Y, __m512i __Z)
240b57cec5SDimitry Andric {
250b57cec5SDimitry Andric   return (__m512i)__builtin_ia32_vpmadd52huq512((__v8di) __X, (__v8di) __Y,
260b57cec5SDimitry Andric                                                 (__v8di) __Z);
270b57cec5SDimitry Andric }
280b57cec5SDimitry Andric 
290b57cec5SDimitry Andric static __inline__ __m512i __DEFAULT_FN_ATTRS
300b57cec5SDimitry Andric _mm512_mask_madd52hi_epu64 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y)
310b57cec5SDimitry Andric {
320b57cec5SDimitry Andric   return (__m512i)__builtin_ia32_selectq_512(__M,
330b57cec5SDimitry Andric                                    (__v8di)_mm512_madd52hi_epu64(__W, __X, __Y),
340b57cec5SDimitry Andric                                    (__v8di)__W);
350b57cec5SDimitry Andric }
360b57cec5SDimitry Andric 
370b57cec5SDimitry Andric static __inline__ __m512i __DEFAULT_FN_ATTRS
380b57cec5SDimitry Andric _mm512_maskz_madd52hi_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z)
390b57cec5SDimitry Andric {
400b57cec5SDimitry Andric   return (__m512i)__builtin_ia32_selectq_512(__M,
410b57cec5SDimitry Andric                                    (__v8di)_mm512_madd52hi_epu64(__X, __Y, __Z),
420b57cec5SDimitry Andric                                    (__v8di)_mm512_setzero_si512());
430b57cec5SDimitry Andric }
440b57cec5SDimitry Andric 
450b57cec5SDimitry Andric static __inline__ __m512i __DEFAULT_FN_ATTRS
460b57cec5SDimitry Andric _mm512_madd52lo_epu64 (__m512i __X, __m512i __Y, __m512i __Z)
470b57cec5SDimitry Andric {
480b57cec5SDimitry Andric   return (__m512i)__builtin_ia32_vpmadd52luq512((__v8di) __X, (__v8di) __Y,
490b57cec5SDimitry Andric                                                 (__v8di) __Z);
500b57cec5SDimitry Andric }
510b57cec5SDimitry Andric 
520b57cec5SDimitry Andric static __inline__ __m512i __DEFAULT_FN_ATTRS
530b57cec5SDimitry Andric _mm512_mask_madd52lo_epu64 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y)
540b57cec5SDimitry Andric {
550b57cec5SDimitry Andric   return (__m512i)__builtin_ia32_selectq_512(__M,
560b57cec5SDimitry Andric                                    (__v8di)_mm512_madd52lo_epu64(__W, __X, __Y),
570b57cec5SDimitry Andric                                    (__v8di)__W);
580b57cec5SDimitry Andric }
590b57cec5SDimitry Andric 
600b57cec5SDimitry Andric static __inline__ __m512i __DEFAULT_FN_ATTRS
610b57cec5SDimitry Andric _mm512_maskz_madd52lo_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z)
620b57cec5SDimitry Andric {
630b57cec5SDimitry Andric   return (__m512i)__builtin_ia32_selectq_512(__M,
640b57cec5SDimitry Andric                                    (__v8di)_mm512_madd52lo_epu64(__X, __Y, __Z),
650b57cec5SDimitry Andric                                    (__v8di)_mm512_setzero_si512());
660b57cec5SDimitry Andric }
670b57cec5SDimitry Andric 
680b57cec5SDimitry Andric #undef __DEFAULT_FN_ATTRS
690b57cec5SDimitry Andric 
700b57cec5SDimitry Andric #endif
71