Import GCC-8 to a new vendor branch
[dragonfly.git] / contrib / gcc-8.0 / gcc / config / i386 / avx512vpopcntdqintrin.h
blob722f6f841a777b7f1771058574aabb42bbc15684
1 /* Copyright (C) 2017-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 #if !defined _IMMINTRIN_H_INCLUDED
25 # error "Never use <avx512vpopcntdqintrin.h> directly; include <x86intrin.h> instead."
26 #endif
28 #ifndef _AVX512VPOPCNTDQINTRIN_H_INCLUDED
29 #define _AVX512VPOPCNTDQINTRIN_H_INCLUDED
31 #ifndef __AVX512VPOPCNTDQ__
32 #pragma GCC push_options
33 #pragma GCC target("avx512vpopcntdq")
34 #define __DISABLE_AVX512VPOPCNTDQ__
35 #endif /* __AVX512VPOPCNTDQ__ */
37 extern __inline __m512i
38 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
39 _mm512_popcnt_epi32 (__m512i __A)
41 return (__m512i) __builtin_ia32_vpopcountd_v16si ((__v16si) __A);
44 extern __inline __m512i
45 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
46 _mm512_mask_popcnt_epi32 (__m512i __A, __mmask16 __U, __m512i __B)
48 return (__m512i) __builtin_ia32_vpopcountd_v16si_mask ((__v16si) __A,
49 (__v16si) __B,
50 (__mmask16) __U);
53 extern __inline __m512i
54 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
55 _mm512_maskz_popcnt_epi32 (__mmask16 __U, __m512i __A)
57 return (__m512i) __builtin_ia32_vpopcountd_v16si_mask ((__v16si) __A,
58 (__v16si)
59 _mm512_setzero_si512 (),
60 (__mmask16) __U);
63 extern __inline __m512i
64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
65 _mm512_popcnt_epi64 (__m512i __A)
67 return (__m512i) __builtin_ia32_vpopcountq_v8di ((__v8di) __A);
70 extern __inline __m512i
71 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
72 _mm512_mask_popcnt_epi64 (__m512i __A, __mmask8 __U, __m512i __B)
74 return (__m512i) __builtin_ia32_vpopcountq_v8di_mask ((__v8di) __A,
75 (__v8di) __B,
76 (__mmask8) __U);
79 extern __inline __m512i
80 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
81 _mm512_maskz_popcnt_epi64 (__mmask8 __U, __m512i __A)
83 return (__m512i) __builtin_ia32_vpopcountq_v8di_mask ((__v8di) __A,
84 (__v8di)
85 _mm512_setzero_si512 (),
86 (__mmask8) __U);
89 #ifdef __DISABLE_AVX512VPOPCNTDQ__
90 #undef __DISABLE_AVX512VPOPCNTDQ__
91 #pragma GCC pop_options
92 #endif /* __DISABLE_AVX512VPOPCNTDQ__ */
94 #endif /* _AVX512VPOPCNTDQINTRIN_H_INCLUDED */