2015-05-05 Yvan Roux <yvan.roux@linaro.org>
[official-gcc.git] / gcc / config / i386 / avx512ifmavlintrin.h
blob750eaff3ed6456a0bd8e8ac6ec72ef1c90b6a000
1 /* Copyright (C) 2013-2015 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 Under Section 7 of GPL version 3, you are granted additional
16 permissions described in the GCC Runtime Library Exception, version
17 3.1, as published by the Free Software Foundation.
19 You should have received a copy of the GNU General Public License and
20 a copy of the GCC Runtime Library Exception along with this program;
21 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 <http://www.gnu.org/licenses/>. */
24 #ifndef _IMMINTRIN_H_INCLUDED
25 #error "Never use <avx512ifmavlintrin.h> directly; include <immintrin.h> instead."
26 #endif
28 #ifndef _AVX512IFMAVLINTRIN_H_INCLUDED
29 #define _AVX512IFMAVLINTRIN_H_INCLUDED
31 #if !defined(__AVX512VL__) || !defined(__AVX512IFMA__)
32 #pragma GCC push_options
33 #pragma GCC target("avx512ifma,avx512vl")
34 #define __DISABLE_AVX512IFMAVL__
35 #endif /* __AVX512IFMAVL__ */
37 extern __inline __m128i
38 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
39 _mm_madd52lo_epu64 (__m128i __X, __m128i __Y, __m128i __Z)
41 return (__m128i) __builtin_ia32_vpmadd52luq128_mask ((__v2di) __X,
42 (__v2di) __Y,
43 (__v2di) __Z,
44 (__mmask8) - 1);
47 extern __inline __m128i
48 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
49 _mm_madd52hi_epu64 (__m128i __X, __m128i __Y, __m128i __Z)
51 return (__m128i) __builtin_ia32_vpmadd52huq128_mask ((__v2di) __X,
52 (__v2di) __Y,
53 (__v2di) __Z,
54 (__mmask8) - 1);
57 extern __inline __m256i
58 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
59 _mm256_madd52lo_epu64 (__m256i __X, __m256i __Y, __m256i __Z)
61 return (__m256i) __builtin_ia32_vpmadd52luq256_mask ((__v4di) __X,
62 (__v4di) __Y,
63 (__v4di) __Z,
64 (__mmask8) - 1);
67 extern __inline __m256i
68 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
69 _mm256_madd52hi_epu64 (__m256i __X, __m256i __Y, __m256i __Z)
71 return (__m256i) __builtin_ia32_vpmadd52huq256_mask ((__v4di) __X,
72 (__v4di) __Y,
73 (__v4di) __Z,
74 (__mmask8) - 1);
77 extern __inline __m128i
78 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
79 _mm_mask_madd52lo_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y)
81 return (__m128i) __builtin_ia32_vpmadd52luq128_mask ((__v2di) __W,
82 (__v2di) __X,
83 (__v2di) __Y,
84 (__mmask8) __M);
87 extern __inline __m128i
88 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
89 _mm_mask_madd52hi_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y)
91 return (__m128i) __builtin_ia32_vpmadd52huq128_mask ((__v2di) __W,
92 (__v2di) __X,
93 (__v2di) __Y,
94 (__mmask8) __M);
97 extern __inline __m256i
98 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
99 _mm256_mask_madd52lo_epu64 (__m256i __W, __mmask8 __M, __m256i __X,
100 __m256i __Y)
102 return (__m256i) __builtin_ia32_vpmadd52luq256_mask ((__v4di) __W,
103 (__v4di) __X,
104 (__v4di) __Y,
105 (__mmask8) __M);
108 extern __inline __m256i
109 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
110 _mm256_mask_madd52hi_epu64 (__m256i __W, __mmask8 __M, __m256i __X,
111 __m256i __Y)
113 return (__m256i) __builtin_ia32_vpmadd52huq256_mask ((__v4di) __W,
114 (__v4di) __X,
115 (__v4di) __Y,
116 (__mmask8) __M);
119 extern __inline __m128i
120 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
121 _mm_maskz_madd52lo_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z)
123 return (__m128i) __builtin_ia32_vpmadd52luq128_maskz ((__v2di) __X,
124 (__v2di) __Y,
125 (__v2di) __Z,
126 (__mmask8) __M);
129 extern __inline __m128i
130 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
131 _mm_maskz_madd52hi_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z)
133 return (__m128i) __builtin_ia32_vpmadd52huq128_maskz ((__v2di) __X,
134 (__v2di) __Y,
135 (__v2di) __Z,
136 (__mmask8) __M);
139 extern __inline __m256i
140 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
141 _mm256_maskz_madd52lo_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z)
143 return (__m256i) __builtin_ia32_vpmadd52luq256_maskz ((__v4di) __X,
144 (__v4di) __Y,
145 (__v4di) __Z,
146 (__mmask8) __M);
149 extern __inline __m256i
150 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
151 _mm256_maskz_madd52hi_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z)
153 return (__m256i) __builtin_ia32_vpmadd52huq256_maskz ((__v4di) __X,
154 (__v4di) __Y,
155 (__v4di) __Z,
156 (__mmask8) __M);
159 #ifdef __DISABLE_AVX512IFMAVL__
160 #undef __DISABLE_AVX512IFMAVL__
161 #pragma GCC pop_options
162 #endif /* __DISABLE_AVX512IFMAVL__ */
164 #endif /* _AVX512IFMAVLINTRIN_H_INCLUDED */