avx512vpopcntdqintrin.h revision 1.1.1.1.4.2 1 1.1.1.1.4.2 martin /* Copyright (C) 2017 Free Software Foundation, Inc.
2 1.1.1.1.4.2 martin
3 1.1.1.1.4.2 martin This file is part of GCC.
4 1.1.1.1.4.2 martin
5 1.1.1.1.4.2 martin GCC is free software; you can redistribute it and/or modify
6 1.1.1.1.4.2 martin it under the terms of the GNU General Public License as published by
7 1.1.1.1.4.2 martin the Free Software Foundation; either version 3, or (at your option)
8 1.1.1.1.4.2 martin any later version.
9 1.1.1.1.4.2 martin
10 1.1.1.1.4.2 martin GCC is distributed in the hope that it will be useful,
11 1.1.1.1.4.2 martin but WITHOUT ANY WARRANTY; without even the implied warranty of
12 1.1.1.1.4.2 martin MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 1.1.1.1.4.2 martin GNU General Public License for more details.
14 1.1.1.1.4.2 martin
15 1.1.1.1.4.2 martin Under Section 7 of GPL version 3, you are granted additional
16 1.1.1.1.4.2 martin permissions described in the GCC Runtime Library Exception, version
17 1.1.1.1.4.2 martin 3.1, as published by the Free Software Foundation.
18 1.1.1.1.4.2 martin
19 1.1.1.1.4.2 martin You should have received a copy of the GNU General Public License and
20 1.1.1.1.4.2 martin a copy of the GCC Runtime Library Exception along with this program;
21 1.1.1.1.4.2 martin see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 1.1.1.1.4.2 martin <http://www.gnu.org/licenses/>. */
23 1.1.1.1.4.2 martin
24 1.1.1.1.4.2 martin #if !defined _IMMINTRIN_H_INCLUDED
25 1.1.1.1.4.2 martin # error "Never use <avx512vpopcntdqintrin.h> directly; include <x86intrin.h> instead."
26 1.1.1.1.4.2 martin #endif
27 1.1.1.1.4.2 martin
28 1.1.1.1.4.2 martin #ifndef _AVX512VPOPCNTDQINTRIN_H_INCLUDED
29 1.1.1.1.4.2 martin #define _AVX512VPOPCNTDQINTRIN_H_INCLUDED
30 1.1.1.1.4.2 martin
31 1.1.1.1.4.2 martin #ifndef __AVX512VPOPCNTDQ__
32 1.1.1.1.4.2 martin #pragma GCC push_options
33 1.1.1.1.4.2 martin #pragma GCC target("avx512vpopcntdq")
34 1.1.1.1.4.2 martin #define __DISABLE_AVX512VPOPCNTDQ__
35 1.1.1.1.4.2 martin #endif /* __AVX512VPOPCNTDQ__ */
36 1.1.1.1.4.2 martin
37 1.1.1.1.4.2 martin extern __inline __m512i
38 1.1.1.1.4.2 martin __attribute__((__gnu_inline__, __always_inline__, __artificial__))
39 1.1.1.1.4.2 martin _mm512_popcnt_epi32 (__m512i __A)
40 1.1.1.1.4.2 martin {
41 1.1.1.1.4.2 martin return (__m512i) __builtin_ia32_vpopcountd_v16si ((__v16si) __A);
42 1.1.1.1.4.2 martin }
43 1.1.1.1.4.2 martin
44 1.1.1.1.4.2 martin extern __inline __m512i
45 1.1.1.1.4.2 martin __attribute__((__gnu_inline__, __always_inline__, __artificial__))
46 1.1.1.1.4.2 martin _mm512_mask_popcnt_epi32 (__m512i __A, __mmask16 __U, __m512i __B)
47 1.1.1.1.4.2 martin {
48 1.1.1.1.4.2 martin return (__m512i) __builtin_ia32_vpopcountd_v16si_mask ((__v16si) __A,
49 1.1.1.1.4.2 martin (__v16si) __B,
50 1.1.1.1.4.2 martin (__mmask16) __U);
51 1.1.1.1.4.2 martin }
52 1.1.1.1.4.2 martin
53 1.1.1.1.4.2 martin extern __inline __m512i
54 1.1.1.1.4.2 martin __attribute__((__gnu_inline__, __always_inline__, __artificial__))
55 1.1.1.1.4.2 martin _mm512_maskz_popcnt_epi32 (__mmask16 __U, __m512i __A)
56 1.1.1.1.4.2 martin {
57 1.1.1.1.4.2 martin return (__m512i) __builtin_ia32_vpopcountd_v16si_mask ((__v16si) __A,
58 1.1.1.1.4.2 martin (__v16si)
59 1.1.1.1.4.2 martin _mm512_setzero_si512 (),
60 1.1.1.1.4.2 martin (__mmask16) __U);
61 1.1.1.1.4.2 martin }
62 1.1.1.1.4.2 martin
63 1.1.1.1.4.2 martin extern __inline __m512i
64 1.1.1.1.4.2 martin __attribute__((__gnu_inline__, __always_inline__, __artificial__))
65 1.1.1.1.4.2 martin _mm512_popcnt_epi64 (__m512i __A)
66 1.1.1.1.4.2 martin {
67 1.1.1.1.4.2 martin return (__m512i) __builtin_ia32_vpopcountq_v8di ((__v8di) __A);
68 1.1.1.1.4.2 martin }
69 1.1.1.1.4.2 martin
70 1.1.1.1.4.2 martin extern __inline __m512i
71 1.1.1.1.4.2 martin __attribute__((__gnu_inline__, __always_inline__, __artificial__))
72 1.1.1.1.4.2 martin _mm512_mask_popcnt_epi64 (__m512i __A, __mmask8 __U, __m512i __B)
73 1.1.1.1.4.2 martin {
74 1.1.1.1.4.2 martin return (__m512i) __builtin_ia32_vpopcountq_v8di_mask ((__v8di) __A,
75 1.1.1.1.4.2 martin (__v8di) __B,
76 1.1.1.1.4.2 martin (__mmask8) __U);
77 1.1.1.1.4.2 martin }
78 1.1.1.1.4.2 martin
79 1.1.1.1.4.2 martin extern __inline __m512i
80 1.1.1.1.4.2 martin __attribute__((__gnu_inline__, __always_inline__, __artificial__))
81 1.1.1.1.4.2 martin _mm512_maskz_popcnt_epi64 (__mmask8 __U, __m512i __A)
82 1.1.1.1.4.2 martin {
83 1.1.1.1.4.2 martin return (__m512i) __builtin_ia32_vpopcountq_v8di_mask ((__v8di) __A,
84 1.1.1.1.4.2 martin (__v8di)
85 1.1.1.1.4.2 martin _mm512_setzero_si512 (),
86 1.1.1.1.4.2 martin (__mmask8) __U);
87 1.1.1.1.4.2 martin }
88 1.1.1.1.4.2 martin
89 1.1.1.1.4.2 martin #ifdef __DISABLE_AVX512VPOPCNTDQ__
90 1.1.1.1.4.2 martin #undef __DISABLE_AVX512VPOPCNTDQ__
91 1.1.1.1.4.2 martin #pragma GCC pop_options
92 1.1.1.1.4.2 martin #endif /* __DISABLE_AVX512VPOPCNTDQ__ */
93 1.1.1.1.4.2 martin
94 1.1.1.1.4.2 martin #endif /* _AVX512VPOPCNTDQINTRIN_H_INCLUDED */
95