1 /* Copyright (C) 2013-2014 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)
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 <avx512cdintrin.h> directly; include <immintrin.h> instead."
28 #ifndef _AVX512CDINTRIN_H_INCLUDED
29 #define _AVX512CDINTRIN_H_INCLUDED
32 #pragma GCC push_options
33 #pragma GCC target("avx512cd")
34 #define __DISABLE_AVX512CD__
35 #endif /* __AVX512CD__ */
37 /* Internal data types for implementing the intrinsics. */
38 typedef long long __v8di
__attribute__ ((__vector_size__ (64)));
39 typedef int __v16si
__attribute__ ((__vector_size__ (64)));
41 /* The Intel API is flexible enough that we must allow aliasing with other
42 vector types, and their scalar components. */
43 typedef long long __m512i
__attribute__ ((__vector_size__ (64), __may_alias__
));
44 typedef double __m512d
__attribute__ ((__vector_size__ (64), __may_alias__
));
46 typedef unsigned char __mmask8
;
47 typedef unsigned short __mmask16
;
49 extern __inline __m512i
50 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
51 _mm512_conflict_epi32 (__m512i __A
)
54 __builtin_ia32_vpconflictsi_512_mask ((__v16si
) __A
,
55 (__v16si
) _mm512_setzero_si512 (),
59 extern __inline __m512i
60 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
61 _mm512_mask_conflict_epi32 (__m512i __W
, __mmask16 __U
, __m512i __A
)
63 return (__m512i
) __builtin_ia32_vpconflictsi_512_mask ((__v16si
) __A
,
68 extern __inline __m512i
69 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
70 _mm512_maskz_conflict_epi32 (__mmask16 __U
, __m512i __A
)
73 __builtin_ia32_vpconflictsi_512_mask ((__v16si
) __A
,
74 (__v16si
) _mm512_setzero_si512 (),
78 extern __inline __m512i
79 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
80 _mm512_conflict_epi64 (__m512i __A
)
83 __builtin_ia32_vpconflictdi_512_mask ((__v8di
) __A
,
84 (__v8di
) _mm512_setzero_si512 (),
88 extern __inline __m512i
89 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
90 _mm512_mask_conflict_epi64 (__m512i __W
, __mmask8 __U
, __m512i __A
)
92 return (__m512i
) __builtin_ia32_vpconflictdi_512_mask ((__v8di
) __A
,
97 extern __inline __m512i
98 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
99 _mm512_maskz_conflict_epi64 (__mmask8 __U
, __m512i __A
)
102 __builtin_ia32_vpconflictdi_512_mask ((__v8di
) __A
,
103 (__v8di
) _mm512_setzero_si512 (),
107 extern __inline __m512i
108 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
109 _mm512_lzcnt_epi64 (__m512i __A
)
112 __builtin_ia32_vplzcntq_512_mask ((__v8di
) __A
,
113 (__v8di
) _mm512_setzero_si512 (),
117 extern __inline __m512i
118 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
119 _mm512_mask_lzcnt_epi64 (__m512i __W
, __mmask8 __U
, __m512i __A
)
121 return (__m512i
) __builtin_ia32_vplzcntq_512_mask ((__v8di
) __A
,
126 extern __inline __m512i
127 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
128 _mm512_maskz_lzcnt_epi64 (__mmask8 __U
, __m512i __A
)
131 __builtin_ia32_vplzcntq_512_mask ((__v8di
) __A
,
132 (__v8di
) _mm512_setzero_si512 (),
136 extern __inline __m512i
137 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
138 _mm512_lzcnt_epi32 (__m512i __A
)
141 __builtin_ia32_vplzcntd_512_mask ((__v16si
) __A
,
142 (__v16si
) _mm512_setzero_si512 (),
146 extern __inline __m512i
147 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
148 _mm512_mask_lzcnt_epi32 (__m512i __W
, __mmask16 __U
, __m512i __A
)
150 return (__m512i
) __builtin_ia32_vplzcntd_512_mask ((__v16si
) __A
,
155 extern __inline __m512i
156 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
157 _mm512_maskz_lzcnt_epi32 (__mmask16 __U
, __m512i __A
)
160 __builtin_ia32_vplzcntd_512_mask ((__v16si
) __A
,
161 (__v16si
) _mm512_setzero_si512 (),
165 extern __inline __m512i
166 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
167 _mm512_broadcastmb_epi64 (__mmask8 __A
)
169 return (__m512i
) __builtin_ia32_broadcastmb512 (__A
);
172 extern __inline __m512i
173 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
174 _mm512_broadcastmw_epi32 (__mmask16 __A
)
176 return (__m512i
) __builtin_ia32_broadcastmw512 (__A
);
179 #ifdef __DISABLE_AVX512CD__
180 #undef __DISABLE_AVX512CD__
181 #pragma GCC pop_options
182 #endif /* __DISABLE_AVX512CD__ */
184 #endif /* _AVX512CDINTRIN_H_INCLUDED */