Skip to content

Commit e803536

Browse files
lqdAmanieu
authored andcommitted
convert _mm512_maskz_alignr_epi8 to const generics
1 parent d01aa6c commit e803536

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

crates/core_arch/src/x86/avx512bw.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9074,15 +9074,15 @@ pub unsafe fn _mm512_mask_alignr_epi8<const IMM8: i32>(
90749074
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_alignr_epi8&expand=265)
90759075
#[inline]
90769076
#[target_feature(enable = "avx512bw")]
9077-
#[cfg_attr(test, assert_instr(vpalignr, imm8 = 1))]
9078-
#[rustc_args_required_const(3)]
9079-
pub unsafe fn _mm512_maskz_alignr_epi8(k: __mmask64, a: __m512i, b: __m512i, imm8: i32) -> __m512i {
9080-
macro_rules! call {
9081-
($imm8:expr) => {
9082-
_mm512_alignr_epi8(a, b, $imm8)
9083-
};
9084-
}
9085-
let r = constify_imm8_sae!(imm8, call);
9077+
#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))]
9078+
#[rustc_legacy_const_generics(3)]
9079+
pub unsafe fn _mm512_maskz_alignr_epi8<const IMM8: i32>(
9080+
k: __mmask64,
9081+
a: __m512i,
9082+
b: __m512i,
9083+
) -> __m512i {
9084+
static_assert_imm8!(IMM8);
9085+
let r = _mm512_alignr_epi8(a, b, IMM8);
90869086
let zero = _mm512_setzero_si512().as_i8x64();
90879087
transmute(simd_select_bitmask(k, r.as_i8x64(), zero))
90889088
}
@@ -17728,13 +17728,12 @@ mod tests {
1772817728
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1772917729
);
1773017730
let b = _mm512_set1_epi8(1);
17731-
let r = _mm512_maskz_alignr_epi8(0, a, b, 14);
17731+
let r = _mm512_maskz_alignr_epi8::<14>(0, a, b);
1773217732
assert_eq_m512i(r, _mm512_setzero_si512());
17733-
let r = _mm512_maskz_alignr_epi8(
17733+
let r = _mm512_maskz_alignr_epi8::<14>(
1773417734
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
1773517735
a,
1773617736
b,
17737-
14,
1773817737
);
1773917738
#[rustfmt::skip]
1774017739
let e = _mm512_set_epi8(

0 commit comments

Comments
 (0)