Warning: This file is not a C or C++ file. It does not have highlighting.
1 | /*===---- avx512vpopcntdqintrin.h - AVX512VPOPCNTDQ intrinsics -------------=== |
---|---|
2 | * |
3 | * |
4 | * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
5 | * See https://llvm.org/LICENSE.txt for license information. |
6 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
7 | * |
8 | *===-----------------------------------------------------------------------=== |
9 | */ |
10 | #ifndef __IMMINTRIN_H |
11 | #error \ |
12 | "Never use <avx512vpopcntdqvlintrin.h> directly; include <immintrin.h> instead." |
13 | #endif |
14 | |
15 | #ifndef __AVX512VPOPCNTDQVLINTRIN_H |
16 | #define __AVX512VPOPCNTDQVLINTRIN_H |
17 | |
18 | /* Define the default attributes for the functions in this file. */ |
19 | #define __DEFAULT_FN_ATTRS128 \ |
20 | __attribute__((__always_inline__, __nodebug__, \ |
21 | __target__("avx512vpopcntdq,avx512vl,no-evex512"), \ |
22 | __min_vector_width__(128))) |
23 | #define __DEFAULT_FN_ATTRS256 \ |
24 | __attribute__((__always_inline__, __nodebug__, \ |
25 | __target__("avx512vpopcntdq,avx512vl,no-evex512"), \ |
26 | __min_vector_width__(256))) |
27 | |
28 | static __inline__ __m128i __DEFAULT_FN_ATTRS128 |
29 | _mm_popcnt_epi64(__m128i __A) { |
30 | return (__m128i)__builtin_ia32_vpopcntq_128((__v2di)__A); |
31 | } |
32 | |
33 | static __inline__ __m128i __DEFAULT_FN_ATTRS128 |
34 | _mm_mask_popcnt_epi64(__m128i __W, __mmask8 __U, __m128i __A) { |
35 | return (__m128i)__builtin_ia32_selectq_128( |
36 | (__mmask8)__U, (__v2di)_mm_popcnt_epi64(__A), (__v2di)__W); |
37 | } |
38 | |
39 | static __inline__ __m128i __DEFAULT_FN_ATTRS128 |
40 | _mm_maskz_popcnt_epi64(__mmask8 __U, __m128i __A) { |
41 | return _mm_mask_popcnt_epi64((__m128i)_mm_setzero_si128(), __U, __A); |
42 | } |
43 | |
44 | static __inline__ __m128i __DEFAULT_FN_ATTRS128 |
45 | _mm_popcnt_epi32(__m128i __A) { |
46 | return (__m128i)__builtin_ia32_vpopcntd_128((__v4si)__A); |
47 | } |
48 | |
49 | static __inline__ __m128i __DEFAULT_FN_ATTRS128 |
50 | _mm_mask_popcnt_epi32(__m128i __W, __mmask8 __U, __m128i __A) { |
51 | return (__m128i)__builtin_ia32_selectd_128( |
52 | (__mmask8)__U, (__v4si)_mm_popcnt_epi32(__A), (__v4si)__W); |
53 | } |
54 | |
55 | static __inline__ __m128i __DEFAULT_FN_ATTRS128 |
56 | _mm_maskz_popcnt_epi32(__mmask8 __U, __m128i __A) { |
57 | return _mm_mask_popcnt_epi32((__m128i)_mm_setzero_si128(), __U, __A); |
58 | } |
59 | |
60 | static __inline__ __m256i __DEFAULT_FN_ATTRS256 |
61 | _mm256_popcnt_epi64(__m256i __A) { |
62 | return (__m256i)__builtin_ia32_vpopcntq_256((__v4di)__A); |
63 | } |
64 | |
65 | static __inline__ __m256i __DEFAULT_FN_ATTRS256 |
66 | _mm256_mask_popcnt_epi64(__m256i __W, __mmask8 __U, __m256i __A) { |
67 | return (__m256i)__builtin_ia32_selectq_256( |
68 | (__mmask8)__U, (__v4di)_mm256_popcnt_epi64(__A), (__v4di)__W); |
69 | } |
70 | |
71 | static __inline__ __m256i __DEFAULT_FN_ATTRS256 |
72 | _mm256_maskz_popcnt_epi64(__mmask8 __U, __m256i __A) { |
73 | return _mm256_mask_popcnt_epi64((__m256i)_mm256_setzero_si256(), __U, __A); |
74 | } |
75 | |
76 | static __inline__ __m256i __DEFAULT_FN_ATTRS256 |
77 | _mm256_popcnt_epi32(__m256i __A) { |
78 | return (__m256i)__builtin_ia32_vpopcntd_256((__v8si)__A); |
79 | } |
80 | |
81 | static __inline__ __m256i __DEFAULT_FN_ATTRS256 |
82 | _mm256_mask_popcnt_epi32(__m256i __W, __mmask8 __U, __m256i __A) { |
83 | return (__m256i)__builtin_ia32_selectd_256( |
84 | (__mmask8)__U, (__v8si)_mm256_popcnt_epi32(__A), (__v8si)__W); |
85 | } |
86 | |
87 | static __inline__ __m256i __DEFAULT_FN_ATTRS256 |
88 | _mm256_maskz_popcnt_epi32(__mmask8 __U, __m256i __A) { |
89 | return _mm256_mask_popcnt_epi32((__m256i)_mm256_setzero_si256(), __U, __A); |
90 | } |
91 | |
92 | #undef __DEFAULT_FN_ATTRS128 |
93 | #undef __DEFAULT_FN_ATTRS256 |
94 | |
95 | #endif |
96 |
Warning: This file is not a C or C++ file. It does not have highlighting.