]> gcc.gnu.org Git - gcc.git/blob - gcc/config/i386/avx512bitalgvlintrin.h
Push evex512 target for 512 bit intrins
[gcc.git] / gcc / config / i386 / avx512bitalgvlintrin.h
1 /* Copyright (C) 2023 Free Software Foundation, Inc.
2
3 This file is part of GCC.
4
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.
9
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.
14
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.
18
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/>. */
23
24 #if !defined _IMMINTRIN_H_INCLUDED
25 # error "Never use <avx512bitalgvlintrin.h> directly; include <immintrin.h> instead."
26 #endif
27
28 #ifndef _AVX512BITALGVLINTRIN_H_INCLUDED
29 #define _AVX512BITALGVLINTRIN_H_INCLUDED
30
31 #if !defined(__AVX512BITALG__) || !defined(__AVX512VL__)
32 #pragma GCC push_options
33 #pragma GCC target("avx512bitalg,avx512vl")
34 #define __DISABLE_AVX512BITALGVL__
35 #endif /* __AVX512BITALGVL__ */
36
37 extern __inline __m256i
38 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
39 _mm256_mask_popcnt_epi8 (__m256i __W, __mmask32 __U, __m256i __A)
40 {
41 return (__m256i) __builtin_ia32_vpopcountb_v32qi_mask ((__v32qi) __A,
42 (__v32qi) __W,
43 (__mmask32) __U);
44 }
45
46 extern __inline __m256i
47 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
48 _mm256_maskz_popcnt_epi8 (__mmask32 __U, __m256i __A)
49 {
50 return (__m256i) __builtin_ia32_vpopcountb_v32qi_mask ((__v32qi) __A,
51 (__v32qi)
52 _mm256_setzero_si256 (),
53 (__mmask32) __U);
54 }
55
56 extern __inline __mmask32
57 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
58 _mm256_bitshuffle_epi64_mask (__m256i __A, __m256i __B)
59 {
60 return (__mmask32) __builtin_ia32_vpshufbitqmb256_mask ((__v32qi) __A,
61 (__v32qi) __B,
62 (__mmask32) -1);
63 }
64
65 extern __inline __mmask32
66 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
67 _mm256_mask_bitshuffle_epi64_mask (__mmask32 __M, __m256i __A, __m256i __B)
68 {
69 return (__mmask32) __builtin_ia32_vpshufbitqmb256_mask ((__v32qi) __A,
70 (__v32qi) __B,
71 (__mmask32) __M);
72 }
73
74 extern __inline __mmask16
75 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
76 _mm_bitshuffle_epi64_mask (__m128i __A, __m128i __B)
77 {
78 return (__mmask16) __builtin_ia32_vpshufbitqmb128_mask ((__v16qi) __A,
79 (__v16qi) __B,
80 (__mmask16) -1);
81 }
82
83 extern __inline __mmask16
84 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
85 _mm_mask_bitshuffle_epi64_mask (__mmask16 __M, __m128i __A, __m128i __B)
86 {
87 return (__mmask16) __builtin_ia32_vpshufbitqmb128_mask ((__v16qi) __A,
88 (__v16qi) __B,
89 (__mmask16) __M);
90 }
91
92 extern __inline __m256i
93 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
94 _mm256_popcnt_epi8 (__m256i __A)
95 {
96 return (__m256i) __builtin_ia32_vpopcountb_v32qi ((__v32qi) __A);
97 }
98
99 extern __inline __m256i
100 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
101 _mm256_popcnt_epi16 (__m256i __A)
102 {
103 return (__m256i) __builtin_ia32_vpopcountw_v16hi ((__v16hi) __A);
104 }
105
106 extern __inline __m128i
107 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
108 _mm_popcnt_epi8 (__m128i __A)
109 {
110 return (__m128i) __builtin_ia32_vpopcountb_v16qi ((__v16qi) __A);
111 }
112
113 extern __inline __m128i
114 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
115 _mm_popcnt_epi16 (__m128i __A)
116 {
117 return (__m128i) __builtin_ia32_vpopcountw_v8hi ((__v8hi) __A);
118 }
119
120 extern __inline __m256i
121 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
122 _mm256_mask_popcnt_epi16 (__m256i __W, __mmask16 __U, __m256i __A)
123 {
124 return (__m256i) __builtin_ia32_vpopcountw_v16hi_mask ((__v16hi) __A,
125 (__v16hi) __W,
126 (__mmask16) __U);
127 }
128
129 extern __inline __m256i
130 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
131 _mm256_maskz_popcnt_epi16 (__mmask16 __U, __m256i __A)
132 {
133 return (__m256i) __builtin_ia32_vpopcountw_v16hi_mask ((__v16hi) __A,
134 (__v16hi)
135 _mm256_setzero_si256 (),
136 (__mmask16) __U);
137 }
138
139 extern __inline __m128i
140 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
141 _mm_mask_popcnt_epi8 (__m128i __W, __mmask16 __U, __m128i __A)
142 {
143 return (__m128i) __builtin_ia32_vpopcountb_v16qi_mask ((__v16qi) __A,
144 (__v16qi) __W,
145 (__mmask16) __U);
146 }
147
148 extern __inline __m128i
149 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
150 _mm_maskz_popcnt_epi8 (__mmask16 __U, __m128i __A)
151 {
152 return (__m128i) __builtin_ia32_vpopcountb_v16qi_mask ((__v16qi) __A,
153 (__v16qi)
154 _mm_setzero_si128 (),
155 (__mmask16) __U);
156 }
157 extern __inline __m128i
158 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
159 _mm_mask_popcnt_epi16 (__m128i __W, __mmask8 __U, __m128i __A)
160 {
161 return (__m128i) __builtin_ia32_vpopcountw_v8hi_mask ((__v8hi) __A,
162 (__v8hi) __W,
163 (__mmask8) __U);
164 }
165
166 extern __inline __m128i
167 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
168 _mm_maskz_popcnt_epi16 (__mmask8 __U, __m128i __A)
169 {
170 return (__m128i) __builtin_ia32_vpopcountw_v8hi_mask ((__v8hi) __A,
171 (__v8hi)
172 _mm_setzero_si128 (),
173 (__mmask8) __U);
174 }
175 #ifdef __DISABLE_AVX512BITALGVL__
176 #undef __DISABLE_AVX512BITALGVL__
177 #pragma GCC pop_options
178 #endif /* __DISABLE_AVX512BITALGVL__ */
179
180 #endif /* _AVX512BITALGVLINTRIN_H_INCLUDED */
This page took 0.04424 seconds and 5 git commands to generate.