Skip to content

Commit a8a10bd

Browse files
lqdAmanieu
authored andcommitted
convert _mm256_maskz_alignr_epi8 to const generics
1 parent fa908e4 commit a8a10bd

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

crates/core_arch/src/x86/avx512bw.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9110,15 +9110,15 @@ pub unsafe fn _mm256_mask_alignr_epi8<const IMM8: i32>(
91109110
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_alignr_epi8&expand=262)
91119111
#[inline]
91129112
#[target_feature(enable = "avx512bw,avx512vl")]
9113-
#[rustc_args_required_const(3)]
9114-
#[cfg_attr(test, assert_instr(vpalignr, imm8 = 5))]
9115-
pub unsafe fn _mm256_maskz_alignr_epi8(k: __mmask32, a: __m256i, b: __m256i, imm8: i32) -> __m256i {
9116-
macro_rules! call {
9117-
($imm8:expr) => {
9118-
_mm256_alignr_epi8(a, b, $imm8)
9119-
};
9120-
}
9121-
let r = constify_imm8_sae!(imm8, call);
9113+
#[rustc_legacy_const_generics(3)]
9114+
#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
9115+
pub unsafe fn _mm256_maskz_alignr_epi8<const IMM8: i32>(
9116+
k: __mmask32,
9117+
a: __m256i,
9118+
b: __m256i,
9119+
) -> __m256i {
9120+
static_assert_imm8!(IMM8);
9121+
let r = _mm256_alignr_epi8(a, b, IMM8);
91229122
transmute(simd_select_bitmask(
91239123
k,
91249124
r.as_i8x32(),
@@ -17767,9 +17767,9 @@ mod tests {
1776717767
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1776817768
);
1776917769
let b = _mm256_set1_epi8(1);
17770-
let r = _mm256_maskz_alignr_epi8(0, a, b, 14);
17770+
let r = _mm256_maskz_alignr_epi8::<14>(0, a, b);
1777117771
assert_eq_m256i(r, _mm256_setzero_si256());
17772-
let r = _mm256_maskz_alignr_epi8(0b11111111_11111111_11111111_11111111, a, b, 14);
17772+
let r = _mm256_maskz_alignr_epi8::<14>(0b11111111_11111111_11111111_11111111, a, b);
1777317773
#[rustfmt::skip]
1777417774
let e = _mm256_set_epi8(
1777517775
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,

0 commit comments

Comments
 (0)