convert _mm_maskz_dbsad_epu8 to const generics
This commit is contained in:
parent
d3bd341a77
commit
4b9a812619
1 changed files with 11 additions and 11 deletions
|
|
@ -8016,17 +8016,17 @@ pub unsafe fn _mm_mask_dbsad_epu8<const IMM8: i32>(
|
|||
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_dbsad_epu8&expand=2110)
|
||||
#[inline]
|
||||
#[target_feature(enable = "avx512bw,avx512vl")]
|
||||
#[rustc_args_required_const(3)]
|
||||
#[cfg_attr(test, assert_instr(vdbpsadbw, imm8 = 0))]
|
||||
pub unsafe fn _mm_maskz_dbsad_epu8(k: __mmask8, a: __m128i, b: __m128i, imm8: i32) -> __m128i {
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
|
||||
pub unsafe fn _mm_maskz_dbsad_epu8<const IMM8: i32>(
|
||||
k: __mmask8,
|
||||
a: __m128i,
|
||||
b: __m128i,
|
||||
) -> __m128i {
|
||||
static_assert_imm8!(IMM8);
|
||||
let a = a.as_u8x16();
|
||||
let b = b.as_u8x16();
|
||||
macro_rules! call {
|
||||
($imm8:expr) => {
|
||||
vdbpsadbw128(a, b, $imm8)
|
||||
};
|
||||
}
|
||||
let r = constify_imm8_sae!(imm8, call);
|
||||
let r = vdbpsadbw128(a, b, IMM8);
|
||||
transmute(simd_select_bitmask(k, r, _mm_setzero_si128().as_u16x8()))
|
||||
}
|
||||
|
||||
|
|
@ -16928,9 +16928,9 @@ mod tests {
|
|||
unsafe fn test_mm_maskz_dbsad_epu8() {
|
||||
let a = _mm_set1_epi8(2);
|
||||
let b = _mm_set1_epi8(4);
|
||||
let r = _mm_maskz_dbsad_epu8(0, a, b, 0);
|
||||
let r = _mm_maskz_dbsad_epu8::<0>(0, a, b);
|
||||
assert_eq_m128i(r, _mm_setzero_si128());
|
||||
let r = _mm_maskz_dbsad_epu8(0b11111111, a, b, 0);
|
||||
let r = _mm_maskz_dbsad_epu8::<0>(0b11111111, a, b);
|
||||
let e = _mm_set1_epi16(8);
|
||||
assert_eq_m128i(r, e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue