Skip to content

Commit 6d5c57c

Browse files
committed
Make avx512vpopcntdq functions const
1 parent 628a609 commit 6d5c57c

File tree

1 file changed

+36
-18
lines changed

1 file changed

+36
-18
lines changed

crates/core_arch/src/x86/avx512vpopcntdq.rs

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ use stdarch_test::assert_instr;
2626
#[target_feature(enable = "avx512vpopcntdq")]
2727
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
2828
#[cfg_attr(test, assert_instr(vpopcntd))]
29-
pub fn _mm512_popcnt_epi32(a: __m512i) -> __m512i {
29+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
30+
pub const fn _mm512_popcnt_epi32(a: __m512i) -> __m512i {
3031
unsafe { transmute(simd_ctpop(a.as_i32x16())) }
3132
}
3233

@@ -40,7 +41,8 @@ pub fn _mm512_popcnt_epi32(a: __m512i) -> __m512i {
4041
#[target_feature(enable = "avx512vpopcntdq")]
4142
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
4243
#[cfg_attr(test, assert_instr(vpopcntd))]
43-
pub fn _mm512_maskz_popcnt_epi32(k: __mmask16, a: __m512i) -> __m512i {
44+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
45+
pub const fn _mm512_maskz_popcnt_epi32(k: __mmask16, a: __m512i) -> __m512i {
4446
unsafe {
4547
transmute(simd_select_bitmask(
4648
k,
@@ -60,7 +62,8 @@ pub fn _mm512_maskz_popcnt_epi32(k: __mmask16, a: __m512i) -> __m512i {
6062
#[target_feature(enable = "avx512vpopcntdq")]
6163
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
6264
#[cfg_attr(test, assert_instr(vpopcntd))]
63-
pub fn _mm512_mask_popcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i {
65+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
66+
pub const fn _mm512_mask_popcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i {
6467
unsafe {
6568
transmute(simd_select_bitmask(
6669
k,
@@ -77,7 +80,8 @@ pub fn _mm512_mask_popcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m51
7780
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
7881
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
7982
#[cfg_attr(test, assert_instr(vpopcntd))]
80-
pub fn _mm256_popcnt_epi32(a: __m256i) -> __m256i {
83+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
84+
pub const fn _mm256_popcnt_epi32(a: __m256i) -> __m256i {
8185
unsafe { transmute(simd_ctpop(a.as_i32x8())) }
8286
}
8387

@@ -91,7 +95,8 @@ pub fn _mm256_popcnt_epi32(a: __m256i) -> __m256i {
9195
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
9296
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
9397
#[cfg_attr(test, assert_instr(vpopcntd))]
94-
pub fn _mm256_maskz_popcnt_epi32(k: __mmask8, a: __m256i) -> __m256i {
98+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
99+
pub const fn _mm256_maskz_popcnt_epi32(k: __mmask8, a: __m256i) -> __m256i {
95100
unsafe {
96101
transmute(simd_select_bitmask(
97102
k,
@@ -111,7 +116,8 @@ pub fn _mm256_maskz_popcnt_epi32(k: __mmask8, a: __m256i) -> __m256i {
111116
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
112117
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
113118
#[cfg_attr(test, assert_instr(vpopcntd))]
114-
pub fn _mm256_mask_popcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
119+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
120+
pub const fn _mm256_mask_popcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
115121
unsafe {
116122
transmute(simd_select_bitmask(
117123
k,
@@ -128,7 +134,8 @@ pub fn _mm256_mask_popcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256
128134
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
129135
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
130136
#[cfg_attr(test, assert_instr(vpopcntd))]
131-
pub fn _mm_popcnt_epi32(a: __m128i) -> __m128i {
137+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
138+
pub const fn _mm_popcnt_epi32(a: __m128i) -> __m128i {
132139
unsafe { transmute(simd_ctpop(a.as_i32x4())) }
133140
}
134141

@@ -142,7 +149,8 @@ pub fn _mm_popcnt_epi32(a: __m128i) -> __m128i {
142149
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
143150
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
144151
#[cfg_attr(test, assert_instr(vpopcntd))]
145-
pub fn _mm_maskz_popcnt_epi32(k: __mmask8, a: __m128i) -> __m128i {
152+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
153+
pub const fn _mm_maskz_popcnt_epi32(k: __mmask8, a: __m128i) -> __m128i {
146154
unsafe {
147155
transmute(simd_select_bitmask(
148156
k,
@@ -162,7 +170,8 @@ pub fn _mm_maskz_popcnt_epi32(k: __mmask8, a: __m128i) -> __m128i {
162170
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
163171
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
164172
#[cfg_attr(test, assert_instr(vpopcntd))]
165-
pub fn _mm_mask_popcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
173+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
174+
pub const fn _mm_mask_popcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
166175
unsafe {
167176
transmute(simd_select_bitmask(
168177
k,
@@ -179,7 +188,8 @@ pub fn _mm_mask_popcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
179188
#[target_feature(enable = "avx512vpopcntdq")]
180189
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
181190
#[cfg_attr(test, assert_instr(vpopcntq))]
182-
pub fn _mm512_popcnt_epi64(a: __m512i) -> __m512i {
191+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
192+
pub const fn _mm512_popcnt_epi64(a: __m512i) -> __m512i {
183193
unsafe { transmute(simd_ctpop(a.as_i64x8())) }
184194
}
185195

@@ -193,7 +203,8 @@ pub fn _mm512_popcnt_epi64(a: __m512i) -> __m512i {
193203
#[target_feature(enable = "avx512vpopcntdq")]
194204
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
195205
#[cfg_attr(test, assert_instr(vpopcntq))]
196-
pub fn _mm512_maskz_popcnt_epi64(k: __mmask8, a: __m512i) -> __m512i {
206+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
207+
pub const fn _mm512_maskz_popcnt_epi64(k: __mmask8, a: __m512i) -> __m512i {
197208
unsafe {
198209
transmute(simd_select_bitmask(
199210
k,
@@ -213,7 +224,8 @@ pub fn _mm512_maskz_popcnt_epi64(k: __mmask8, a: __m512i) -> __m512i {
213224
#[target_feature(enable = "avx512vpopcntdq")]
214225
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
215226
#[cfg_attr(test, assert_instr(vpopcntq))]
216-
pub fn _mm512_mask_popcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i {
227+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
228+
pub const fn _mm512_mask_popcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i {
217229
unsafe {
218230
transmute(simd_select_bitmask(
219231
k,
@@ -230,7 +242,8 @@ pub fn _mm512_mask_popcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512
230242
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
231243
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
232244
#[cfg_attr(test, assert_instr(vpopcntq))]
233-
pub fn _mm256_popcnt_epi64(a: __m256i) -> __m256i {
245+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
246+
pub const fn _mm256_popcnt_epi64(a: __m256i) -> __m256i {
234247
unsafe { transmute(simd_ctpop(a.as_i64x4())) }
235248
}
236249

@@ -244,7 +257,8 @@ pub fn _mm256_popcnt_epi64(a: __m256i) -> __m256i {
244257
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
245258
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
246259
#[cfg_attr(test, assert_instr(vpopcntq))]
247-
pub fn _mm256_maskz_popcnt_epi64(k: __mmask8, a: __m256i) -> __m256i {
260+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
261+
pub const fn _mm256_maskz_popcnt_epi64(k: __mmask8, a: __m256i) -> __m256i {
248262
unsafe {
249263
transmute(simd_select_bitmask(
250264
k,
@@ -264,7 +278,8 @@ pub fn _mm256_maskz_popcnt_epi64(k: __mmask8, a: __m256i) -> __m256i {
264278
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
265279
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
266280
#[cfg_attr(test, assert_instr(vpopcntq))]
267-
pub fn _mm256_mask_popcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
281+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
282+
pub const fn _mm256_mask_popcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
268283
unsafe {
269284
transmute(simd_select_bitmask(
270285
k,
@@ -281,7 +296,8 @@ pub fn _mm256_mask_popcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256
281296
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
282297
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
283298
#[cfg_attr(test, assert_instr(vpopcntq))]
284-
pub fn _mm_popcnt_epi64(a: __m128i) -> __m128i {
299+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
300+
pub const fn _mm_popcnt_epi64(a: __m128i) -> __m128i {
285301
unsafe { transmute(simd_ctpop(a.as_i64x2())) }
286302
}
287303

@@ -295,7 +311,8 @@ pub fn _mm_popcnt_epi64(a: __m128i) -> __m128i {
295311
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
296312
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
297313
#[cfg_attr(test, assert_instr(vpopcntq))]
298-
pub fn _mm_maskz_popcnt_epi64(k: __mmask8, a: __m128i) -> __m128i {
314+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
315+
pub const fn _mm_maskz_popcnt_epi64(k: __mmask8, a: __m128i) -> __m128i {
299316
unsafe {
300317
transmute(simd_select_bitmask(
301318
k,
@@ -315,7 +332,8 @@ pub fn _mm_maskz_popcnt_epi64(k: __mmask8, a: __m128i) -> __m128i {
315332
#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
316333
#[stable(feature = "stdarch_x86_avx512", since = "1.89")]
317334
#[cfg_attr(test, assert_instr(vpopcntq))]
318-
pub fn _mm_mask_popcnt_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
335+
#[rustc_const_unstable(feature = "stdarch_const_intrinsics", issue = "none")]
336+
pub const fn _mm_mask_popcnt_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
319337
unsafe {
320338
transmute(simd_select_bitmask(
321339
k,

0 commit comments

Comments
 (0)