1 1.7 mrg /* Copyright (C) 2013-2022 Free Software Foundation, Inc. 2 1.1 mrg 3 1.1 mrg This file is part of GCC. 4 1.1 mrg 5 1.1 mrg GCC is free software; you can redistribute it and/or modify 6 1.1 mrg it under the terms of the GNU General Public License as published by 7 1.1 mrg the Free Software Foundation; either version 3, or (at your option) 8 1.1 mrg any later version. 9 1.1 mrg 10 1.1 mrg GCC is distributed in the hope that it will be useful, 11 1.1 mrg but WITHOUT ANY WARRANTY; without even the implied warranty of 12 1.1 mrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 1.1 mrg GNU General Public License for more details. 14 1.1 mrg 15 1.1 mrg Under Section 7 of GPL version 3, you are granted additional 16 1.1 mrg permissions described in the GCC Runtime Library Exception, version 17 1.1 mrg 3.1, as published by the Free Software Foundation. 18 1.1 mrg 19 1.1 mrg You should have received a copy of the GNU General Public License and 20 1.1 mrg a copy of the GCC Runtime Library Exception along with this program; 21 1.1 mrg see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 22 1.1 mrg <http://www.gnu.org/licenses/>. */ 23 1.1 mrg 24 1.1 mrg #ifndef _IMMINTRIN_H_INCLUDED 25 1.1 mrg #error "Never use <avx512ifmaintrin.h> directly; include <immintrin.h> instead." 26 1.1 mrg #endif 27 1.1 mrg 28 1.1 mrg #ifndef _AVX512IFMAINTRIN_H_INCLUDED 29 1.1 mrg #define _AVX512IFMAINTRIN_H_INCLUDED 30 1.1 mrg 31 1.1 mrg #ifndef __AVX512IFMA__ 32 1.1 mrg #pragma GCC push_options 33 1.1 mrg #pragma GCC target("avx512ifma") 34 1.1 mrg #define __DISABLE_AVX512IFMA__ 35 1.1 mrg #endif /* __AVX512IFMA__ */ 36 1.1 mrg 37 1.1 mrg extern __inline __m512i 38 1.1 mrg __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) 39 1.1 mrg _mm512_madd52lo_epu64 (__m512i __X, __m512i __Y, __m512i __Z) 40 1.1 mrg { 41 1.1 mrg return (__m512i) __builtin_ia32_vpmadd52luq512_mask ((__v8di) __X, 42 1.1 mrg (__v8di) __Y, 43 1.1 mrg (__v8di) __Z, 44 1.3 mrg (__mmask8) -1); 45 1.1 mrg } 46 1.1 mrg 47 1.1 mrg extern __inline __m512i 48 1.1 mrg __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) 49 1.1 mrg _mm512_madd52hi_epu64 (__m512i __X, __m512i __Y, __m512i __Z) 50 1.1 mrg { 51 1.1 mrg return (__m512i) __builtin_ia32_vpmadd52huq512_mask ((__v8di) __X, 52 1.1 mrg (__v8di) __Y, 53 1.1 mrg (__v8di) __Z, 54 1.3 mrg (__mmask8) -1); 55 1.1 mrg } 56 1.1 mrg 57 1.1 mrg extern __inline __m512i 58 1.1 mrg __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) 59 1.1 mrg _mm512_mask_madd52lo_epu64 (__m512i __W, __mmask8 __M, __m512i __X, 60 1.1 mrg __m512i __Y) 61 1.1 mrg { 62 1.1 mrg return (__m512i) __builtin_ia32_vpmadd52luq512_mask ((__v8di) __W, 63 1.1 mrg (__v8di) __X, 64 1.1 mrg (__v8di) __Y, 65 1.1 mrg (__mmask8) __M); 66 1.1 mrg } 67 1.1 mrg 68 1.1 mrg extern __inline __m512i 69 1.1 mrg __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) 70 1.1 mrg _mm512_mask_madd52hi_epu64 (__m512i __W, __mmask8 __M, __m512i __X, 71 1.1 mrg __m512i __Y) 72 1.1 mrg { 73 1.1 mrg return (__m512i) __builtin_ia32_vpmadd52huq512_mask ((__v8di) __W, 74 1.1 mrg (__v8di) __X, 75 1.1 mrg (__v8di) __Y, 76 1.1 mrg (__mmask8) __M); 77 1.1 mrg } 78 1.1 mrg 79 1.1 mrg extern __inline __m512i 80 1.1 mrg __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) 81 1.1 mrg _mm512_maskz_madd52lo_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z) 82 1.1 mrg { 83 1.1 mrg return (__m512i) __builtin_ia32_vpmadd52luq512_maskz ((__v8di) __X, 84 1.1 mrg (__v8di) __Y, 85 1.1 mrg (__v8di) __Z, 86 1.1 mrg (__mmask8) __M); 87 1.1 mrg } 88 1.1 mrg 89 1.1 mrg extern __inline __m512i 90 1.1 mrg __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) 91 1.1 mrg _mm512_maskz_madd52hi_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z) 92 1.1 mrg { 93 1.1 mrg return (__m512i) __builtin_ia32_vpmadd52huq512_maskz ((__v8di) __X, 94 1.1 mrg (__v8di) __Y, 95 1.1 mrg (__v8di) __Z, 96 1.1 mrg (__mmask8) __M); 97 1.1 mrg } 98 1.1 mrg 99 1.1 mrg #ifdef __DISABLE_AVX512IFMA__ 100 1.1 mrg #undef __DISABLE_AVX512IFMA__ 101 1.1 mrg #pragma GCC pop_options 102 1.1 mrg #endif /* __DISABLE_AVX512IFMA__ */ 103 1.1 mrg 104 1.1 mrg #endif /* _AVX512IFMAINTRIN_H_INCLUDED */ 105