Import GCC-8 to a new vendor branch
[dragonfly.git] / contrib / gcc-8.0 / gcc / config / i386 / avx512cdintrin.h
blobbd4149e173ff0677d9087fb6146c771de698974b
1 /* Copyright (C) 2013-2018 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 <avx512cdintrin.h> directly; include <immintrin.h> instead."
26 #endif
28 #ifndef _AVX512CDINTRIN_H_INCLUDED
29 #define _AVX512CDINTRIN_H_INCLUDED
31 #ifndef __AVX512CD__
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)
53 return (__m512i)
54 __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
55 (__v16si) _mm512_setzero_si512 (),
56 (__mmask16) -1);
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,
64 (__v16si) __W,
65 (__mmask16) __U);
68 extern __inline __m512i
69 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
70 _mm512_maskz_conflict_epi32 (__mmask16 __U, __m512i __A)
72 return (__m512i)
73 __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
74 (__v16si) _mm512_setzero_si512 (),
75 (__mmask16) __U);
78 extern __inline __m512i
79 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
80 _mm512_conflict_epi64 (__m512i __A)
82 return (__m512i)
83 __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
84 (__v8di) _mm512_setzero_si512 (),
85 (__mmask8) -1);
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,
93 (__v8di) __W,
94 (__mmask8) __U);
97 extern __inline __m512i
98 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
99 _mm512_maskz_conflict_epi64 (__mmask8 __U, __m512i __A)
101 return (__m512i)
102 __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
103 (__v8di) _mm512_setzero_si512 (),
104 (__mmask8) __U);
107 extern __inline __m512i
108 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
109 _mm512_lzcnt_epi64 (__m512i __A)
111 return (__m512i)
112 __builtin_ia32_vplzcntq_512_mask ((__v8di) __A,
113 (__v8di) _mm512_setzero_si512 (),
114 (__mmask8) -1);
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,
122 (__v8di) __W,
123 (__mmask8) __U);
126 extern __inline __m512i
127 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
128 _mm512_maskz_lzcnt_epi64 (__mmask8 __U, __m512i __A)
130 return (__m512i)
131 __builtin_ia32_vplzcntq_512_mask ((__v8di) __A,
132 (__v8di) _mm512_setzero_si512 (),
133 (__mmask8) __U);
136 extern __inline __m512i
137 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
138 _mm512_lzcnt_epi32 (__m512i __A)
140 return (__m512i)
141 __builtin_ia32_vplzcntd_512_mask ((__v16si) __A,
142 (__v16si) _mm512_setzero_si512 (),
143 (__mmask16) -1);
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,
151 (__v16si) __W,
152 (__mmask16) __U);
155 extern __inline __m512i
156 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
157 _mm512_maskz_lzcnt_epi32 (__mmask16 __U, __m512i __A)
159 return (__m512i)
160 __builtin_ia32_vplzcntd_512_mask ((__v16si) __A,
161 (__v16si) _mm512_setzero_si512 (),
162 (__mmask16) __U);
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 */