use crate::{
core_arch::{simd::*, x86::*},
intrinsics::simd::*,
ptr,
};
#[cfg(test)]
use stdarch_test::assert_instr;
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsw))]
pub unsafe fn _mm512_abs_epi16(a: __m512i) -> __m512i {
let a = a.as_i16x32();
let cmp: i16x32 = simd_gt(a, i16x32::splat(0));
transmute(simd_select(cmp, a, simd_neg(a)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsw))]
pub unsafe fn _mm512_mask_abs_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i {
let abs = _mm512_abs_epi16(a).as_i16x32();
transmute(simd_select_bitmask(k, abs, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsw))]
pub unsafe fn _mm512_maskz_abs_epi16(k: __mmask32, a: __m512i) -> __m512i {
let abs = _mm512_abs_epi16(a).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, abs, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsw))]
pub unsafe fn _mm256_mask_abs_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i {
let abs = _mm256_abs_epi16(a).as_i16x16();
transmute(simd_select_bitmask(k, abs, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsw))]
pub unsafe fn _mm256_maskz_abs_epi16(k: __mmask16, a: __m256i) -> __m256i {
let abs = _mm256_abs_epi16(a).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, abs, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsw))]
pub unsafe fn _mm_mask_abs_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
let abs = _mm_abs_epi16(a).as_i16x8();
transmute(simd_select_bitmask(k, abs, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsw))]
pub unsafe fn _mm_maskz_abs_epi16(k: __mmask8, a: __m128i) -> __m128i {
let abs = _mm_abs_epi16(a).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, abs, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsb))]
pub unsafe fn _mm512_abs_epi8(a: __m512i) -> __m512i {
let a = a.as_i8x64();
let cmp: i8x64 = simd_gt(a, i8x64::splat(0));
transmute(simd_select(cmp, a, simd_neg(a)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsb))]
pub unsafe fn _mm512_mask_abs_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i {
let abs = _mm512_abs_epi8(a).as_i8x64();
transmute(simd_select_bitmask(k, abs, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsb))]
pub unsafe fn _mm512_maskz_abs_epi8(k: __mmask64, a: __m512i) -> __m512i {
let abs = _mm512_abs_epi8(a).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, abs, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsb))]
pub unsafe fn _mm256_mask_abs_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i {
let abs = _mm256_abs_epi8(a).as_i8x32();
transmute(simd_select_bitmask(k, abs, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsb))]
pub unsafe fn _mm256_maskz_abs_epi8(k: __mmask32, a: __m256i) -> __m256i {
let abs = _mm256_abs_epi8(a).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, abs, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsb))]
pub unsafe fn _mm_mask_abs_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
let abs = _mm_abs_epi8(a).as_i8x16();
transmute(simd_select_bitmask(k, abs, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpabsb))]
pub unsafe fn _mm_maskz_abs_epi8(k: __mmask16, a: __m128i) -> __m128i {
let abs = _mm_abs_epi8(a).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, abs, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddw))]
pub unsafe fn _mm512_add_epi16(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_add(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddw))]
pub unsafe fn _mm512_mask_add_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let add = _mm512_add_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, add, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddw))]
pub unsafe fn _mm512_maskz_add_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let add = _mm512_add_epi16(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, add, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddw))]
pub unsafe fn _mm256_mask_add_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let add = _mm256_add_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, add, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddw))]
pub unsafe fn _mm256_maskz_add_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let add = _mm256_add_epi16(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, add, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddw))]
pub unsafe fn _mm_mask_add_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_add_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, add, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddw))]
pub unsafe fn _mm_maskz_add_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_add_epi16(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, add, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddb))]
pub unsafe fn _mm512_add_epi8(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_add(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddb))]
pub unsafe fn _mm512_mask_add_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let add = _mm512_add_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, add, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddb))]
pub unsafe fn _mm512_maskz_add_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let add = _mm512_add_epi8(a, b).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, add, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddb))]
pub unsafe fn _mm256_mask_add_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let add = _mm256_add_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, add, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddb))]
pub unsafe fn _mm256_maskz_add_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let add = _mm256_add_epi8(a, b).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, add, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddb))]
pub unsafe fn _mm_mask_add_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_add_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, add, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddb))]
pub unsafe fn _mm_maskz_add_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_add_epi8(a, b).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, add, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusw))]
pub unsafe fn _mm512_adds_epu16(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_saturating_add(a.as_u16x32(), b.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusw))]
pub unsafe fn _mm512_mask_adds_epu16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let add = _mm512_adds_epu16(a, b).as_u16x32();
transmute(simd_select_bitmask(k, add, src.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusw))]
pub unsafe fn _mm512_maskz_adds_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let add = _mm512_adds_epu16(a, b).as_u16x32();
transmute(simd_select_bitmask(k, add, u16x32::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusw))]
pub unsafe fn _mm256_mask_adds_epu16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let add = _mm256_adds_epu16(a, b).as_u16x16();
transmute(simd_select_bitmask(k, add, src.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusw))]
pub unsafe fn _mm256_maskz_adds_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let add = _mm256_adds_epu16(a, b).as_u16x16();
transmute(simd_select_bitmask(k, add, u16x16::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusw))]
pub unsafe fn _mm_mask_adds_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_adds_epu16(a, b).as_u16x8();
transmute(simd_select_bitmask(k, add, src.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusw))]
pub unsafe fn _mm_maskz_adds_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_adds_epu16(a, b).as_u16x8();
transmute(simd_select_bitmask(k, add, u16x8::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusb))]
pub unsafe fn _mm512_adds_epu8(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_saturating_add(a.as_u8x64(), b.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusb))]
pub unsafe fn _mm512_mask_adds_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let add = _mm512_adds_epu8(a, b).as_u8x64();
transmute(simd_select_bitmask(k, add, src.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusb))]
pub unsafe fn _mm512_maskz_adds_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let add = _mm512_adds_epu8(a, b).as_u8x64();
transmute(simd_select_bitmask(k, add, u8x64::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusb))]
pub unsafe fn _mm256_mask_adds_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let add = _mm256_adds_epu8(a, b).as_u8x32();
transmute(simd_select_bitmask(k, add, src.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusb))]
pub unsafe fn _mm256_maskz_adds_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let add = _mm256_adds_epu8(a, b).as_u8x32();
transmute(simd_select_bitmask(k, add, u8x32::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusb))]
pub unsafe fn _mm_mask_adds_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_adds_epu8(a, b).as_u8x16();
transmute(simd_select_bitmask(k, add, src.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddusb))]
pub unsafe fn _mm_maskz_adds_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_adds_epu8(a, b).as_u8x16();
transmute(simd_select_bitmask(k, add, u8x16::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsw))]
pub unsafe fn _mm512_adds_epi16(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_saturating_add(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsw))]
pub unsafe fn _mm512_mask_adds_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let add = _mm512_adds_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, add, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsw))]
pub unsafe fn _mm512_maskz_adds_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let add = _mm512_adds_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, add, i16x32::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsw))]
pub unsafe fn _mm256_mask_adds_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let add = _mm256_adds_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, add, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsw))]
pub unsafe fn _mm256_maskz_adds_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let add = _mm256_adds_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, add, i16x16::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsw))]
pub unsafe fn _mm_mask_adds_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_adds_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, add, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsw))]
pub unsafe fn _mm_maskz_adds_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_adds_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, add, i16x8::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsb))]
pub unsafe fn _mm512_adds_epi8(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_saturating_add(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsb))]
pub unsafe fn _mm512_mask_adds_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let add = _mm512_adds_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, add, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsb))]
pub unsafe fn _mm512_maskz_adds_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let add = _mm512_adds_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, add, i8x64::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsb))]
pub unsafe fn _mm256_mask_adds_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let add = _mm256_adds_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, add, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsb))]
pub unsafe fn _mm256_maskz_adds_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let add = _mm256_adds_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, add, i8x32::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsb))]
pub unsafe fn _mm_mask_adds_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_adds_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, add, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpaddsb))]
pub unsafe fn _mm_maskz_adds_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let add = _mm_adds_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, add, i8x16::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubw))]
pub unsafe fn _mm512_sub_epi16(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_sub(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubw))]
pub unsafe fn _mm512_mask_sub_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let sub = _mm512_sub_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, sub, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubw))]
pub unsafe fn _mm512_maskz_sub_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let sub = _mm512_sub_epi16(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, sub, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubw))]
pub unsafe fn _mm256_mask_sub_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let sub = _mm256_sub_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, sub, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubw))]
pub unsafe fn _mm256_maskz_sub_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let sub = _mm256_sub_epi16(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, sub, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubw))]
pub unsafe fn _mm_mask_sub_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_sub_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, sub, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubw))]
pub unsafe fn _mm_maskz_sub_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_sub_epi16(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, sub, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubb))]
pub unsafe fn _mm512_sub_epi8(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_sub(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubb))]
pub unsafe fn _mm512_mask_sub_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let sub = _mm512_sub_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, sub, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubb))]
pub unsafe fn _mm512_maskz_sub_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let sub = _mm512_sub_epi8(a, b).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, sub, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubb))]
pub unsafe fn _mm256_mask_sub_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let sub = _mm256_sub_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, sub, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubb))]
pub unsafe fn _mm256_maskz_sub_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let sub = _mm256_sub_epi8(a, b).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, sub, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubb))]
pub unsafe fn _mm_mask_sub_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_sub_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, sub, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubb))]
pub unsafe fn _mm_maskz_sub_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_sub_epi8(a, b).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, sub, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusw))]
pub unsafe fn _mm512_subs_epu16(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_saturating_sub(a.as_u16x32(), b.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusw))]
pub unsafe fn _mm512_mask_subs_epu16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let sub = _mm512_subs_epu16(a, b).as_u16x32();
transmute(simd_select_bitmask(k, sub, src.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusw))]
pub unsafe fn _mm512_maskz_subs_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let sub = _mm512_subs_epu16(a, b).as_u16x32();
transmute(simd_select_bitmask(k, sub, u16x32::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusw))]
pub unsafe fn _mm256_mask_subs_epu16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let sub = _mm256_subs_epu16(a, b).as_u16x16();
transmute(simd_select_bitmask(k, sub, src.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusw))]
pub unsafe fn _mm256_maskz_subs_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let sub = _mm256_subs_epu16(a, b).as_u16x16();
transmute(simd_select_bitmask(k, sub, u16x16::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusw))]
pub unsafe fn _mm_mask_subs_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_subs_epu16(a, b).as_u16x8();
transmute(simd_select_bitmask(k, sub, src.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusw))]
pub unsafe fn _mm_maskz_subs_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_subs_epu16(a, b).as_u16x8();
transmute(simd_select_bitmask(k, sub, u16x8::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusb))]
pub unsafe fn _mm512_subs_epu8(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_saturating_sub(a.as_u8x64(), b.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusb))]
pub unsafe fn _mm512_mask_subs_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let sub = _mm512_subs_epu8(a, b).as_u8x64();
transmute(simd_select_bitmask(k, sub, src.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusb))]
pub unsafe fn _mm512_maskz_subs_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let sub = _mm512_subs_epu8(a, b).as_u8x64();
transmute(simd_select_bitmask(k, sub, u8x64::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusb))]
pub unsafe fn _mm256_mask_subs_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let sub = _mm256_subs_epu8(a, b).as_u8x32();
transmute(simd_select_bitmask(k, sub, src.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusb))]
pub unsafe fn _mm256_maskz_subs_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let sub = _mm256_subs_epu8(a, b).as_u8x32();
transmute(simd_select_bitmask(k, sub, u8x32::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusb))]
pub unsafe fn _mm_mask_subs_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_subs_epu8(a, b).as_u8x16();
transmute(simd_select_bitmask(k, sub, src.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubusb))]
pub unsafe fn _mm_maskz_subs_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_subs_epu8(a, b).as_u8x16();
transmute(simd_select_bitmask(k, sub, u8x16::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsw))]
pub unsafe fn _mm512_subs_epi16(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_saturating_sub(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsw))]
pub unsafe fn _mm512_mask_subs_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let sub = _mm512_subs_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, sub, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsw))]
pub unsafe fn _mm512_maskz_subs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let sub = _mm512_subs_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, sub, i16x32::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsw))]
pub unsafe fn _mm256_mask_subs_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let sub = _mm256_subs_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, sub, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsw))]
pub unsafe fn _mm256_maskz_subs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let sub = _mm256_subs_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, sub, i16x16::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsw))]
pub unsafe fn _mm_mask_subs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_subs_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, sub, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsw))]
pub unsafe fn _mm_maskz_subs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_subs_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, sub, i16x8::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsb))]
pub unsafe fn _mm512_subs_epi8(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_saturating_sub(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsb))]
pub unsafe fn _mm512_mask_subs_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let sub = _mm512_subs_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, sub, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsb))]
pub unsafe fn _mm512_maskz_subs_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let sub = _mm512_subs_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, sub, i8x64::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsb))]
pub unsafe fn _mm256_mask_subs_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let sub = _mm256_subs_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, sub, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsb))]
pub unsafe fn _mm256_maskz_subs_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let sub = _mm256_subs_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, sub, i8x32::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsb))]
pub unsafe fn _mm_mask_subs_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_subs_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, sub, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsubsb))]
pub unsafe fn _mm_maskz_subs_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let sub = _mm_subs_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, sub, i8x16::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhuw))]
pub unsafe fn _mm512_mulhi_epu16(a: __m512i, b: __m512i) -> __m512i {
let a = simd_cast::<_, u32x32>(a.as_u16x32());
let b = simd_cast::<_, u32x32>(b.as_u16x32());
let r = simd_shr(simd_mul(a, b), u32x32::splat(16));
transmute(simd_cast::<u32x32, u16x32>(r))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhuw))]
pub unsafe fn _mm512_mask_mulhi_epu16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let mul = _mm512_mulhi_epu16(a, b).as_u16x32();
transmute(simd_select_bitmask(k, mul, src.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhuw))]
pub unsafe fn _mm512_maskz_mulhi_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let mul = _mm512_mulhi_epu16(a, b).as_u16x32();
let zero = _mm512_setzero_si512().as_u16x32();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhuw))]
pub unsafe fn _mm256_mask_mulhi_epu16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let mul = _mm256_mulhi_epu16(a, b).as_u16x16();
transmute(simd_select_bitmask(k, mul, src.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhuw))]
pub unsafe fn _mm256_maskz_mulhi_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let mul = _mm256_mulhi_epu16(a, b).as_u16x16();
let zero = _mm256_setzero_si256().as_u16x16();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhuw))]
pub unsafe fn _mm_mask_mulhi_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let mul = _mm_mulhi_epu16(a, b).as_u16x8();
transmute(simd_select_bitmask(k, mul, src.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhuw))]
pub unsafe fn _mm_maskz_mulhi_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let mul = _mm_mulhi_epu16(a, b).as_u16x8();
let zero = _mm_setzero_si128().as_u16x8();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhw))]
pub unsafe fn _mm512_mulhi_epi16(a: __m512i, b: __m512i) -> __m512i {
let a = simd_cast::<_, i32x32>(a.as_i16x32());
let b = simd_cast::<_, i32x32>(b.as_i16x32());
let r = simd_shr(simd_mul(a, b), i32x32::splat(16));
transmute(simd_cast::<i32x32, i16x32>(r))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhw))]
pub unsafe fn _mm512_mask_mulhi_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let mul = _mm512_mulhi_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, mul, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhw))]
pub unsafe fn _mm512_maskz_mulhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let mul = _mm512_mulhi_epi16(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhw))]
pub unsafe fn _mm256_mask_mulhi_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let mul = _mm256_mulhi_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, mul, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhw))]
pub unsafe fn _mm256_maskz_mulhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let mul = _mm256_mulhi_epi16(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhw))]
pub unsafe fn _mm_mask_mulhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let mul = _mm_mulhi_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, mul, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhw))]
pub unsafe fn _mm_maskz_mulhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let mul = _mm_mulhi_epi16(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhrsw))]
pub unsafe fn _mm512_mulhrs_epi16(a: __m512i, b: __m512i) -> __m512i {
transmute(vpmulhrsw(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhrsw))]
pub unsafe fn _mm512_mask_mulhrs_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let mul = _mm512_mulhrs_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, mul, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhrsw))]
pub unsafe fn _mm512_maskz_mulhrs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let mul = _mm512_mulhrs_epi16(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhrsw))]
pub unsafe fn _mm256_mask_mulhrs_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let mul = _mm256_mulhrs_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, mul, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhrsw))]
pub unsafe fn _mm256_maskz_mulhrs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let mul = _mm256_mulhrs_epi16(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhrsw))]
pub unsafe fn _mm_mask_mulhrs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let mul = _mm_mulhrs_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, mul, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmulhrsw))]
pub unsafe fn _mm_maskz_mulhrs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let mul = _mm_mulhrs_epi16(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmullw))]
pub unsafe fn _mm512_mullo_epi16(a: __m512i, b: __m512i) -> __m512i {
transmute(simd_mul(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmullw))]
pub unsafe fn _mm512_mask_mullo_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let mul = _mm512_mullo_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, mul, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmullw))]
pub unsafe fn _mm512_maskz_mullo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let mul = _mm512_mullo_epi16(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmullw))]
pub unsafe fn _mm256_mask_mullo_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let mul = _mm256_mullo_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, mul, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmullw))]
pub unsafe fn _mm256_maskz_mullo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let mul = _mm256_mullo_epi16(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmullw))]
pub unsafe fn _mm_mask_mullo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let mul = _mm_mullo_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, mul, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmullw))]
pub unsafe fn _mm_maskz_mullo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let mul = _mm_mullo_epi16(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, mul, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxuw))]
pub unsafe fn _mm512_max_epu16(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_u16x32();
let b = b.as_u16x32();
transmute(simd_select::<i16x32, _>(simd_gt(a, b), a, b))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxuw))]
pub unsafe fn _mm512_mask_max_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let max = _mm512_max_epu16(a, b).as_u16x32();
transmute(simd_select_bitmask(k, max, src.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxuw))]
pub unsafe fn _mm512_maskz_max_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let max = _mm512_max_epu16(a, b).as_u16x32();
let zero = _mm512_setzero_si512().as_u16x32();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxuw))]
pub unsafe fn _mm256_mask_max_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let max = _mm256_max_epu16(a, b).as_u16x16();
transmute(simd_select_bitmask(k, max, src.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxuw))]
pub unsafe fn _mm256_maskz_max_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let max = _mm256_max_epu16(a, b).as_u16x16();
let zero = _mm256_setzero_si256().as_u16x16();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxuw))]
pub unsafe fn _mm_mask_max_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let max = _mm_max_epu16(a, b).as_u16x8();
transmute(simd_select_bitmask(k, max, src.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxuw))]
pub unsafe fn _mm_maskz_max_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let max = _mm_max_epu16(a, b).as_u16x8();
let zero = _mm_setzero_si128().as_u16x8();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxub))]
pub unsafe fn _mm512_max_epu8(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_u8x64();
let b = b.as_u8x64();
transmute(simd_select::<i8x64, _>(simd_gt(a, b), a, b))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxub))]
pub unsafe fn _mm512_mask_max_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let max = _mm512_max_epu8(a, b).as_u8x64();
transmute(simd_select_bitmask(k, max, src.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxub))]
pub unsafe fn _mm512_maskz_max_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let max = _mm512_max_epu8(a, b).as_u8x64();
let zero = _mm512_setzero_si512().as_u8x64();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxub))]
pub unsafe fn _mm256_mask_max_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let max = _mm256_max_epu8(a, b).as_u8x32();
transmute(simd_select_bitmask(k, max, src.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxub))]
pub unsafe fn _mm256_maskz_max_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let max = _mm256_max_epu8(a, b).as_u8x32();
let zero = _mm256_setzero_si256().as_u8x32();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxub))]
pub unsafe fn _mm_mask_max_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let max = _mm_max_epu8(a, b).as_u8x16();
transmute(simd_select_bitmask(k, max, src.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxub))]
pub unsafe fn _mm_maskz_max_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let max = _mm_max_epu8(a, b).as_u8x16();
let zero = _mm_setzero_si128().as_u8x16();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsw))]
pub unsafe fn _mm512_max_epi16(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_i16x32();
let b = b.as_i16x32();
transmute(simd_select::<i16x32, _>(simd_gt(a, b), a, b))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsw))]
pub unsafe fn _mm512_mask_max_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let max = _mm512_max_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, max, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsw))]
pub unsafe fn _mm512_maskz_max_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let max = _mm512_max_epi16(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsw))]
pub unsafe fn _mm256_mask_max_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let max = _mm256_max_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, max, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsw))]
pub unsafe fn _mm256_maskz_max_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let max = _mm256_max_epi16(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsw))]
pub unsafe fn _mm_mask_max_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let max = _mm_max_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, max, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsw))]
pub unsafe fn _mm_maskz_max_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let max = _mm_max_epi16(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsb))]
pub unsafe fn _mm512_max_epi8(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_i8x64();
let b = b.as_i8x64();
transmute(simd_select::<i8x64, _>(simd_gt(a, b), a, b))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsb))]
pub unsafe fn _mm512_mask_max_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let max = _mm512_max_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, max, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsb))]
pub unsafe fn _mm512_maskz_max_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let max = _mm512_max_epi8(a, b).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsb))]
pub unsafe fn _mm256_mask_max_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let max = _mm256_max_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, max, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsb))]
pub unsafe fn _mm256_maskz_max_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let max = _mm256_max_epi8(a, b).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsb))]
pub unsafe fn _mm_mask_max_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let max = _mm_max_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, max, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaxsb))]
pub unsafe fn _mm_maskz_max_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let max = _mm_max_epi8(a, b).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, max, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminuw))]
pub unsafe fn _mm512_min_epu16(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_u16x32();
let b = b.as_u16x32();
transmute(simd_select::<i16x32, _>(simd_lt(a, b), a, b))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminuw))]
pub unsafe fn _mm512_mask_min_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let min = _mm512_min_epu16(a, b).as_u16x32();
transmute(simd_select_bitmask(k, min, src.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminuw))]
pub unsafe fn _mm512_maskz_min_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let min = _mm512_min_epu16(a, b).as_u16x32();
let zero = _mm512_setzero_si512().as_u16x32();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminuw))]
pub unsafe fn _mm256_mask_min_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let min = _mm256_min_epu16(a, b).as_u16x16();
transmute(simd_select_bitmask(k, min, src.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminuw))]
pub unsafe fn _mm256_maskz_min_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let min = _mm256_min_epu16(a, b).as_u16x16();
let zero = _mm256_setzero_si256().as_u16x16();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminuw))]
pub unsafe fn _mm_mask_min_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let min = _mm_min_epu16(a, b).as_u16x8();
transmute(simd_select_bitmask(k, min, src.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminuw))]
pub unsafe fn _mm_maskz_min_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let min = _mm_min_epu16(a, b).as_u16x8();
let zero = _mm_setzero_si128().as_u16x8();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminub))]
pub unsafe fn _mm512_min_epu8(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_u8x64();
let b = b.as_u8x64();
transmute(simd_select::<i8x64, _>(simd_lt(a, b), a, b))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminub))]
pub unsafe fn _mm512_mask_min_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let min = _mm512_min_epu8(a, b).as_u8x64();
transmute(simd_select_bitmask(k, min, src.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminub))]
pub unsafe fn _mm512_maskz_min_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let min = _mm512_min_epu8(a, b).as_u8x64();
let zero = _mm512_setzero_si512().as_u8x64();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminub))]
pub unsafe fn _mm256_mask_min_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let min = _mm256_min_epu8(a, b).as_u8x32();
transmute(simd_select_bitmask(k, min, src.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminub))]
pub unsafe fn _mm256_maskz_min_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let min = _mm256_min_epu8(a, b).as_u8x32();
let zero = _mm256_setzero_si256().as_u8x32();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminub))]
pub unsafe fn _mm_mask_min_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let min = _mm_min_epu8(a, b).as_u8x16();
transmute(simd_select_bitmask(k, min, src.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminub))]
pub unsafe fn _mm_maskz_min_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let min = _mm_min_epu8(a, b).as_u8x16();
let zero = _mm_setzero_si128().as_u8x16();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsw))]
pub unsafe fn _mm512_min_epi16(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_i16x32();
let b = b.as_i16x32();
transmute(simd_select::<i16x32, _>(simd_lt(a, b), a, b))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsw))]
pub unsafe fn _mm512_mask_min_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let min = _mm512_min_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, min, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsw))]
pub unsafe fn _mm512_maskz_min_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let min = _mm512_min_epi16(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsw))]
pub unsafe fn _mm256_mask_min_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let min = _mm256_min_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, min, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsw))]
pub unsafe fn _mm256_maskz_min_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let min = _mm256_min_epi16(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsw))]
pub unsafe fn _mm_mask_min_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let min = _mm_min_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, min, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsw))]
pub unsafe fn _mm_maskz_min_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let min = _mm_min_epi16(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsb))]
pub unsafe fn _mm512_min_epi8(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_i8x64();
let b = b.as_i8x64();
transmute(simd_select::<i8x64, _>(simd_lt(a, b), a, b))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsb))]
pub unsafe fn _mm512_mask_min_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let min = _mm512_min_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, min, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsb))]
pub unsafe fn _mm512_maskz_min_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let min = _mm512_min_epi8(a, b).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsb))]
pub unsafe fn _mm256_mask_min_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let min = _mm256_min_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, min, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsb))]
pub unsafe fn _mm256_maskz_min_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let min = _mm256_min_epi8(a, b).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsb))]
pub unsafe fn _mm_mask_min_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let min = _mm_min_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, min, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpminsb))]
pub unsafe fn _mm_maskz_min_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let min = _mm_min_epi8(a, b).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, min, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmplt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<u16x32, _>(simd_lt(a.as_u16x32(), b.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmplt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmplt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<u16x16, _>(simd_lt(a.as_u16x16(), b.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmplt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmplt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<u16x8, _>(simd_lt(a.as_u16x8(), b.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmplt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmplt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<u8x64, _>(simd_lt(a.as_u8x64(), b.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmplt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmplt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<u8x32, _>(simd_lt(a.as_u8x32(), b.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmplt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmplt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<u8x16, _>(simd_lt(a.as_u8x16(), b.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmplt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmplt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<i16x32, _>(simd_lt(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmplt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmplt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<i16x16, _>(simd_lt(a.as_i16x16(), b.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmplt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmplt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<i16x8, _>(simd_lt(a.as_i16x8(), b.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmplt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmplt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<i8x64, _>(simd_lt(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmplt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmplt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<i8x32, _>(simd_lt(a.as_i8x32(), b.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmplt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmplt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<i8x16, _>(simd_lt(a.as_i8x16(), b.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmplt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpgt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<u16x32, _>(simd_gt(a.as_u16x32(), b.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpgt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpgt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<u16x16, _>(simd_gt(a.as_u16x16(), b.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpgt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpgt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<u16x8, _>(simd_gt(a.as_u16x8(), b.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpgt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpgt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<u8x64, _>(simd_gt(a.as_u8x64(), b.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpgt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpgt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<u8x32, _>(simd_gt(a.as_u8x32(), b.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpgt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpgt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<u8x16, _>(simd_gt(a.as_u8x16(), b.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpgt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpgt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<i16x32, _>(simd_gt(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpgt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpgt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<i16x16, _>(simd_gt(a.as_i16x16(), b.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpgt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpgt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<i16x8, _>(simd_gt(a.as_i16x8(), b.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpgt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpgt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<i8x64, _>(simd_gt(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpgt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpgt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<i8x32, _>(simd_gt(a.as_i8x32(), b.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpgt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpgt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<i8x16, _>(simd_gt(a.as_i8x16(), b.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpgt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmple_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<u16x32, _>(simd_le(a.as_u16x32(), b.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmple_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmple_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<u16x16, _>(simd_le(a.as_u16x16(), b.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmple_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmple_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<u16x8, _>(simd_le(a.as_u16x8(), b.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmple_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmple_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<u8x64, _>(simd_le(a.as_u8x64(), b.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmple_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmple_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<u8x32, _>(simd_le(a.as_u8x32(), b.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmple_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmple_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<u8x16, _>(simd_le(a.as_u8x16(), b.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmple_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmple_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<i16x32, _>(simd_le(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmple_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmple_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<i16x16, _>(simd_le(a.as_i16x16(), b.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmple_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmple_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<i16x8, _>(simd_le(a.as_i16x8(), b.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmple_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmple_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<i8x64, _>(simd_le(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmple_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmple_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<i8x32, _>(simd_le(a.as_i8x32(), b.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmple_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmple_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<i8x16, _>(simd_le(a.as_i8x16(), b.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmple_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpge_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<u16x32, _>(simd_ge(a.as_u16x32(), b.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpge_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpge_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<u16x16, _>(simd_ge(a.as_u16x16(), b.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpge_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpge_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<u16x8, _>(simd_ge(a.as_u16x8(), b.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpge_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpge_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<u8x64, _>(simd_ge(a.as_u8x64(), b.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpge_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpge_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<u8x32, _>(simd_ge(a.as_u8x32(), b.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpge_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpge_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<u8x16, _>(simd_ge(a.as_u8x16(), b.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpge_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpge_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<i16x32, _>(simd_ge(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpge_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpge_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<i16x16, _>(simd_ge(a.as_i16x16(), b.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpge_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpge_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<i16x8, _>(simd_ge(a.as_i16x8(), b.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpge_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpge_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<i8x64, _>(simd_ge(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpge_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpge_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<i8x32, _>(simd_ge(a.as_i8x32(), b.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpge_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpge_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<i8x16, _>(simd_ge(a.as_i8x16(), b.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpge_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpeq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<u16x32, _>(simd_eq(a.as_u16x32(), b.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpeq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpeq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<u16x16, _>(simd_eq(a.as_u16x16(), b.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpeq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpeq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<u16x8, _>(simd_eq(a.as_u16x8(), b.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpeq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpeq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<u8x64, _>(simd_eq(a.as_u8x64(), b.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpeq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpeq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<u8x32, _>(simd_eq(a.as_u8x32(), b.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpeq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpeq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<u8x16, _>(simd_eq(a.as_u8x16(), b.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpeq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpeq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<i16x32, _>(simd_eq(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpeq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpeq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<i16x16, _>(simd_eq(a.as_i16x16(), b.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpeq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpeq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<i16x8, _>(simd_eq(a.as_i16x8(), b.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpeq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpeq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<i8x64, _>(simd_eq(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpeq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpeq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<i8x32, _>(simd_eq(a.as_i8x32(), b.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpeq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpeq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<i8x16, _>(simd_eq(a.as_i8x16(), b.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpeq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpneq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<u16x32, _>(simd_ne(a.as_u16x32(), b.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpneq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpneq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<u16x16, _>(simd_ne(a.as_u16x16(), b.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpneq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpneq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<u16x8, _>(simd_ne(a.as_u16x8(), b.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpneq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpneq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<u8x64, _>(simd_ne(a.as_u8x64(), b.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpneq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpneq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<u8x32, _>(simd_ne(a.as_u8x32(), b.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpneq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpneq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<u8x16, _>(simd_ne(a.as_u8x16(), b.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpneq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpneq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
simd_bitmask::<i16x32, _>(simd_ne(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpneq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
_mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpneq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
simd_bitmask::<i16x16, _>(simd_ne(a.as_i16x16(), b.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpneq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
_mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpneq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
simd_bitmask::<i16x8, _>(simd_ne(a.as_i16x8(), b.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpneq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
_mm_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_cmpneq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
simd_bitmask::<i8x64, _>(simd_ne(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm512_mask_cmpneq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
_mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_cmpneq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
simd_bitmask::<i8x32, _>(simd_ne(a.as_i8x32(), b.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm256_mask_cmpneq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
_mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_cmpneq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
simd_bitmask::<i8x16, _>(simd_ne(a.as_i8x16(), b.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpcmp))]
pub unsafe fn _mm_mask_cmpneq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
_mm_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm512_cmp_epu16_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask32 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u16x32();
let b = b.as_u16x32();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i16x32::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i16x32::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm512_mask_cmp_epu16_mask<const IMM8: i32>(
k1: __mmask32,
a: __m512i,
b: __m512i,
) -> __mmask32 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u16x32();
let b = b.as_u16x32();
let k1 = simd_select_bitmask(k1, i16x32::splat(-1), i16x32::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i16x32::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i16x32::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm256_cmp_epu16_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask16 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u16x16();
let b = b.as_u16x16();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i16x16::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i16x16::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm256_mask_cmp_epu16_mask<const IMM8: i32>(
k1: __mmask16,
a: __m256i,
b: __m256i,
) -> __mmask16 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u16x16();
let b = b.as_u16x16();
let k1 = simd_select_bitmask(k1, i16x16::splat(-1), i16x16::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i16x16::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i16x16::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm_cmp_epu16_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask8 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u16x8();
let b = b.as_u16x8();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i16x8::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i16x8::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm_mask_cmp_epu16_mask<const IMM8: i32>(
k1: __mmask8,
a: __m128i,
b: __m128i,
) -> __mmask8 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u16x8();
let b = b.as_u16x8();
let k1 = simd_select_bitmask(k1, i16x8::splat(-1), i16x8::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i16x8::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i16x8::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm512_cmp_epu8_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask64 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u8x64();
let b = b.as_u8x64();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i8x64::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i8x64::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm512_mask_cmp_epu8_mask<const IMM8: i32>(
k1: __mmask64,
a: __m512i,
b: __m512i,
) -> __mmask64 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u8x64();
let b = b.as_u8x64();
let k1 = simd_select_bitmask(k1, i8x64::splat(-1), i8x64::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i8x64::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i8x64::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm256_cmp_epu8_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask32 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u8x32();
let b = b.as_u8x32();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i8x32::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i8x32::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm256_mask_cmp_epu8_mask<const IMM8: i32>(
k1: __mmask32,
a: __m256i,
b: __m256i,
) -> __mmask32 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u8x32();
let b = b.as_u8x32();
let k1 = simd_select_bitmask(k1, i8x32::splat(-1), i8x32::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i8x32::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i8x32::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm_cmp_epu8_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask16 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u8x16();
let b = b.as_u8x16();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i8x16::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i8x16::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm_mask_cmp_epu8_mask<const IMM8: i32>(
k1: __mmask16,
a: __m128i,
b: __m128i,
) -> __mmask16 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_u8x16();
let b = b.as_u8x16();
let k1 = simd_select_bitmask(k1, i8x16::splat(-1), i8x16::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i8x16::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i8x16::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm512_cmp_epi16_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask32 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i16x32();
let b = b.as_i16x32();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i16x32::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i16x32::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm512_mask_cmp_epi16_mask<const IMM8: i32>(
k1: __mmask32,
a: __m512i,
b: __m512i,
) -> __mmask32 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i16x32();
let b = b.as_i16x32();
let k1 = simd_select_bitmask(k1, i16x32::splat(-1), i16x32::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i16x32::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i16x32::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm256_cmp_epi16_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask16 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i16x16();
let b = b.as_i16x16();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i16x16::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i16x16::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm256_mask_cmp_epi16_mask<const IMM8: i32>(
k1: __mmask16,
a: __m256i,
b: __m256i,
) -> __mmask16 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i16x16();
let b = b.as_i16x16();
let k1 = simd_select_bitmask(k1, i16x16::splat(-1), i16x16::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i16x16::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i16x16::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm_cmp_epi16_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask8 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i16x8();
let b = b.as_i16x8();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i16x8::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i16x8::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm_mask_cmp_epi16_mask<const IMM8: i32>(
k1: __mmask8,
a: __m128i,
b: __m128i,
) -> __mmask8 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i16x8();
let b = b.as_i16x8();
let k1 = simd_select_bitmask(k1, i16x8::splat(-1), i16x8::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i16x8::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i16x8::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm512_cmp_epi8_mask<const IMM8: i32>(a: __m512i, b: __m512i) -> __mmask64 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i8x64();
let b = b.as_i8x64();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i8x64::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i8x64::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm512_mask_cmp_epi8_mask<const IMM8: i32>(
k1: __mmask64,
a: __m512i,
b: __m512i,
) -> __mmask64 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i8x64();
let b = b.as_i8x64();
let k1 = simd_select_bitmask(k1, i8x64::splat(-1), i8x64::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i8x64::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i8x64::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm256_cmp_epi8_mask<const IMM8: i32>(a: __m256i, b: __m256i) -> __mmask32 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i8x32();
let b = b.as_i8x32();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i8x32::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i8x32::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm256_mask_cmp_epi8_mask<const IMM8: i32>(
k1: __mmask32,
a: __m256i,
b: __m256i,
) -> __mmask32 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i8x32();
let b = b.as_i8x32();
let k1 = simd_select_bitmask(k1, i8x32::splat(-1), i8x32::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i8x32::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i8x32::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm_cmp_epi8_mask<const IMM8: i32>(a: __m128i, b: __m128i) -> __mmask16 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i8x16();
let b = b.as_i8x16();
let r = match IMM8 {
0 => simd_eq(a, b),
1 => simd_lt(a, b),
2 => simd_le(a, b),
3 => i8x16::splat(0),
4 => simd_ne(a, b),
5 => simd_ge(a, b),
6 => simd_gt(a, b),
_ => i8x16::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))]
pub unsafe fn _mm_mask_cmp_epi8_mask<const IMM8: i32>(
k1: __mmask16,
a: __m128i,
b: __m128i,
) -> __mmask16 {
static_assert_uimm_bits!(IMM8, 3);
let a = a.as_i8x16();
let b = b.as_i8x16();
let k1 = simd_select_bitmask(k1, i8x16::splat(-1), i8x16::splat(0));
let r = match IMM8 {
0 => simd_and(k1, simd_eq(a, b)),
1 => simd_and(k1, simd_lt(a, b)),
2 => simd_and(k1, simd_le(a, b)),
3 => i8x16::splat(0),
4 => simd_and(k1, simd_ne(a, b)),
5 => simd_and(k1, simd_ge(a, b)),
6 => simd_and(k1, simd_gt(a, b)),
_ => i8x16::splat(-1),
};
simd_bitmask(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_add_epi16(a: __m256i) -> i16 {
simd_reduce_add_unordered(a.as_i16x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_add_epi16(k: __mmask16, a: __m256i) -> i16 {
simd_reduce_add_unordered(simd_select_bitmask(
k,
a.as_i16x16(),
_mm256_setzero_si256().as_i16x16(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_add_epi16(a: __m128i) -> i16 {
simd_reduce_add_unordered(a.as_i16x8())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_add_epi16(k: __mmask8, a: __m128i) -> i16 {
simd_reduce_add_unordered(simd_select_bitmask(
k,
a.as_i16x8(),
_mm_setzero_si128().as_i16x8(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_add_epi8(a: __m256i) -> i8 {
simd_reduce_add_unordered(a.as_i8x32())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_add_epi8(k: __mmask32, a: __m256i) -> i8 {
simd_reduce_add_unordered(simd_select_bitmask(
k,
a.as_i8x32(),
_mm256_setzero_si256().as_i8x32(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_add_epi8(a: __m128i) -> i8 {
simd_reduce_add_unordered(a.as_i8x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_add_epi8(k: __mmask16, a: __m128i) -> i8 {
simd_reduce_add_unordered(simd_select_bitmask(
k,
a.as_i8x16(),
_mm_setzero_si128().as_i8x16(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_and_epi16(a: __m256i) -> i16 {
simd_reduce_and(a.as_i16x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_and_epi16(k: __mmask16, a: __m256i) -> i16 {
simd_reduce_and(simd_select_bitmask(
k,
a.as_i16x16(),
_mm256_set1_epi64x(-1).as_i16x16(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_and_epi16(a: __m128i) -> i16 {
simd_reduce_and(a.as_i16x8())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_and_epi16(k: __mmask8, a: __m128i) -> i16 {
simd_reduce_and(simd_select_bitmask(
k,
a.as_i16x8(),
_mm_set1_epi64x(-1).as_i16x8(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_and_epi8(a: __m256i) -> i8 {
simd_reduce_and(a.as_i8x32())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_and_epi8(k: __mmask32, a: __m256i) -> i8 {
simd_reduce_and(simd_select_bitmask(
k,
a.as_i8x32(),
_mm256_set1_epi64x(-1).as_i8x32(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_and_epi8(a: __m128i) -> i8 {
simd_reduce_and(a.as_i8x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_and_epi8(k: __mmask16, a: __m128i) -> i8 {
simd_reduce_and(simd_select_bitmask(
k,
a.as_i8x16(),
_mm_set1_epi64x(-1).as_i8x16(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_max_epi16(a: __m256i) -> i16 {
simd_reduce_max(a.as_i16x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_max_epi16(k: __mmask16, a: __m256i) -> i16 {
simd_reduce_max(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(-32768)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_max_epi16(a: __m128i) -> i16 {
simd_reduce_max(a.as_i16x8())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_max_epi16(k: __mmask8, a: __m128i) -> i16 {
simd_reduce_max(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(-32768)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_max_epi8(a: __m256i) -> i8 {
simd_reduce_max(a.as_i8x32())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_max_epi8(k: __mmask32, a: __m256i) -> i8 {
simd_reduce_max(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(-128)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_max_epi8(a: __m128i) -> i8 {
simd_reduce_max(a.as_i8x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_max_epi8(k: __mmask16, a: __m128i) -> i8 {
simd_reduce_max(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(-128)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_max_epu16(a: __m256i) -> u16 {
simd_reduce_max(a.as_u16x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_max_epu16(k: __mmask16, a: __m256i) -> u16 {
simd_reduce_max(simd_select_bitmask(k, a.as_u16x16(), u16x16::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_max_epu16(a: __m128i) -> u16 {
simd_reduce_max(a.as_u16x8())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_max_epu16(k: __mmask8, a: __m128i) -> u16 {
simd_reduce_max(simd_select_bitmask(k, a.as_u16x8(), u16x8::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_max_epu8(a: __m256i) -> u8 {
simd_reduce_max(a.as_u8x32())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_max_epu8(k: __mmask32, a: __m256i) -> u8 {
simd_reduce_max(simd_select_bitmask(k, a.as_u8x32(), u8x32::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_max_epu8(a: __m128i) -> u8 {
simd_reduce_max(a.as_u8x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_max_epu8(k: __mmask16, a: __m128i) -> u8 {
simd_reduce_max(simd_select_bitmask(k, a.as_u8x16(), u8x16::splat(0)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_min_epi16(a: __m256i) -> i16 {
simd_reduce_min(a.as_i16x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_min_epi16(k: __mmask16, a: __m256i) -> i16 {
simd_reduce_min(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(0x7fff)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_min_epi16(a: __m128i) -> i16 {
simd_reduce_min(a.as_i16x8())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_min_epi16(k: __mmask8, a: __m128i) -> i16 {
simd_reduce_min(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(0x7fff)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_min_epi8(a: __m256i) -> i8 {
simd_reduce_min(a.as_i8x32())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_min_epi8(k: __mmask32, a: __m256i) -> i8 {
simd_reduce_min(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(0x7f)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_min_epi8(a: __m128i) -> i8 {
simd_reduce_min(a.as_i8x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_min_epi8(k: __mmask16, a: __m128i) -> i8 {
simd_reduce_min(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(0x7f)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_min_epu16(a: __m256i) -> u16 {
simd_reduce_min(a.as_u16x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_min_epu16(k: __mmask16, a: __m256i) -> u16 {
simd_reduce_min(simd_select_bitmask(k, a.as_u16x16(), u16x16::splat(0xffff)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_min_epu16(a: __m128i) -> u16 {
simd_reduce_min(a.as_u16x8())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_min_epu16(k: __mmask8, a: __m128i) -> u16 {
simd_reduce_min(simd_select_bitmask(k, a.as_u16x8(), u16x8::splat(0xffff)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_min_epu8(a: __m256i) -> u8 {
simd_reduce_min(a.as_u8x32())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_min_epu8(k: __mmask32, a: __m256i) -> u8 {
simd_reduce_min(simd_select_bitmask(k, a.as_u8x32(), u8x32::splat(0xff)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_min_epu8(a: __m128i) -> u8 {
simd_reduce_min(a.as_u8x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_min_epu8(k: __mmask16, a: __m128i) -> u8 {
simd_reduce_min(simd_select_bitmask(k, a.as_u8x16(), u8x16::splat(0xff)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_mul_epi16(a: __m256i) -> i16 {
simd_reduce_mul_unordered(a.as_i16x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_mul_epi16(k: __mmask16, a: __m256i) -> i16 {
simd_reduce_mul_unordered(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(1)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_mul_epi16(a: __m128i) -> i16 {
simd_reduce_mul_unordered(a.as_i16x8())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_mul_epi16(k: __mmask8, a: __m128i) -> i16 {
simd_reduce_mul_unordered(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(1)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_mul_epi8(a: __m256i) -> i8 {
simd_reduce_mul_unordered(a.as_i8x32())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_mul_epi8(k: __mmask32, a: __m256i) -> i8 {
simd_reduce_mul_unordered(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(1)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_mul_epi8(a: __m128i) -> i8 {
simd_reduce_mul_unordered(a.as_i8x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_mul_epi8(k: __mmask16, a: __m128i) -> i8 {
simd_reduce_mul_unordered(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(1)))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_or_epi16(a: __m256i) -> i16 {
simd_reduce_or(a.as_i16x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_or_epi16(k: __mmask16, a: __m256i) -> i16 {
simd_reduce_or(simd_select_bitmask(
k,
a.as_i16x16(),
_mm256_setzero_si256().as_i16x16(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_or_epi16(a: __m128i) -> i16 {
simd_reduce_or(a.as_i16x8())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_or_epi16(k: __mmask8, a: __m128i) -> i16 {
simd_reduce_or(simd_select_bitmask(
k,
a.as_i16x8(),
_mm_setzero_si128().as_i16x8(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_reduce_or_epi8(a: __m256i) -> i8 {
simd_reduce_or(a.as_i8x32())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_reduce_or_epi8(k: __mmask32, a: __m256i) -> i8 {
simd_reduce_or(simd_select_bitmask(
k,
a.as_i8x32(),
_mm256_setzero_si256().as_i8x32(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_reduce_or_epi8(a: __m128i) -> i8 {
simd_reduce_or(a.as_i8x16())
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_reduce_or_epi8(k: __mmask16, a: __m128i) -> i8 {
simd_reduce_or(simd_select_bitmask(
k,
a.as_i8x16(),
_mm_setzero_si128().as_i8x16(),
))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm512_loadu_epi16(mem_addr: *const i16) -> __m512i {
ptr::read_unaligned(mem_addr as *const __m512i)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm256_loadu_epi16(mem_addr: *const i16) -> __m256i {
ptr::read_unaligned(mem_addr as *const __m256i)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm_loadu_epi16(mem_addr: *const i16) -> __m128i {
ptr::read_unaligned(mem_addr as *const __m128i)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm512_loadu_epi8(mem_addr: *const i8) -> __m512i {
ptr::read_unaligned(mem_addr as *const __m512i)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm256_loadu_epi8(mem_addr: *const i8) -> __m256i {
ptr::read_unaligned(mem_addr as *const __m256i)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm_loadu_epi8(mem_addr: *const i8) -> __m128i {
ptr::read_unaligned(mem_addr as *const __m128i)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm512_storeu_epi16(mem_addr: *mut i16, a: __m512i) {
ptr::write_unaligned(mem_addr as *mut __m512i, a);
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm256_storeu_epi16(mem_addr: *mut i16, a: __m256i) {
ptr::write_unaligned(mem_addr as *mut __m256i, a);
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm_storeu_epi16(mem_addr: *mut i16, a: __m128i) {
ptr::write_unaligned(mem_addr as *mut __m128i, a);
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm512_storeu_epi8(mem_addr: *mut i8, a: __m512i) {
ptr::write_unaligned(mem_addr as *mut __m512i, a);
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm256_storeu_epi8(mem_addr: *mut i8, a: __m256i) {
ptr::write_unaligned(mem_addr as *mut __m256i, a);
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovups))] pub unsafe fn _mm_storeu_epi8(mem_addr: *mut i8, a: __m128i) {
ptr::write_unaligned(mem_addr as *mut __m128i, a);
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm512_mask_loadu_epi16(src: __m512i, k: __mmask32, mem_addr: *const i16) -> __m512i {
transmute(loaddqu16_512(mem_addr, src.as_i16x32(), k))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm512_maskz_loadu_epi16(k: __mmask32, mem_addr: *const i16) -> __m512i {
_mm512_mask_loadu_epi16(_mm512_setzero_si512(), k, mem_addr)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm512_mask_loadu_epi8(src: __m512i, k: __mmask64, mem_addr: *const i8) -> __m512i {
transmute(loaddqu8_512(mem_addr, src.as_i8x64(), k))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm512_maskz_loadu_epi8(k: __mmask64, mem_addr: *const i8) -> __m512i {
_mm512_mask_loadu_epi8(_mm512_setzero_si512(), k, mem_addr)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_loadu_epi16(src: __m256i, k: __mmask16, mem_addr: *const i16) -> __m256i {
transmute(loaddqu16_256(mem_addr, src.as_i16x16(), k))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_maskz_loadu_epi16(k: __mmask16, mem_addr: *const i16) -> __m256i {
_mm256_mask_loadu_epi16(_mm256_setzero_si256(), k, mem_addr)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_loadu_epi8(src: __m256i, k: __mmask32, mem_addr: *const i8) -> __m256i {
transmute(loaddqu8_256(mem_addr, src.as_i8x32(), k))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_maskz_loadu_epi8(k: __mmask32, mem_addr: *const i8) -> __m256i {
_mm256_mask_loadu_epi8(_mm256_setzero_si256(), k, mem_addr)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_loadu_epi16(src: __m128i, k: __mmask8, mem_addr: *const i16) -> __m128i {
transmute(loaddqu16_128(mem_addr, src.as_i16x8(), k))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_maskz_loadu_epi16(k: __mmask8, mem_addr: *const i16) -> __m128i {
_mm_mask_loadu_epi16(_mm_setzero_si128(), k, mem_addr)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_loadu_epi8(src: __m128i, k: __mmask16, mem_addr: *const i8) -> __m128i {
transmute(loaddqu8_128(mem_addr, src.as_i8x16(), k))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_maskz_loadu_epi8(k: __mmask16, mem_addr: *const i8) -> __m128i {
_mm_mask_loadu_epi8(_mm_setzero_si128(), k, mem_addr)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm512_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask32, a: __m512i) {
storedqu16_512(mem_addr, a.as_i16x32(), mask)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm512_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask64, a: __m512i) {
storedqu8_512(mem_addr, a.as_i8x64(), mask)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask16, a: __m256i) {
storedqu16_256(mem_addr, a.as_i16x16(), mask)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm256_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask32, a: __m256i) {
storedqu8_256(mem_addr, a.as_i8x32(), mask)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask8, a: __m128i) {
storedqu16_128(mem_addr, a.as_i16x8(), mask)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _mm_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask16, a: __m128i) {
storedqu8_128(mem_addr, a.as_i8x16(), mask)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddwd))]
pub unsafe fn _mm512_madd_epi16(a: __m512i, b: __m512i) -> __m512i {
transmute(vpmaddwd(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddwd))]
pub unsafe fn _mm512_mask_madd_epi16(
src: __m512i,
k: __mmask16,
a: __m512i,
b: __m512i,
) -> __m512i {
let madd = _mm512_madd_epi16(a, b).as_i32x16();
transmute(simd_select_bitmask(k, madd, src.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddwd))]
pub unsafe fn _mm512_maskz_madd_epi16(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
let madd = _mm512_madd_epi16(a, b).as_i32x16();
let zero = _mm512_setzero_si512().as_i32x16();
transmute(simd_select_bitmask(k, madd, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddwd))]
pub unsafe fn _mm256_mask_madd_epi16(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
let madd = _mm256_madd_epi16(a, b).as_i32x8();
transmute(simd_select_bitmask(k, madd, src.as_i32x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddwd))]
pub unsafe fn _mm256_maskz_madd_epi16(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
let madd = _mm256_madd_epi16(a, b).as_i32x8();
let zero = _mm256_setzero_si256().as_i32x8();
transmute(simd_select_bitmask(k, madd, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddwd))]
pub unsafe fn _mm_mask_madd_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let madd = _mm_madd_epi16(a, b).as_i32x4();
transmute(simd_select_bitmask(k, madd, src.as_i32x4()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddwd))]
pub unsafe fn _mm_maskz_madd_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let madd = _mm_madd_epi16(a, b).as_i32x4();
let zero = _mm_setzero_si128().as_i32x4();
transmute(simd_select_bitmask(k, madd, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddubsw))]
pub unsafe fn _mm512_maddubs_epi16(a: __m512i, b: __m512i) -> __m512i {
transmute(vpmaddubsw(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddubsw))]
pub unsafe fn _mm512_mask_maddubs_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let madd = _mm512_maddubs_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, madd, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddubsw))]
pub unsafe fn _mm512_maskz_maddubs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let madd = _mm512_maddubs_epi16(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, madd, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddubsw))]
pub unsafe fn _mm256_mask_maddubs_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let madd = _mm256_maddubs_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, madd, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddubsw))]
pub unsafe fn _mm256_maskz_maddubs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let madd = _mm256_maddubs_epi16(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, madd, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddubsw))]
pub unsafe fn _mm_mask_maddubs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let madd = _mm_maddubs_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, madd, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmaddubsw))]
pub unsafe fn _mm_maskz_maddubs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let madd = _mm_maddubs_epi16(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, madd, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackssdw))]
pub unsafe fn _mm512_packs_epi32(a: __m512i, b: __m512i) -> __m512i {
transmute(vpackssdw(a.as_i32x16(), b.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackssdw))]
pub unsafe fn _mm512_mask_packs_epi32(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let pack = _mm512_packs_epi32(a, b).as_i16x32();
transmute(simd_select_bitmask(k, pack, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackssdw))]
pub unsafe fn _mm512_maskz_packs_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let pack = _mm512_packs_epi32(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackssdw))]
pub unsafe fn _mm256_mask_packs_epi32(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let pack = _mm256_packs_epi32(a, b).as_i16x16();
transmute(simd_select_bitmask(k, pack, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackssdw))]
pub unsafe fn _mm256_maskz_packs_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let pack = _mm256_packs_epi32(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackssdw))]
pub unsafe fn _mm_mask_packs_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let pack = _mm_packs_epi32(a, b).as_i16x8();
transmute(simd_select_bitmask(k, pack, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackssdw))]
pub unsafe fn _mm_maskz_packs_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let pack = _mm_packs_epi32(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpacksswb))]
pub unsafe fn _mm512_packs_epi16(a: __m512i, b: __m512i) -> __m512i {
transmute(vpacksswb(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpacksswb))]
pub unsafe fn _mm512_mask_packs_epi16(
src: __m512i,
k: __mmask64,
a: __m512i,
b: __m512i,
) -> __m512i {
let pack = _mm512_packs_epi16(a, b).as_i8x64();
transmute(simd_select_bitmask(k, pack, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpacksswb))]
pub unsafe fn _mm512_maskz_packs_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let pack = _mm512_packs_epi16(a, b).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpacksswb))]
pub unsafe fn _mm256_mask_packs_epi16(
src: __m256i,
k: __mmask32,
a: __m256i,
b: __m256i,
) -> __m256i {
let pack = _mm256_packs_epi16(a, b).as_i8x32();
transmute(simd_select_bitmask(k, pack, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpacksswb))]
pub unsafe fn _mm256_maskz_packs_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let pack = _mm256_packs_epi16(a, b).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpacksswb))]
pub unsafe fn _mm_mask_packs_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let pack = _mm_packs_epi16(a, b).as_i8x16();
transmute(simd_select_bitmask(k, pack, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpacksswb))]
pub unsafe fn _mm_maskz_packs_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let pack = _mm_packs_epi16(a, b).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackusdw))]
pub unsafe fn _mm512_packus_epi32(a: __m512i, b: __m512i) -> __m512i {
transmute(vpackusdw(a.as_i32x16(), b.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackusdw))]
pub unsafe fn _mm512_mask_packus_epi32(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let pack = _mm512_packus_epi32(a, b).as_i16x32();
transmute(simd_select_bitmask(k, pack, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackusdw))]
pub unsafe fn _mm512_maskz_packus_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let pack = _mm512_packus_epi32(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackusdw))]
pub unsafe fn _mm256_mask_packus_epi32(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let pack = _mm256_packus_epi32(a, b).as_i16x16();
transmute(simd_select_bitmask(k, pack, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackusdw))]
pub unsafe fn _mm256_maskz_packus_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let pack = _mm256_packus_epi32(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackusdw))]
pub unsafe fn _mm_mask_packus_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let pack = _mm_packus_epi32(a, b).as_i16x8();
transmute(simd_select_bitmask(k, pack, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackusdw))]
pub unsafe fn _mm_maskz_packus_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let pack = _mm_packus_epi32(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackuswb))]
pub unsafe fn _mm512_packus_epi16(a: __m512i, b: __m512i) -> __m512i {
transmute(vpackuswb(a.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackuswb))]
pub unsafe fn _mm512_mask_packus_epi16(
src: __m512i,
k: __mmask64,
a: __m512i,
b: __m512i,
) -> __m512i {
let pack = _mm512_packus_epi16(a, b).as_i8x64();
transmute(simd_select_bitmask(k, pack, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackuswb))]
pub unsafe fn _mm512_maskz_packus_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let pack = _mm512_packus_epi16(a, b).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackuswb))]
pub unsafe fn _mm256_mask_packus_epi16(
src: __m256i,
k: __mmask32,
a: __m256i,
b: __m256i,
) -> __m256i {
let pack = _mm256_packus_epi16(a, b).as_i8x32();
transmute(simd_select_bitmask(k, pack, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackuswb))]
pub unsafe fn _mm256_maskz_packus_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let pack = _mm256_packus_epi16(a, b).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackuswb))]
pub unsafe fn _mm_mask_packus_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let pack = _mm_packus_epi16(a, b).as_i8x16();
transmute(simd_select_bitmask(k, pack, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpackuswb))]
pub unsafe fn _mm_maskz_packus_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let pack = _mm_packus_epi16(a, b).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, pack, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgw))]
pub unsafe fn _mm512_avg_epu16(a: __m512i, b: __m512i) -> __m512i {
let a = simd_cast::<_, u32x32>(a.as_u16x32());
let b = simd_cast::<_, u32x32>(b.as_u16x32());
let r = simd_shr(simd_add(simd_add(a, b), u32x32::splat(1)), u32x32::splat(1));
transmute(simd_cast::<_, u16x32>(r))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgw))]
pub unsafe fn _mm512_mask_avg_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let avg = _mm512_avg_epu16(a, b).as_u16x32();
transmute(simd_select_bitmask(k, avg, src.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgw))]
pub unsafe fn _mm512_maskz_avg_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let avg = _mm512_avg_epu16(a, b).as_u16x32();
let zero = _mm512_setzero_si512().as_u16x32();
transmute(simd_select_bitmask(k, avg, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgw))]
pub unsafe fn _mm256_mask_avg_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let avg = _mm256_avg_epu16(a, b).as_u16x16();
transmute(simd_select_bitmask(k, avg, src.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgw))]
pub unsafe fn _mm256_maskz_avg_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let avg = _mm256_avg_epu16(a, b).as_u16x16();
let zero = _mm256_setzero_si256().as_u16x16();
transmute(simd_select_bitmask(k, avg, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgw))]
pub unsafe fn _mm_mask_avg_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let avg = _mm_avg_epu16(a, b).as_u16x8();
transmute(simd_select_bitmask(k, avg, src.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgw))]
pub unsafe fn _mm_maskz_avg_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let avg = _mm_avg_epu16(a, b).as_u16x8();
let zero = _mm_setzero_si128().as_u16x8();
transmute(simd_select_bitmask(k, avg, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgb))]
pub unsafe fn _mm512_avg_epu8(a: __m512i, b: __m512i) -> __m512i {
let a = simd_cast::<_, u16x64>(a.as_u8x64());
let b = simd_cast::<_, u16x64>(b.as_u8x64());
let r = simd_shr(simd_add(simd_add(a, b), u16x64::splat(1)), u16x64::splat(1));
transmute(simd_cast::<_, u8x64>(r))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgb))]
pub unsafe fn _mm512_mask_avg_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let avg = _mm512_avg_epu8(a, b).as_u8x64();
transmute(simd_select_bitmask(k, avg, src.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgb))]
pub unsafe fn _mm512_maskz_avg_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let avg = _mm512_avg_epu8(a, b).as_u8x64();
let zero = _mm512_setzero_si512().as_u8x64();
transmute(simd_select_bitmask(k, avg, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgb))]
pub unsafe fn _mm256_mask_avg_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let avg = _mm256_avg_epu8(a, b).as_u8x32();
transmute(simd_select_bitmask(k, avg, src.as_u8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgb))]
pub unsafe fn _mm256_maskz_avg_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let avg = _mm256_avg_epu8(a, b).as_u8x32();
let zero = _mm256_setzero_si256().as_u8x32();
transmute(simd_select_bitmask(k, avg, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgb))]
pub unsafe fn _mm_mask_avg_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let avg = _mm_avg_epu8(a, b).as_u8x16();
transmute(simd_select_bitmask(k, avg, src.as_u8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpavgb))]
pub unsafe fn _mm_maskz_avg_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let avg = _mm_avg_epu8(a, b).as_u8x16();
let zero = _mm_setzero_si128().as_u8x16();
transmute(simd_select_bitmask(k, avg, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw))]
pub unsafe fn _mm512_sll_epi16(a: __m512i, count: __m128i) -> __m512i {
transmute(vpsllw(a.as_i16x32(), count.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw))]
pub unsafe fn _mm512_mask_sll_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
count: __m128i,
) -> __m512i {
let shf = _mm512_sll_epi16(a, count).as_i16x32();
transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw))]
pub unsafe fn _mm512_maskz_sll_epi16(k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
let shf = _mm512_sll_epi16(a, count).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw))]
pub unsafe fn _mm256_mask_sll_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
count: __m128i,
) -> __m256i {
let shf = _mm256_sll_epi16(a, count).as_i16x16();
transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw))]
pub unsafe fn _mm256_maskz_sll_epi16(k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
let shf = _mm256_sll_epi16(a, count).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw))]
pub unsafe fn _mm_mask_sll_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
let shf = _mm_sll_epi16(a, count).as_i16x8();
transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw))]
pub unsafe fn _mm_maskz_sll_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
let shf = _mm_sll_epi16(a, count).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
#[rustc_legacy_const_generics(1)]
pub unsafe fn _mm512_slli_epi16<const IMM8: u32>(a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
if IMM8 >= 16 {
_mm512_setzero_si512()
} else {
transmute(simd_shl(a.as_u16x32(), u16x32::splat(IMM8 as u16)))
}
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm512_mask_slli_epi16<const IMM8: u32>(
src: __m512i,
k: __mmask32,
a: __m512i,
) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let shf = if IMM8 >= 16 {
u16x32::splat(0)
} else {
simd_shl(a.as_u16x32(), u16x32::splat(IMM8 as u16))
};
transmute(simd_select_bitmask(k, shf, src.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm512_maskz_slli_epi16<const IMM8: u32>(k: __mmask32, a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
if IMM8 >= 16 {
_mm512_setzero_si512()
} else {
let shf = simd_shl(a.as_u16x32(), u16x32::splat(IMM8 as u16));
let zero = u16x32::splat(0);
transmute(simd_select_bitmask(k, shf, zero))
}
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm256_mask_slli_epi16<const IMM8: u32>(
src: __m256i,
k: __mmask16,
a: __m256i,
) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let shf = if IMM8 >= 16 {
u16x16::splat(0)
} else {
simd_shl(a.as_u16x16(), u16x16::splat(IMM8 as u16))
};
transmute(simd_select_bitmask(k, shf, src.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm256_maskz_slli_epi16<const IMM8: u32>(k: __mmask16, a: __m256i) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
if IMM8 >= 16 {
_mm256_setzero_si256()
} else {
let shf = simd_shl(a.as_u16x16(), u16x16::splat(IMM8 as u16));
let zero = u16x16::splat(0);
transmute(simd_select_bitmask(k, shf, zero))
}
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm_mask_slli_epi16<const IMM8: u32>(
src: __m128i,
k: __mmask8,
a: __m128i,
) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let shf = if IMM8 >= 16 {
u16x8::splat(0)
} else {
simd_shl(a.as_u16x8(), u16x8::splat(IMM8 as u16))
};
transmute(simd_select_bitmask(k, shf, src.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm_maskz_slli_epi16<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
if IMM8 >= 16 {
_mm_setzero_si128()
} else {
let shf = simd_shl(a.as_u16x8(), u16x8::splat(IMM8 as u16));
let zero = u16x8::splat(0);
transmute(simd_select_bitmask(k, shf, zero))
}
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllvw))]
pub unsafe fn _mm512_sllv_epi16(a: __m512i, count: __m512i) -> __m512i {
transmute(vpsllvw(a.as_i16x32(), count.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllvw))]
pub unsafe fn _mm512_mask_sllv_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
count: __m512i,
) -> __m512i {
let shf = _mm512_sllv_epi16(a, count).as_i16x32();
transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllvw))]
pub unsafe fn _mm512_maskz_sllv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
let shf = _mm512_sllv_epi16(a, count).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllvw))]
pub unsafe fn _mm256_sllv_epi16(a: __m256i, count: __m256i) -> __m256i {
transmute(vpsllvw256(a.as_i16x16(), count.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllvw))]
pub unsafe fn _mm256_mask_sllv_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
count: __m256i,
) -> __m256i {
let shf = _mm256_sllv_epi16(a, count).as_i16x16();
transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllvw))]
pub unsafe fn _mm256_maskz_sllv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
let shf = _mm256_sllv_epi16(a, count).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllvw))]
pub unsafe fn _mm_sllv_epi16(a: __m128i, count: __m128i) -> __m128i {
transmute(vpsllvw128(a.as_i16x8(), count.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllvw))]
pub unsafe fn _mm_mask_sllv_epi16(
src: __m128i,
k: __mmask8,
a: __m128i,
count: __m128i,
) -> __m128i {
let shf = _mm_sllv_epi16(a, count).as_i16x8();
transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsllvw))]
pub unsafe fn _mm_maskz_sllv_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
let shf = _mm_sllv_epi16(a, count).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw))]
pub unsafe fn _mm512_srl_epi16(a: __m512i, count: __m128i) -> __m512i {
transmute(vpsrlw(a.as_i16x32(), count.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw))]
pub unsafe fn _mm512_mask_srl_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
count: __m128i,
) -> __m512i {
let shf = _mm512_srl_epi16(a, count).as_i16x32();
transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw))]
pub unsafe fn _mm512_maskz_srl_epi16(k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
let shf = _mm512_srl_epi16(a, count).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw))]
pub unsafe fn _mm256_mask_srl_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
count: __m128i,
) -> __m256i {
let shf = _mm256_srl_epi16(a, count).as_i16x16();
transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw))]
pub unsafe fn _mm256_maskz_srl_epi16(k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
let shf = _mm256_srl_epi16(a, count).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw))]
pub unsafe fn _mm_mask_srl_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
let shf = _mm_srl_epi16(a, count).as_i16x8();
transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw))]
pub unsafe fn _mm_maskz_srl_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
let shf = _mm_srl_epi16(a, count).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
#[rustc_legacy_const_generics(1)]
pub unsafe fn _mm512_srli_epi16<const IMM8: u32>(a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
if IMM8 >= 16 {
_mm512_setzero_si512()
} else {
transmute(simd_shr(a.as_u16x32(), u16x32::splat(IMM8 as u16)))
}
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm512_mask_srli_epi16<const IMM8: u32>(
src: __m512i,
k: __mmask32,
a: __m512i,
) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let shf = if IMM8 >= 16 {
u16x32::splat(0)
} else {
simd_shr(a.as_u16x32(), u16x32::splat(IMM8 as u16))
};
transmute(simd_select_bitmask(k, shf, src.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm512_maskz_srli_epi16<const IMM8: i32>(k: __mmask32, a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
if IMM8 >= 16 {
_mm512_setzero_si512()
} else {
let shf = simd_shr(a.as_u16x32(), u16x32::splat(IMM8 as u16));
let zero = u16x32::splat(0);
transmute(simd_select_bitmask(k, shf, zero))
}
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm256_mask_srli_epi16<const IMM8: i32>(
src: __m256i,
k: __mmask16,
a: __m256i,
) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let shf = _mm256_srli_epi16::<IMM8>(a);
transmute(simd_select_bitmask(k, shf.as_i16x16(), src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm256_maskz_srli_epi16<const IMM8: i32>(k: __mmask16, a: __m256i) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let shf = _mm256_srli_epi16::<IMM8>(a);
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, shf.as_i16x16(), zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm_mask_srli_epi16<const IMM8: i32>(
src: __m128i,
k: __mmask8,
a: __m128i,
) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let shf = _mm_srli_epi16::<IMM8>(a);
transmute(simd_select_bitmask(k, shf.as_i16x8(), src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm_maskz_srli_epi16<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let shf = _mm_srli_epi16::<IMM8>(a);
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, shf.as_i16x8(), zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlvw))]
pub unsafe fn _mm512_srlv_epi16(a: __m512i, count: __m512i) -> __m512i {
transmute(vpsrlvw(a.as_i16x32(), count.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlvw))]
pub unsafe fn _mm512_mask_srlv_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
count: __m512i,
) -> __m512i {
let shf = _mm512_srlv_epi16(a, count).as_i16x32();
transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlvw))]
pub unsafe fn _mm512_maskz_srlv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
let shf = _mm512_srlv_epi16(a, count).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlvw))]
pub unsafe fn _mm256_srlv_epi16(a: __m256i, count: __m256i) -> __m256i {
transmute(vpsrlvw256(a.as_i16x16(), count.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlvw))]
pub unsafe fn _mm256_mask_srlv_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
count: __m256i,
) -> __m256i {
let shf = _mm256_srlv_epi16(a, count).as_i16x16();
transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlvw))]
pub unsafe fn _mm256_maskz_srlv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
let shf = _mm256_srlv_epi16(a, count).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlvw))]
pub unsafe fn _mm_srlv_epi16(a: __m128i, count: __m128i) -> __m128i {
transmute(vpsrlvw128(a.as_i16x8(), count.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlvw))]
pub unsafe fn _mm_mask_srlv_epi16(
src: __m128i,
k: __mmask8,
a: __m128i,
count: __m128i,
) -> __m128i {
let shf = _mm_srlv_epi16(a, count).as_i16x8();
transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrlvw))]
pub unsafe fn _mm_maskz_srlv_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
let shf = _mm_srlv_epi16(a, count).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw))]
pub unsafe fn _mm512_sra_epi16(a: __m512i, count: __m128i) -> __m512i {
transmute(vpsraw(a.as_i16x32(), count.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw))]
pub unsafe fn _mm512_mask_sra_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
count: __m128i,
) -> __m512i {
let shf = _mm512_sra_epi16(a, count).as_i16x32();
transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw))]
pub unsafe fn _mm512_maskz_sra_epi16(k: __mmask32, a: __m512i, count: __m128i) -> __m512i {
let shf = _mm512_sra_epi16(a, count).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw))]
pub unsafe fn _mm256_mask_sra_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
count: __m128i,
) -> __m256i {
let shf = _mm256_sra_epi16(a, count).as_i16x16();
transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw))]
pub unsafe fn _mm256_maskz_sra_epi16(k: __mmask16, a: __m256i, count: __m128i) -> __m256i {
let shf = _mm256_sra_epi16(a, count).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw))]
pub unsafe fn _mm_mask_sra_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
let shf = _mm_sra_epi16(a, count).as_i16x8();
transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw))]
pub unsafe fn _mm_maskz_sra_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
let shf = _mm_sra_epi16(a, count).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
#[rustc_legacy_const_generics(1)]
pub unsafe fn _mm512_srai_epi16<const IMM8: u32>(a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
transmute(simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16)))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm512_mask_srai_epi16<const IMM8: u32>(
src: __m512i,
k: __mmask32,
a: __m512i,
) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let shf = simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16));
transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm512_maskz_srai_epi16<const IMM8: u32>(k: __mmask32, a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let shf = simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16));
let zero = i16x32::splat(0);
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm256_mask_srai_epi16<const IMM8: u32>(
src: __m256i,
k: __mmask16,
a: __m256i,
) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let r = simd_shr(a.as_i16x16(), i16x16::splat(IMM8.min(15) as i16));
transmute(simd_select_bitmask(k, r, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm256_maskz_srai_epi16<const IMM8: u32>(k: __mmask16, a: __m256i) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let r = simd_shr(a.as_i16x16(), i16x16::splat(IMM8.min(15) as i16));
let zero = i16x16::splat(0);
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm_mask_srai_epi16<const IMM8: u32>(
src: __m128i,
k: __mmask8,
a: __m128i,
) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let r = simd_shr(a.as_i16x8(), i16x8::splat(IMM8.min(15) as i16));
transmute(simd_select_bitmask(k, r, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm_maskz_srai_epi16<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let r = simd_shr(a.as_i16x8(), i16x8::splat(IMM8.min(15) as i16));
let zero = i16x8::splat(0);
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsravw))]
pub unsafe fn _mm512_srav_epi16(a: __m512i, count: __m512i) -> __m512i {
transmute(vpsravw(a.as_i16x32(), count.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsravw))]
pub unsafe fn _mm512_mask_srav_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
count: __m512i,
) -> __m512i {
let shf = _mm512_srav_epi16(a, count).as_i16x32();
transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsravw))]
pub unsafe fn _mm512_maskz_srav_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i {
let shf = _mm512_srav_epi16(a, count).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsravw))]
pub unsafe fn _mm256_srav_epi16(a: __m256i, count: __m256i) -> __m256i {
transmute(vpsravw256(a.as_i16x16(), count.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsravw))]
pub unsafe fn _mm256_mask_srav_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
count: __m256i,
) -> __m256i {
let shf = _mm256_srav_epi16(a, count).as_i16x16();
transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsravw))]
pub unsafe fn _mm256_maskz_srav_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i {
let shf = _mm256_srav_epi16(a, count).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsravw))]
pub unsafe fn _mm_srav_epi16(a: __m128i, count: __m128i) -> __m128i {
transmute(vpsravw128(a.as_i16x8(), count.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsravw))]
pub unsafe fn _mm_mask_srav_epi16(
src: __m128i,
k: __mmask8,
a: __m128i,
count: __m128i,
) -> __m128i {
let shf = _mm_srav_epi16(a, count).as_i16x8();
transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsravw))]
pub unsafe fn _mm_maskz_srav_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
let shf = _mm_srav_epi16(a, count).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, shf, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vperm))] pub unsafe fn _mm512_permutex2var_epi16(a: __m512i, idx: __m512i, b: __m512i) -> __m512i {
transmute(vpermi2w(a.as_i16x32(), idx.as_i16x32(), b.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermt2w))]
pub unsafe fn _mm512_mask_permutex2var_epi16(
a: __m512i,
k: __mmask32,
idx: __m512i,
b: __m512i,
) -> __m512i {
let permute = _mm512_permutex2var_epi16(a, idx, b).as_i16x32();
transmute(simd_select_bitmask(k, permute, a.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vperm))] pub unsafe fn _mm512_maskz_permutex2var_epi16(
k: __mmask32,
a: __m512i,
idx: __m512i,
b: __m512i,
) -> __m512i {
let permute = _mm512_permutex2var_epi16(a, idx, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, permute, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermi2w))]
pub unsafe fn _mm512_mask2_permutex2var_epi16(
a: __m512i,
idx: __m512i,
k: __mmask32,
b: __m512i,
) -> __m512i {
let permute = _mm512_permutex2var_epi16(a, idx, b).as_i16x32();
transmute(simd_select_bitmask(k, permute, idx.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vperm))] pub unsafe fn _mm256_permutex2var_epi16(a: __m256i, idx: __m256i, b: __m256i) -> __m256i {
transmute(vpermi2w256(a.as_i16x16(), idx.as_i16x16(), b.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermt2w))]
pub unsafe fn _mm256_mask_permutex2var_epi16(
a: __m256i,
k: __mmask16,
idx: __m256i,
b: __m256i,
) -> __m256i {
let permute = _mm256_permutex2var_epi16(a, idx, b).as_i16x16();
transmute(simd_select_bitmask(k, permute, a.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vperm))] pub unsafe fn _mm256_maskz_permutex2var_epi16(
k: __mmask16,
a: __m256i,
idx: __m256i,
b: __m256i,
) -> __m256i {
let permute = _mm256_permutex2var_epi16(a, idx, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, permute, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermi2w))]
pub unsafe fn _mm256_mask2_permutex2var_epi16(
a: __m256i,
idx: __m256i,
k: __mmask16,
b: __m256i,
) -> __m256i {
let permute = _mm256_permutex2var_epi16(a, idx, b).as_i16x16();
transmute(simd_select_bitmask(k, permute, idx.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vperm))] pub unsafe fn _mm_permutex2var_epi16(a: __m128i, idx: __m128i, b: __m128i) -> __m128i {
transmute(vpermi2w128(a.as_i16x8(), idx.as_i16x8(), b.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermt2w))]
pub unsafe fn _mm_mask_permutex2var_epi16(
a: __m128i,
k: __mmask8,
idx: __m128i,
b: __m128i,
) -> __m128i {
let permute = _mm_permutex2var_epi16(a, idx, b).as_i16x8();
transmute(simd_select_bitmask(k, permute, a.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vperm))] pub unsafe fn _mm_maskz_permutex2var_epi16(
k: __mmask8,
a: __m128i,
idx: __m128i,
b: __m128i,
) -> __m128i {
let permute = _mm_permutex2var_epi16(a, idx, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, permute, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermi2w))]
pub unsafe fn _mm_mask2_permutex2var_epi16(
a: __m128i,
idx: __m128i,
k: __mmask8,
b: __m128i,
) -> __m128i {
let permute = _mm_permutex2var_epi16(a, idx, b).as_i16x8();
transmute(simd_select_bitmask(k, permute, idx.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermw))]
pub unsafe fn _mm512_permutexvar_epi16(idx: __m512i, a: __m512i) -> __m512i {
transmute(vpermw(a.as_i16x32(), idx.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermw))]
pub unsafe fn _mm512_mask_permutexvar_epi16(
src: __m512i,
k: __mmask32,
idx: __m512i,
a: __m512i,
) -> __m512i {
let permute = _mm512_permutexvar_epi16(idx, a).as_i16x32();
transmute(simd_select_bitmask(k, permute, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermw))]
pub unsafe fn _mm512_maskz_permutexvar_epi16(k: __mmask32, idx: __m512i, a: __m512i) -> __m512i {
let permute = _mm512_permutexvar_epi16(idx, a).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, permute, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermw))]
pub unsafe fn _mm256_permutexvar_epi16(idx: __m256i, a: __m256i) -> __m256i {
transmute(vpermw256(a.as_i16x16(), idx.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermw))]
pub unsafe fn _mm256_mask_permutexvar_epi16(
src: __m256i,
k: __mmask16,
idx: __m256i,
a: __m256i,
) -> __m256i {
let permute = _mm256_permutexvar_epi16(idx, a).as_i16x16();
transmute(simd_select_bitmask(k, permute, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermw))]
pub unsafe fn _mm256_maskz_permutexvar_epi16(k: __mmask16, idx: __m256i, a: __m256i) -> __m256i {
let permute = _mm256_permutexvar_epi16(idx, a).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, permute, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermw))]
pub unsafe fn _mm_permutexvar_epi16(idx: __m128i, a: __m128i) -> __m128i {
transmute(vpermw128(a.as_i16x8(), idx.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermw))]
pub unsafe fn _mm_mask_permutexvar_epi16(
src: __m128i,
k: __mmask8,
idx: __m128i,
a: __m128i,
) -> __m128i {
let permute = _mm_permutexvar_epi16(idx, a).as_i16x8();
transmute(simd_select_bitmask(k, permute, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpermw))]
pub unsafe fn _mm_maskz_permutexvar_epi16(k: __mmask8, idx: __m128i, a: __m128i) -> __m128i {
let permute = _mm_permutexvar_epi16(idx, a).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, permute, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu16))] pub unsafe fn _mm512_mask_blend_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
transmute(simd_select_bitmask(k, b.as_i16x32(), a.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu16))] pub unsafe fn _mm256_mask_blend_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
transmute(simd_select_bitmask(k, b.as_i16x16(), a.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu16))] pub unsafe fn _mm_mask_blend_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
transmute(simd_select_bitmask(k, b.as_i16x8(), a.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu8))] pub unsafe fn _mm512_mask_blend_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
transmute(simd_select_bitmask(k, b.as_i8x64(), a.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu8))] pub unsafe fn _mm256_mask_blend_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
transmute(simd_select_bitmask(k, b.as_i8x32(), a.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu8))] pub unsafe fn _mm_mask_blend_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
transmute(simd_select_bitmask(k, b.as_i8x16(), a.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm512_broadcastw_epi16(a: __m128i) -> __m512i {
let a = _mm512_castsi128_si512(a).as_i16x32();
let ret: i16x32 = simd_shuffle!(
a,
a,
[
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
],
);
transmute(ret)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm512_mask_broadcastw_epi16(src: __m512i, k: __mmask32, a: __m128i) -> __m512i {
let broadcast = _mm512_broadcastw_epi16(a).as_i16x32();
transmute(simd_select_bitmask(k, broadcast, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm512_maskz_broadcastw_epi16(k: __mmask32, a: __m128i) -> __m512i {
let broadcast = _mm512_broadcastw_epi16(a).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, broadcast, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm256_mask_broadcastw_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i {
let broadcast = _mm256_broadcastw_epi16(a).as_i16x16();
transmute(simd_select_bitmask(k, broadcast, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm256_maskz_broadcastw_epi16(k: __mmask16, a: __m128i) -> __m256i {
let broadcast = _mm256_broadcastw_epi16(a).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, broadcast, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm_mask_broadcastw_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
let broadcast = _mm_broadcastw_epi16(a).as_i16x8();
transmute(simd_select_bitmask(k, broadcast, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm_maskz_broadcastw_epi16(k: __mmask8, a: __m128i) -> __m128i {
let broadcast = _mm_broadcastw_epi16(a).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, broadcast, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastb))]
pub unsafe fn _mm512_broadcastb_epi8(a: __m128i) -> __m512i {
let a = _mm512_castsi128_si512(a).as_i8x64();
let ret: i8x64 = simd_shuffle!(
a,
a,
[
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
],
);
transmute(ret)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastb))]
pub unsafe fn _mm512_mask_broadcastb_epi8(src: __m512i, k: __mmask64, a: __m128i) -> __m512i {
let broadcast = _mm512_broadcastb_epi8(a).as_i8x64();
transmute(simd_select_bitmask(k, broadcast, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastb))]
pub unsafe fn _mm512_maskz_broadcastb_epi8(k: __mmask64, a: __m128i) -> __m512i {
let broadcast = _mm512_broadcastb_epi8(a).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, broadcast, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastb))]
pub unsafe fn _mm256_mask_broadcastb_epi8(src: __m256i, k: __mmask32, a: __m128i) -> __m256i {
let broadcast = _mm256_broadcastb_epi8(a).as_i8x32();
transmute(simd_select_bitmask(k, broadcast, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastb))]
pub unsafe fn _mm256_maskz_broadcastb_epi8(k: __mmask32, a: __m128i) -> __m256i {
let broadcast = _mm256_broadcastb_epi8(a).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, broadcast, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastb))]
pub unsafe fn _mm_mask_broadcastb_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
let broadcast = _mm_broadcastb_epi8(a).as_i8x16();
transmute(simd_select_bitmask(k, broadcast, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastb))]
pub unsafe fn _mm_maskz_broadcastb_epi8(k: __mmask16, a: __m128i) -> __m128i {
let broadcast = _mm_broadcastb_epi8(a).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, broadcast, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhwd))]
pub unsafe fn _mm512_unpackhi_epi16(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_i16x32();
let b = b.as_i16x32();
#[rustfmt::skip]
let r: i16x32 = simd_shuffle!(
a,
b,
[
4, 32 4, 5, 32 5,
6, 32 6, 7, 32 7,
12, 32 12, 13, 32 13,
14, 32 14, 15, 32 15,
20, 32 20, 21, 32 21,
22, 32 22, 23, 32 23,
28, 32 28, 29, 32 29,
30, 32 30, 31, 32 31,
],
);
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhwd))]
pub unsafe fn _mm512_mask_unpackhi_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let unpackhi = _mm512_unpackhi_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, unpackhi, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhwd))]
pub unsafe fn _mm512_maskz_unpackhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let unpackhi = _mm512_unpackhi_epi16(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, unpackhi, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhwd))]
pub unsafe fn _mm256_mask_unpackhi_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let unpackhi = _mm256_unpackhi_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, unpackhi, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhwd))]
pub unsafe fn _mm256_maskz_unpackhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let unpackhi = _mm256_unpackhi_epi16(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, unpackhi, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhwd))]
pub unsafe fn _mm_mask_unpackhi_epi16(
src: __m128i,
k: __mmask8,
a: __m128i,
b: __m128i,
) -> __m128i {
let unpackhi = _mm_unpackhi_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, unpackhi, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhwd))]
pub unsafe fn _mm_maskz_unpackhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let unpackhi = _mm_unpackhi_epi16(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, unpackhi, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhbw))]
pub unsafe fn _mm512_unpackhi_epi8(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_i8x64();
let b = b.as_i8x64();
#[rustfmt::skip]
let r: i8x64 = simd_shuffle!(
a,
b,
[
8, 64 8, 9, 64 9,
10, 64 10, 11, 64 11,
12, 64 12, 13, 64 13,
14, 64 14, 15, 64 15,
24, 64 24, 25, 64 25,
26, 64 26, 27, 64 27,
28, 64 28, 29, 64 29,
30, 64 30, 31, 64 31,
40, 64 40, 41, 64 41,
42, 64 42, 43, 64 43,
44, 64 44, 45, 64 45,
46, 64 46, 47, 64 47,
56, 64 56, 57, 64 57,
58, 64 58, 59, 64 59,
60, 64 60, 61, 64 61,
62, 64 62, 63, 64 63,
],
);
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhbw))]
pub unsafe fn _mm512_mask_unpackhi_epi8(
src: __m512i,
k: __mmask64,
a: __m512i,
b: __m512i,
) -> __m512i {
let unpackhi = _mm512_unpackhi_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, unpackhi, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhbw))]
pub unsafe fn _mm512_maskz_unpackhi_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let unpackhi = _mm512_unpackhi_epi8(a, b).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, unpackhi, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhbw))]
pub unsafe fn _mm256_mask_unpackhi_epi8(
src: __m256i,
k: __mmask32,
a: __m256i,
b: __m256i,
) -> __m256i {
let unpackhi = _mm256_unpackhi_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, unpackhi, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhbw))]
pub unsafe fn _mm256_maskz_unpackhi_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let unpackhi = _mm256_unpackhi_epi8(a, b).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, unpackhi, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhbw))]
pub unsafe fn _mm_mask_unpackhi_epi8(
src: __m128i,
k: __mmask16,
a: __m128i,
b: __m128i,
) -> __m128i {
let unpackhi = _mm_unpackhi_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, unpackhi, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpckhbw))]
pub unsafe fn _mm_maskz_unpackhi_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let unpackhi = _mm_unpackhi_epi8(a, b).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, unpackhi, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklwd))]
pub unsafe fn _mm512_unpacklo_epi16(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_i16x32();
let b = b.as_i16x32();
#[rustfmt::skip]
let r: i16x32 = simd_shuffle!(
a,
b,
[
0, 32 0, 1, 32 1,
2, 32 2, 3, 32 3,
8, 32 8, 9, 32 9,
10, 32 10, 11, 32 11,
16, 32 16, 17, 32 17,
18, 32 18, 19, 32 19,
24, 32 24, 25, 32 25,
26, 32 26, 27, 32 27
],
);
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklwd))]
pub unsafe fn _mm512_mask_unpacklo_epi16(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
let unpacklo = _mm512_unpacklo_epi16(a, b).as_i16x32();
transmute(simd_select_bitmask(k, unpacklo, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklwd))]
pub unsafe fn _mm512_maskz_unpacklo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
let unpacklo = _mm512_unpacklo_epi16(a, b).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, unpacklo, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklwd))]
pub unsafe fn _mm256_mask_unpacklo_epi16(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
let unpacklo = _mm256_unpacklo_epi16(a, b).as_i16x16();
transmute(simd_select_bitmask(k, unpacklo, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklwd))]
pub unsafe fn _mm256_maskz_unpacklo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
let unpacklo = _mm256_unpacklo_epi16(a, b).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, unpacklo, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklwd))]
pub unsafe fn _mm_mask_unpacklo_epi16(
src: __m128i,
k: __mmask8,
a: __m128i,
b: __m128i,
) -> __m128i {
let unpacklo = _mm_unpacklo_epi16(a, b).as_i16x8();
transmute(simd_select_bitmask(k, unpacklo, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklwd))]
pub unsafe fn _mm_maskz_unpacklo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let unpacklo = _mm_unpacklo_epi16(a, b).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, unpacklo, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklbw))]
pub unsafe fn _mm512_unpacklo_epi8(a: __m512i, b: __m512i) -> __m512i {
let a = a.as_i8x64();
let b = b.as_i8x64();
#[rustfmt::skip]
let r: i8x64 = simd_shuffle!(
a,
b,
[
0, 64 0, 1, 64 1,
2, 64 2, 3, 64 3,
4, 64 4, 5, 64 5,
6, 64 6, 7, 64 7,
16, 64 16, 17, 64 17,
18, 64 18, 19, 64 19,
20, 64 20, 21, 64 21,
22, 64 22, 23, 64 23,
32, 64 32, 33, 64 33,
34, 64 34, 35, 64 35,
36, 64 36, 37, 64 37,
38, 64 38, 39, 64 39,
48, 64 48, 49, 64 49,
50, 64 50, 51, 64 51,
52, 64 52, 53, 64 53,
54, 64 54, 55, 64 55,
],
);
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklbw))]
pub unsafe fn _mm512_mask_unpacklo_epi8(
src: __m512i,
k: __mmask64,
a: __m512i,
b: __m512i,
) -> __m512i {
let unpacklo = _mm512_unpacklo_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, unpacklo, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklbw))]
pub unsafe fn _mm512_maskz_unpacklo_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let unpacklo = _mm512_unpacklo_epi8(a, b).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, unpacklo, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklbw))]
pub unsafe fn _mm256_mask_unpacklo_epi8(
src: __m256i,
k: __mmask32,
a: __m256i,
b: __m256i,
) -> __m256i {
let unpacklo = _mm256_unpacklo_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, unpacklo, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklbw))]
pub unsafe fn _mm256_maskz_unpacklo_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let unpacklo = _mm256_unpacklo_epi8(a, b).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, unpacklo, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklbw))]
pub unsafe fn _mm_mask_unpacklo_epi8(
src: __m128i,
k: __mmask16,
a: __m128i,
b: __m128i,
) -> __m128i {
let unpacklo = _mm_unpacklo_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, unpacklo, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpunpcklbw))]
pub unsafe fn _mm_maskz_unpacklo_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let unpacklo = _mm_unpacklo_epi8(a, b).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, unpacklo, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
pub unsafe fn _mm512_mask_mov_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i {
let mov = a.as_i16x32();
transmute(simd_select_bitmask(k, mov, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
pub unsafe fn _mm512_maskz_mov_epi16(k: __mmask32, a: __m512i) -> __m512i {
let mov = a.as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, mov, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
pub unsafe fn _mm256_mask_mov_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i {
let mov = a.as_i16x16();
transmute(simd_select_bitmask(k, mov, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
pub unsafe fn _mm256_maskz_mov_epi16(k: __mmask16, a: __m256i) -> __m256i {
let mov = a.as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, mov, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
pub unsafe fn _mm_mask_mov_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
let mov = a.as_i16x8();
transmute(simd_select_bitmask(k, mov, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu16))]
pub unsafe fn _mm_maskz_mov_epi16(k: __mmask8, a: __m128i) -> __m128i {
let mov = a.as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, mov, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
pub unsafe fn _mm512_mask_mov_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i {
let mov = a.as_i8x64();
transmute(simd_select_bitmask(k, mov, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
pub unsafe fn _mm512_maskz_mov_epi8(k: __mmask64, a: __m512i) -> __m512i {
let mov = a.as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, mov, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
pub unsafe fn _mm256_mask_mov_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i {
let mov = a.as_i8x32();
transmute(simd_select_bitmask(k, mov, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
pub unsafe fn _mm256_maskz_mov_epi8(k: __mmask32, a: __m256i) -> __m256i {
let mov = a.as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, mov, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
pub unsafe fn _mm_mask_mov_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
let mov = a.as_i8x16();
transmute(simd_select_bitmask(k, mov, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vmovdqu8))]
pub unsafe fn _mm_maskz_mov_epi8(k: __mmask16, a: __m128i) -> __m128i {
let mov = a.as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, mov, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm512_mask_set1_epi16(src: __m512i, k: __mmask32, a: i16) -> __m512i {
let r = _mm512_set1_epi16(a).as_i16x32();
transmute(simd_select_bitmask(k, r, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm512_maskz_set1_epi16(k: __mmask32, a: i16) -> __m512i {
let r = _mm512_set1_epi16(a).as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm256_mask_set1_epi16(src: __m256i, k: __mmask16, a: i16) -> __m256i {
let r = _mm256_set1_epi16(a).as_i16x16();
transmute(simd_select_bitmask(k, r, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm256_maskz_set1_epi16(k: __mmask16, a: i16) -> __m256i {
let r = _mm256_set1_epi16(a).as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm_mask_set1_epi16(src: __m128i, k: __mmask8, a: i16) -> __m128i {
let r = _mm_set1_epi16(a).as_i16x8();
transmute(simd_select_bitmask(k, r, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcastw))]
pub unsafe fn _mm_maskz_set1_epi16(k: __mmask8, a: i16) -> __m128i {
let r = _mm_set1_epi16(a).as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcast))]
pub unsafe fn _mm512_mask_set1_epi8(src: __m512i, k: __mmask64, a: i8) -> __m512i {
let r = _mm512_set1_epi8(a).as_i8x64();
transmute(simd_select_bitmask(k, r, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcast))]
pub unsafe fn _mm512_maskz_set1_epi8(k: __mmask64, a: i8) -> __m512i {
let r = _mm512_set1_epi8(a).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcast))]
pub unsafe fn _mm256_mask_set1_epi8(src: __m256i, k: __mmask32, a: i8) -> __m256i {
let r = _mm256_set1_epi8(a).as_i8x32();
transmute(simd_select_bitmask(k, r, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcast))]
pub unsafe fn _mm256_maskz_set1_epi8(k: __mmask32, a: i8) -> __m256i {
let r = _mm256_set1_epi8(a).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcast))]
pub unsafe fn _mm_mask_set1_epi8(src: __m128i, k: __mmask16, a: i8) -> __m128i {
let r = _mm_set1_epi8(a).as_i8x16();
transmute(simd_select_bitmask(k, r, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpbroadcast))]
pub unsafe fn _mm_maskz_set1_epi8(k: __mmask16, a: i8) -> __m128i {
let r = _mm_set1_epi8(a).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))]
#[rustc_legacy_const_generics(1)]
pub unsafe fn _mm512_shufflelo_epi16<const IMM8: i32>(a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_i16x32();
let r: i16x32 = simd_shuffle!(
a,
a,
[
IMM8 as u32 & 0b11,
(IMM8 as u32 >> 2) & 0b11,
(IMM8 as u32 >> 4) & 0b11,
(IMM8 as u32 >> 6) & 0b11,
4,
5,
6,
7,
(IMM8 as u32 & 0b11) 8,
((IMM8 as u32 >> 2) & 0b11) 8,
((IMM8 as u32 >> 4) & 0b11) 8,
((IMM8 as u32 >> 6) & 0b11) 8,
12,
13,
14,
15,
(IMM8 as u32 & 0b11) 16,
((IMM8 as u32 >> 2) & 0b11) 16,
((IMM8 as u32 >> 4) & 0b11) 16,
((IMM8 as u32 >> 6) & 0b11) 16,
20,
21,
22,
23,
(IMM8 as u32 & 0b11) 24,
((IMM8 as u32 >> 2) & 0b11) 24,
((IMM8 as u32 >> 4) & 0b11) 24,
((IMM8 as u32 >> 6) & 0b11) 24,
28,
29,
30,
31,
],
);
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm512_mask_shufflelo_epi16<const IMM8: i32>(
src: __m512i,
k: __mmask32,
a: __m512i,
) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let r = _mm512_shufflelo_epi16::<IMM8>(a);
transmute(simd_select_bitmask(k, r.as_i16x32(), src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm512_maskz_shufflelo_epi16<const IMM8: i32>(k: __mmask32, a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let r = _mm512_shufflelo_epi16::<IMM8>(a);
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, r.as_i16x32(), zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm256_mask_shufflelo_epi16<const IMM8: i32>(
src: __m256i,
k: __mmask16,
a: __m256i,
) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let shuffle = _mm256_shufflelo_epi16::<IMM8>(a);
transmute(simd_select_bitmask(k, shuffle.as_i16x16(), src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm256_maskz_shufflelo_epi16<const IMM8: i32>(k: __mmask16, a: __m256i) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let shuffle = _mm256_shufflelo_epi16::<IMM8>(a);
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, shuffle.as_i16x16(), zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm_mask_shufflelo_epi16<const IMM8: i32>(
src: __m128i,
k: __mmask8,
a: __m128i,
) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let shuffle = _mm_shufflelo_epi16::<IMM8>(a);
transmute(simd_select_bitmask(k, shuffle.as_i16x8(), src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm_maskz_shufflelo_epi16<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let shuffle = _mm_shufflelo_epi16::<IMM8>(a);
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, shuffle.as_i16x8(), zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))]
#[rustc_legacy_const_generics(1)]
pub unsafe fn _mm512_shufflehi_epi16<const IMM8: i32>(a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_i16x32();
let r: i16x32 = simd_shuffle!(
a,
a,
[
0,
1,
2,
3,
(IMM8 as u32 & 0b11) 4,
((IMM8 as u32 >> 2) & 0b11) 4,
((IMM8 as u32 >> 4) & 0b11) 4,
((IMM8 as u32 >> 6) & 0b11) 4,
8,
9,
10,
11,
(IMM8 as u32 & 0b11) 12,
((IMM8 as u32 >> 2) & 0b11) 12,
((IMM8 as u32 >> 4) & 0b11) 12,
((IMM8 as u32 >> 6) & 0b11) 12,
16,
17,
18,
19,
(IMM8 as u32 & 0b11) 20,
((IMM8 as u32 >> 2) & 0b11) 20,
((IMM8 as u32 >> 4) & 0b11) 20,
((IMM8 as u32 >> 6) & 0b11) 20,
24,
25,
26,
27,
(IMM8 as u32 & 0b11) 28,
((IMM8 as u32 >> 2) & 0b11) 28,
((IMM8 as u32 >> 4) & 0b11) 28,
((IMM8 as u32 >> 6) & 0b11) 28,
],
);
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm512_mask_shufflehi_epi16<const IMM8: i32>(
src: __m512i,
k: __mmask32,
a: __m512i,
) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let r = _mm512_shufflehi_epi16::<IMM8>(a);
transmute(simd_select_bitmask(k, r.as_i16x32(), src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm512_maskz_shufflehi_epi16<const IMM8: i32>(k: __mmask32, a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let r = _mm512_shufflehi_epi16::<IMM8>(a);
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, r.as_i16x32(), zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm256_mask_shufflehi_epi16<const IMM8: i32>(
src: __m256i,
k: __mmask16,
a: __m256i,
) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let shuffle = _mm256_shufflehi_epi16::<IMM8>(a);
transmute(simd_select_bitmask(k, shuffle.as_i16x16(), src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm256_maskz_shufflehi_epi16<const IMM8: i32>(k: __mmask16, a: __m256i) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let shuffle = _mm256_shufflehi_epi16::<IMM8>(a);
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, shuffle.as_i16x16(), zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm_mask_shufflehi_epi16<const IMM8: i32>(
src: __m128i,
k: __mmask8,
a: __m128i,
) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let shuffle = _mm_shufflehi_epi16::<IMM8>(a);
transmute(simd_select_bitmask(k, shuffle.as_i16x8(), src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm_maskz_shufflehi_epi16<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let shuffle = _mm_shufflehi_epi16::<IMM8>(a);
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, shuffle.as_i16x8(), zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufb))]
pub unsafe fn _mm512_shuffle_epi8(a: __m512i, b: __m512i) -> __m512i {
transmute(vpshufb(a.as_i8x64(), b.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufb))]
pub unsafe fn _mm512_mask_shuffle_epi8(
src: __m512i,
k: __mmask64,
a: __m512i,
b: __m512i,
) -> __m512i {
let shuffle = _mm512_shuffle_epi8(a, b).as_i8x64();
transmute(simd_select_bitmask(k, shuffle, src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufb))]
pub unsafe fn _mm512_maskz_shuffle_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
let shuffle = _mm512_shuffle_epi8(a, b).as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, shuffle, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufb))]
pub unsafe fn _mm256_mask_shuffle_epi8(
src: __m256i,
k: __mmask32,
a: __m256i,
b: __m256i,
) -> __m256i {
let shuffle = _mm256_shuffle_epi8(a, b).as_i8x32();
transmute(simd_select_bitmask(k, shuffle, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufb))]
pub unsafe fn _mm256_maskz_shuffle_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
let shuffle = _mm256_shuffle_epi8(a, b).as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, shuffle, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufb))]
pub unsafe fn _mm_mask_shuffle_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let shuffle = _mm_shuffle_epi8(a, b).as_i8x16();
transmute(simd_select_bitmask(k, shuffle, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpshufb))]
pub unsafe fn _mm_maskz_shuffle_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
let shuffle = _mm_shuffle_epi8(a, b).as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, shuffle, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmw))]
pub unsafe fn _mm512_test_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
let and = _mm512_and_si512(a, b);
let zero = _mm512_setzero_si512();
_mm512_cmpneq_epi16_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmw))]
pub unsafe fn _mm512_mask_test_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
let and = _mm512_and_si512(a, b);
let zero = _mm512_setzero_si512();
_mm512_mask_cmpneq_epi16_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmw))]
pub unsafe fn _mm256_test_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
let and = _mm256_and_si256(a, b);
let zero = _mm256_setzero_si256();
_mm256_cmpneq_epi16_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmw))]
pub unsafe fn _mm256_mask_test_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
let and = _mm256_and_si256(a, b);
let zero = _mm256_setzero_si256();
_mm256_mask_cmpneq_epi16_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmw))]
pub unsafe fn _mm_test_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
let and = _mm_and_si128(a, b);
let zero = _mm_setzero_si128();
_mm_cmpneq_epi16_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmw))]
pub unsafe fn _mm_mask_test_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
let and = _mm_and_si128(a, b);
let zero = _mm_setzero_si128();
_mm_mask_cmpneq_epi16_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmb))]
pub unsafe fn _mm512_test_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
let and = _mm512_and_si512(a, b);
let zero = _mm512_setzero_si512();
_mm512_cmpneq_epi8_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmb))]
pub unsafe fn _mm512_mask_test_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
let and = _mm512_and_si512(a, b);
let zero = _mm512_setzero_si512();
_mm512_mask_cmpneq_epi8_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmb))]
pub unsafe fn _mm256_test_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
let and = _mm256_and_si256(a, b);
let zero = _mm256_setzero_si256();
_mm256_cmpneq_epi8_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmb))]
pub unsafe fn _mm256_mask_test_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
let and = _mm256_and_si256(a, b);
let zero = _mm256_setzero_si256();
_mm256_mask_cmpneq_epi8_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmb))]
pub unsafe fn _mm_test_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
let and = _mm_and_si128(a, b);
let zero = _mm_setzero_si128();
_mm_cmpneq_epi8_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestmb))]
pub unsafe fn _mm_mask_test_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
let and = _mm_and_si128(a, b);
let zero = _mm_setzero_si128();
_mm_mask_cmpneq_epi8_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmw))]
pub unsafe fn _mm512_testn_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 {
let and = _mm512_and_si512(a, b);
let zero = _mm512_setzero_si512();
_mm512_cmpeq_epi16_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmw))]
pub unsafe fn _mm512_mask_testn_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
let and = _mm512_and_si512(a, b);
let zero = _mm512_setzero_si512();
_mm512_mask_cmpeq_epi16_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmw))]
pub unsafe fn _mm256_testn_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 {
let and = _mm256_and_si256(a, b);
let zero = _mm256_setzero_si256();
_mm256_cmpeq_epi16_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmw))]
pub unsafe fn _mm256_mask_testn_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
let and = _mm256_and_si256(a, b);
let zero = _mm256_setzero_si256();
_mm256_mask_cmpeq_epi16_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmw))]
pub unsafe fn _mm_testn_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 {
let and = _mm_and_si128(a, b);
let zero = _mm_setzero_si128();
_mm_cmpeq_epi16_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmw))]
pub unsafe fn _mm_mask_testn_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
let and = _mm_and_si128(a, b);
let zero = _mm_setzero_si128();
_mm_mask_cmpeq_epi16_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmb))]
pub unsafe fn _mm512_testn_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 {
let and = _mm512_and_si512(a, b);
let zero = _mm512_setzero_si512();
_mm512_cmpeq_epi8_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmb))]
pub unsafe fn _mm512_mask_testn_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
let and = _mm512_and_si512(a, b);
let zero = _mm512_setzero_si512();
_mm512_mask_cmpeq_epi8_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmb))]
pub unsafe fn _mm256_testn_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 {
let and = _mm256_and_si256(a, b);
let zero = _mm256_setzero_si256();
_mm256_cmpeq_epi8_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmb))]
pub unsafe fn _mm256_mask_testn_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
let and = _mm256_and_si256(a, b);
let zero = _mm256_setzero_si256();
_mm256_mask_cmpeq_epi8_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmb))]
pub unsafe fn _mm_testn_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 {
let and = _mm_and_si128(a, b);
let zero = _mm_setzero_si128();
_mm_cmpeq_epi8_mask(and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vptestnmb))]
pub unsafe fn _mm_mask_testn_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
let and = _mm_and_si128(a, b);
let zero = _mm_setzero_si128();
_mm_mask_cmpeq_epi8_mask(k, and, zero)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(mov))] pub unsafe fn _store_mask64(mem_addr: *mut __mmask64, a: __mmask64) {
ptr::write(mem_addr as *mut __mmask64, a);
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(mov))] pub unsafe fn _store_mask32(mem_addr: *mut __mmask32, a: __mmask32) {
ptr::write(mem_addr as *mut __mmask32, a);
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(mov))] pub unsafe fn _load_mask64(mem_addr: *const __mmask64) -> __mmask64 {
ptr::read(mem_addr as *const __mmask64)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(mov))] pub unsafe fn _load_mask32(mem_addr: *const __mmask32) -> __mmask32 {
ptr::read(mem_addr as *const __mmask32)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsadbw))]
pub unsafe fn _mm512_sad_epu8(a: __m512i, b: __m512i) -> __m512i {
transmute(vpsadbw(a.as_u8x64(), b.as_u8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
pub unsafe fn _mm512_dbsad_epu8<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_u8x64();
let b = b.as_u8x64();
let r = vdbpsadbw(a, b, IMM8);
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(4)]
#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
pub unsafe fn _mm512_mask_dbsad_epu8<const IMM8: i32>(
src: __m512i,
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_u8x64();
let b = b.as_u8x64();
let r = vdbpsadbw(a, b, IMM8);
transmute(simd_select_bitmask(k, r, src.as_u16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
pub unsafe fn _mm512_maskz_dbsad_epu8<const IMM8: i32>(
k: __mmask32,
a: __m512i,
b: __m512i,
) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_u8x64();
let b = b.as_u8x64();
let r = vdbpsadbw(a, b, IMM8);
transmute(simd_select_bitmask(
k,
r,
_mm512_setzero_si512().as_u16x32(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
pub unsafe fn _mm256_dbsad_epu8<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_u8x32();
let b = b.as_u8x32();
let r = vdbpsadbw256(a, b, IMM8);
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(4)]
#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
pub unsafe fn _mm256_mask_dbsad_epu8<const IMM8: i32>(
src: __m256i,
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_u8x32();
let b = b.as_u8x32();
let r = vdbpsadbw256(a, b, IMM8);
transmute(simd_select_bitmask(k, r, src.as_u16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
pub unsafe fn _mm256_maskz_dbsad_epu8<const IMM8: i32>(
k: __mmask16,
a: __m256i,
b: __m256i,
) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_u8x32();
let b = b.as_u8x32();
let r = vdbpsadbw256(a, b, IMM8);
transmute(simd_select_bitmask(
k,
r,
_mm256_setzero_si256().as_u16x16(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(2)]
#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
pub unsafe fn _mm_dbsad_epu8<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_u8x16();
let b = b.as_u8x16();
let r = vdbpsadbw128(a, b, IMM8);
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(4)]
#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
pub unsafe fn _mm_mask_dbsad_epu8<const IMM8: i32>(
src: __m128i,
k: __mmask8,
a: __m128i,
b: __m128i,
) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_u8x16();
let b = b.as_u8x16();
let r = vdbpsadbw128(a, b, IMM8);
transmute(simd_select_bitmask(k, r, src.as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[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_uimm_bits!(IMM8, 8);
let a = a.as_u8x16();
let b = b.as_u8x16();
let r = vdbpsadbw128(a, b, IMM8);
transmute(simd_select_bitmask(k, r, _mm_setzero_si128().as_u16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovw2m))]
pub unsafe fn _mm512_movepi16_mask(a: __m512i) -> __mmask32 {
let filter = _mm512_set1_epi16(1 << 15);
let a = _mm512_and_si512(a, filter);
_mm512_cmpeq_epi16_mask(a, filter)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovw2m))]
pub unsafe fn _mm256_movepi16_mask(a: __m256i) -> __mmask16 {
let filter = _mm256_set1_epi16(1 << 15);
let a = _mm256_and_si256(a, filter);
_mm256_cmpeq_epi16_mask(a, filter)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovw2m))]
pub unsafe fn _mm_movepi16_mask(a: __m128i) -> __mmask8 {
let filter = _mm_set1_epi16(1 << 15);
let a = _mm_and_si128(a, filter);
_mm_cmpeq_epi16_mask(a, filter)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovb2m))]
pub unsafe fn _mm512_movepi8_mask(a: __m512i) -> __mmask64 {
let filter = _mm512_set1_epi8(1 << 7);
let a = _mm512_and_si512(a, filter);
_mm512_cmpeq_epi8_mask(a, filter)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovmskb))] pub unsafe fn _mm256_movepi8_mask(a: __m256i) -> __mmask32 {
let filter = _mm256_set1_epi8(1 << 7);
let a = _mm256_and_si256(a, filter);
_mm256_cmpeq_epi8_mask(a, filter)
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovmskb))] pub unsafe fn _mm_movepi8_mask(a: __m128i) -> __mmask16 {
let filter = _mm_set1_epi8(1 << 7);
let a = _mm_and_si128(a, filter);
_mm_cmpeq_epi8_mask(a, filter)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovm2w))]
pub unsafe fn _mm512_movm_epi16(k: __mmask32) -> __m512i {
let one = _mm512_set1_epi16(
1 << 15
| 1 << 14
| 1 << 13
| 1 << 12
| 1 << 11
| 1 << 10
| 1 << 9
| 1 << 8
| 1 << 7
| 1 << 6
| 1 << 5
| 1 << 4
| 1 << 3
| 1 << 2
| 1 << 1
| 1 << 0,
)
.as_i16x32();
let zero = _mm512_setzero_si512().as_i16x32();
transmute(simd_select_bitmask(k, one, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovm2w))]
pub unsafe fn _mm256_movm_epi16(k: __mmask16) -> __m256i {
let one = _mm256_set1_epi16(
1 << 15
| 1 << 14
| 1 << 13
| 1 << 12
| 1 << 11
| 1 << 10
| 1 << 9
| 1 << 8
| 1 << 7
| 1 << 6
| 1 << 5
| 1 << 4
| 1 << 3
| 1 << 2
| 1 << 1
| 1 << 0,
)
.as_i16x16();
let zero = _mm256_setzero_si256().as_i16x16();
transmute(simd_select_bitmask(k, one, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovm2w))]
pub unsafe fn _mm_movm_epi16(k: __mmask8) -> __m128i {
let one = _mm_set1_epi16(
1 << 15
| 1 << 14
| 1 << 13
| 1 << 12
| 1 << 11
| 1 << 10
| 1 << 9
| 1 << 8
| 1 << 7
| 1 << 6
| 1 << 5
| 1 << 4
| 1 << 3
| 1 << 2
| 1 << 1
| 1 << 0,
)
.as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
transmute(simd_select_bitmask(k, one, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovm2b))]
pub unsafe fn _mm512_movm_epi8(k: __mmask64) -> __m512i {
let one =
_mm512_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0)
.as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, one, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovm2b))]
pub unsafe fn _mm256_movm_epi8(k: __mmask32) -> __m256i {
let one =
_mm256_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0)
.as_i8x32();
let zero = _mm256_setzero_si256().as_i8x32();
transmute(simd_select_bitmask(k, one, zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovm2b))]
pub unsafe fn _mm_movm_epi8(k: __mmask16) -> __m128i {
let one = _mm_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0)
.as_i8x16();
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, one, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _cvtmask32_u32(a: __mmask32) -> u32 {
a
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _cvtu32_mask32(a: u32) -> __mmask32 {
a
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kadd_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
a b
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kadd_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
a b
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kand_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
a & b
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kand_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
a & b
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _knot_mask32(a: __mmask32) -> __mmask32 {
!a
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _knot_mask64(a: __mmask64) -> __mmask64 {
!a
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kandn_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
_knot_mask32(a) & b
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kandn_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
_knot_mask64(a) & b
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
a | b
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
a | b
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kxor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
a ^ b
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kxor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
a ^ b
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kxnor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
_knot_mask32(a ^ b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kxnor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
_knot_mask64(a ^ b)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kortest_mask32_u8(a: __mmask32, b: __mmask32, all_ones: *mut u8) -> u8 {
let tmp = _kor_mask32(a, b);
*all_ones = (tmp == 0xffffffff) as u8;
(tmp == 0) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kortest_mask64_u8(a: __mmask64, b: __mmask64, all_ones: *mut u8) -> u8 {
let tmp = _kor_mask64(a, b);
*all_ones = (tmp == 0xffffffff_ffffffff) as u8;
(tmp == 0) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kortestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
(_kor_mask32(a, b) == 0xffffffff) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kortestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
(_kor_mask64(a, b) == 0xffffffff_ffffffff) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kortestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
(_kor_mask32(a, b) == 0) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kortestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
(_kor_mask64(a, b) == 0) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[rustc_legacy_const_generics(1)]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kshiftli_mask32<const COUNT: u32>(a: __mmask32) -> __mmask32 {
a << COUNT
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[rustc_legacy_const_generics(1)]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kshiftli_mask64<const COUNT: u32>(a: __mmask64) -> __mmask64 {
a << COUNT
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[rustc_legacy_const_generics(1)]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kshiftri_mask32<const COUNT: u32>(a: __mmask32) -> __mmask32 {
a >> COUNT
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[rustc_legacy_const_generics(1)]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _kshiftri_mask64<const COUNT: u32>(a: __mmask64) -> __mmask64 {
a >> COUNT
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _ktest_mask32_u8(a: __mmask32, b: __mmask32, and_not: *mut u8) -> u8 {
*and_not = (_kandn_mask32(a, b) == 0) as u8;
(_kand_mask32(a, b) == 0) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _ktest_mask64_u8(a: __mmask64, b: __mmask64, and_not: *mut u8) -> u8 {
*and_not = (_kandn_mask64(a, b) == 0) as u8;
(_kand_mask64(a, b) == 0) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _ktestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
(_kandn_mask32(a, b) == 0) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _ktestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
(_kandn_mask64(a, b) == 0) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _ktestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 {
(_kand_mask32(a, b) == 0) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub unsafe fn _ktestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 {
(_kand_mask64(a, b) == 0) as u8
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(mov))] pub unsafe fn _mm512_kunpackw(a: __mmask32, b: __mmask32) -> __mmask32 {
((a & 0xffff) << 16) | (b & 0xffff)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(mov))] pub unsafe fn _mm512_kunpackd(a: __mmask64, b: __mmask64) -> __mmask64 {
((a & 0xffffffff) << 32) | (b & 0xffffffff)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm512_cvtepi16_epi8(a: __m512i) -> __m256i {
let a = a.as_i16x32();
transmute::<i8x32, _>(simd_cast(a))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm512_mask_cvtepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i {
let convert = _mm512_cvtepi16_epi8(a).as_i8x32();
transmute(simd_select_bitmask(k, convert, src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm512_maskz_cvtepi16_epi8(k: __mmask32, a: __m512i) -> __m256i {
let convert = _mm512_cvtepi16_epi8(a).as_i8x32();
transmute(simd_select_bitmask(
k,
convert,
_mm256_setzero_si256().as_i8x32(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm256_cvtepi16_epi8(a: __m256i) -> __m128i {
let a = a.as_i16x16();
transmute::<i8x16, _>(simd_cast(a))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm256_mask_cvtepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i {
let convert = _mm256_cvtepi16_epi8(a).as_i8x16();
transmute(simd_select_bitmask(k, convert, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm256_maskz_cvtepi16_epi8(k: __mmask16, a: __m256i) -> __m128i {
let convert = _mm256_cvtepi16_epi8(a).as_i8x16();
transmute(simd_select_bitmask(
k,
convert,
_mm_setzero_si128().as_i8x16(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm_cvtepi16_epi8(a: __m128i) -> __m128i {
let a = a.as_i16x8();
let zero = _mm_setzero_si128().as_i16x8();
let v256: i16x16 = simd_shuffle!(a, zero, [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8]);
transmute::<i8x16, _>(simd_cast(v256))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm_mask_cvtepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
let convert = _mm_cvtepi16_epi8(a).as_i8x16();
let k: __mmask16 = 0b11111111_11111111 & k as __mmask16;
transmute(simd_select_bitmask(k, convert, src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm_maskz_cvtepi16_epi8(k: __mmask8, a: __m128i) -> __m128i {
let convert = _mm_cvtepi16_epi8(a).as_i8x16();
let k: __mmask16 = 0b11111111_11111111 & k as __mmask16;
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, convert, zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm512_cvtsepi16_epi8(a: __m512i) -> __m256i {
transmute(vpmovswb(
a.as_i16x32(),
_mm256_setzero_si256().as_i8x32(),
0b11111111_11111111_11111111_11111111,
))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm512_mask_cvtsepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i {
transmute(vpmovswb(a.as_i16x32(), src.as_i8x32(), k))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm512_maskz_cvtsepi16_epi8(k: __mmask32, a: __m512i) -> __m256i {
transmute(vpmovswb(
a.as_i16x32(),
_mm256_setzero_si256().as_i8x32(),
k,
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm256_cvtsepi16_epi8(a: __m256i) -> __m128i {
transmute(vpmovswb256(
a.as_i16x16(),
_mm_setzero_si128().as_i8x16(),
0b11111111_11111111,
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm256_mask_cvtsepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i {
transmute(vpmovswb256(a.as_i16x16(), src.as_i8x16(), k))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm256_maskz_cvtsepi16_epi8(k: __mmask16, a: __m256i) -> __m128i {
transmute(vpmovswb256(
a.as_i16x16(),
_mm_setzero_si128().as_i8x16(),
k,
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm_cvtsepi16_epi8(a: __m128i) -> __m128i {
transmute(vpmovswb128(
a.as_i16x8(),
_mm_setzero_si128().as_i8x16(),
0b11111111,
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm_mask_cvtsepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
transmute(vpmovswb128(a.as_i16x8(), src.as_i8x16(), k))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm_maskz_cvtsepi16_epi8(k: __mmask8, a: __m128i) -> __m128i {
transmute(vpmovswb128(a.as_i16x8(), _mm_setzero_si128().as_i8x16(), k))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm512_cvtusepi16_epi8(a: __m512i) -> __m256i {
transmute(vpmovuswb(
a.as_u16x32(),
_mm256_setzero_si256().as_u8x32(),
0b11111111_11111111_11111111_11111111,
))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm512_mask_cvtusepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i {
transmute(vpmovuswb(a.as_u16x32(), src.as_u8x32(), k))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm512_maskz_cvtusepi16_epi8(k: __mmask32, a: __m512i) -> __m256i {
transmute(vpmovuswb(
a.as_u16x32(),
_mm256_setzero_si256().as_u8x32(),
k,
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm256_cvtusepi16_epi8(a: __m256i) -> __m128i {
transmute(vpmovuswb256(
a.as_u16x16(),
_mm_setzero_si128().as_u8x16(),
0b11111111_11111111,
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm256_mask_cvtusepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i {
transmute(vpmovuswb256(a.as_u16x16(), src.as_u8x16(), k))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm256_maskz_cvtusepi16_epi8(k: __mmask16, a: __m256i) -> __m128i {
transmute(vpmovuswb256(
a.as_u16x16(),
_mm_setzero_si128().as_u8x16(),
k,
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm_cvtusepi16_epi8(a: __m128i) -> __m128i {
transmute(vpmovuswb128(
a.as_u16x8(),
_mm_setzero_si128().as_u8x16(),
0b11111111,
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm_mask_cvtusepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
transmute(vpmovuswb128(a.as_u16x8(), src.as_u8x16(), k))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm_maskz_cvtusepi16_epi8(k: __mmask8, a: __m128i) -> __m128i {
transmute(vpmovuswb128(
a.as_u16x8(),
_mm_setzero_si128().as_u8x16(),
k,
))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovsxbw))]
pub unsafe fn _mm512_cvtepi8_epi16(a: __m256i) -> __m512i {
let a = a.as_i8x32();
transmute::<i16x32, _>(simd_cast(a))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovsxbw))]
pub unsafe fn _mm512_mask_cvtepi8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m512i {
let convert = _mm512_cvtepi8_epi16(a).as_i16x32();
transmute(simd_select_bitmask(k, convert, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovsxbw))]
pub unsafe fn _mm512_maskz_cvtepi8_epi16(k: __mmask32, a: __m256i) -> __m512i {
let convert = _mm512_cvtepi8_epi16(a).as_i16x32();
transmute(simd_select_bitmask(
k,
convert,
_mm512_setzero_si512().as_i16x32(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovsxbw))]
pub unsafe fn _mm256_mask_cvtepi8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i {
let convert = _mm256_cvtepi8_epi16(a).as_i16x16();
transmute(simd_select_bitmask(k, convert, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovsxbw))]
pub unsafe fn _mm256_maskz_cvtepi8_epi16(k: __mmask16, a: __m128i) -> __m256i {
let convert = _mm256_cvtepi8_epi16(a).as_i16x16();
transmute(simd_select_bitmask(
k,
convert,
_mm256_setzero_si256().as_i16x16(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovsxbw))]
pub unsafe fn _mm_mask_cvtepi8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
let convert = _mm_cvtepi8_epi16(a).as_i16x8();
transmute(simd_select_bitmask(k, convert, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovsxbw))]
pub unsafe fn _mm_maskz_cvtepi8_epi16(k: __mmask8, a: __m128i) -> __m128i {
let convert = _mm_cvtepi8_epi16(a).as_i16x8();
transmute(simd_select_bitmask(
k,
convert,
_mm_setzero_si128().as_i16x8(),
))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovzxbw))]
pub unsafe fn _mm512_cvtepu8_epi16(a: __m256i) -> __m512i {
let a = a.as_u8x32();
transmute::<i16x32, _>(simd_cast(a))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovzxbw))]
pub unsafe fn _mm512_mask_cvtepu8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m512i {
let convert = _mm512_cvtepu8_epi16(a).as_i16x32();
transmute(simd_select_bitmask(k, convert, src.as_i16x32()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovzxbw))]
pub unsafe fn _mm512_maskz_cvtepu8_epi16(k: __mmask32, a: __m256i) -> __m512i {
let convert = _mm512_cvtepu8_epi16(a).as_i16x32();
transmute(simd_select_bitmask(
k,
convert,
_mm512_setzero_si512().as_i16x32(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovzxbw))]
pub unsafe fn _mm256_mask_cvtepu8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i {
let convert = _mm256_cvtepu8_epi16(a).as_i16x16();
transmute(simd_select_bitmask(k, convert, src.as_i16x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovzxbw))]
pub unsafe fn _mm256_maskz_cvtepu8_epi16(k: __mmask16, a: __m128i) -> __m256i {
let convert = _mm256_cvtepu8_epi16(a).as_i16x16();
transmute(simd_select_bitmask(
k,
convert,
_mm256_setzero_si256().as_i16x16(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovzxbw))]
pub unsafe fn _mm_mask_cvtepu8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
let convert = _mm_cvtepu8_epi16(a).as_i16x8();
transmute(simd_select_bitmask(k, convert, src.as_i16x8()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovzxbw))]
pub unsafe fn _mm_maskz_cvtepu8_epi16(k: __mmask8, a: __m128i) -> __m128i {
let convert = _mm_cvtepu8_epi16(a).as_i16x8();
transmute(simd_select_bitmask(
k,
convert,
_mm_setzero_si128().as_i16x8(),
))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpslldq, IMM8 = 3))]
#[rustc_legacy_const_generics(1)]
pub unsafe fn _mm512_bslli_epi128<const IMM8: i32>(a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
const fn mask(shift: i32, i: u32) -> u32 {
let shift = shift as u32 & 0xff;
if shift > 15 || i % 16 < shift {
0
} else {
64 (i - shift)
}
}
let a = a.as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
let r: i8x64 = simd_shuffle!(
zero,
a,
[
mask(IMM8, 0),
mask(IMM8, 1),
mask(IMM8, 2),
mask(IMM8, 3),
mask(IMM8, 4),
mask(IMM8, 5),
mask(IMM8, 6),
mask(IMM8, 7),
mask(IMM8, 8),
mask(IMM8, 9),
mask(IMM8, 10),
mask(IMM8, 11),
mask(IMM8, 12),
mask(IMM8, 13),
mask(IMM8, 14),
mask(IMM8, 15),
mask(IMM8, 16),
mask(IMM8, 17),
mask(IMM8, 18),
mask(IMM8, 19),
mask(IMM8, 20),
mask(IMM8, 21),
mask(IMM8, 22),
mask(IMM8, 23),
mask(IMM8, 24),
mask(IMM8, 25),
mask(IMM8, 26),
mask(IMM8, 27),
mask(IMM8, 28),
mask(IMM8, 29),
mask(IMM8, 30),
mask(IMM8, 31),
mask(IMM8, 32),
mask(IMM8, 33),
mask(IMM8, 34),
mask(IMM8, 35),
mask(IMM8, 36),
mask(IMM8, 37),
mask(IMM8, 38),
mask(IMM8, 39),
mask(IMM8, 40),
mask(IMM8, 41),
mask(IMM8, 42),
mask(IMM8, 43),
mask(IMM8, 44),
mask(IMM8, 45),
mask(IMM8, 46),
mask(IMM8, 47),
mask(IMM8, 48),
mask(IMM8, 49),
mask(IMM8, 50),
mask(IMM8, 51),
mask(IMM8, 52),
mask(IMM8, 53),
mask(IMM8, 54),
mask(IMM8, 55),
mask(IMM8, 56),
mask(IMM8, 57),
mask(IMM8, 58),
mask(IMM8, 59),
mask(IMM8, 60),
mask(IMM8, 61),
mask(IMM8, 62),
mask(IMM8, 63),
],
);
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpsrldq, IMM8 = 3))]
#[rustc_legacy_const_generics(1)]
pub unsafe fn _mm512_bsrli_epi128<const IMM8: i32>(a: __m512i) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let a = a.as_i8x64();
let zero = _mm512_setzero_si512().as_i8x64();
let r: i8x64 = match IMM8 % 16 {
0 => simd_shuffle!(
a,
zero,
[
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
],
),
1 => simd_shuffle!(
a,
zero,
[
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 80, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 96, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112,
],
),
2 => simd_shuffle!(
a,
zero,
[
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 80, 81, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 96, 97, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113,
],
),
3 => simd_shuffle!(
a,
zero,
[
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 80, 81, 82, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 96, 97, 98, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113,
114,
],
),
4 => simd_shuffle!(
a,
zero,
[
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 80, 81, 82, 83, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
47, 96, 97, 98, 99, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114,
115,
],
),
5 => simd_shuffle!(
a,
zero,
[
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 80, 81, 82, 83, 84, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
96, 97, 98, 99, 100, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114,
115, 116,
],
),
6 => simd_shuffle!(
a,
zero,
[
6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 80, 81, 82, 83, 84, 85, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 96,
97, 98, 99, 100, 101, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115,
116, 117,
],
),
7 => simd_shuffle!(
a,
zero,
[
7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 23, 24, 25, 26, 27,
28, 29, 30, 31, 80, 81, 82, 83, 84, 85, 86, 39, 40, 41, 42, 43, 44, 45, 46, 47, 96,
97, 98, 99, 100, 101, 102, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115,
116, 117, 118,
],
),
8 => simd_shuffle!(
a,
zero,
[
8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 24, 25, 26, 27, 28,
29, 30, 31, 80, 81, 82, 83, 84, 85, 86, 87, 40, 41, 42, 43, 44, 45, 46, 47, 96, 97,
98, 99, 100, 101, 102, 103, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115,
116, 117, 118, 119,
],
),
9 => simd_shuffle!(
a,
zero,
[
9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 25, 26, 27, 28, 29,
30, 31, 80, 81, 82, 83, 84, 85, 86, 87, 88, 41, 42, 43, 44, 45, 46, 47, 96, 97, 98,
99, 100, 101, 102, 103, 104, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115, 116,
117, 118, 119, 120,
],
),
10 => simd_shuffle!(
a,
zero,
[
10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 26, 27, 28, 29, 30,
31, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 42, 43, 44, 45, 46, 47, 96, 97, 98, 99,
100, 101, 102, 103, 104, 105, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115, 116, 117,
118, 119, 120, 121,
],
),
11 => simd_shuffle!(
a,
zero,
[
11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 27, 28, 29, 30, 31,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 43, 44, 45, 46, 47, 96, 97, 98, 99,
100, 101, 102, 103, 104, 105, 106, 59, 60, 61, 62, 63, 112, 113, 114, 115, 116,
117, 118, 119, 120, 121, 122,
],
),
12 => simd_shuffle!(
a,
zero,
[
12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 28, 29, 30, 31, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 44, 45, 46, 47, 96, 97, 98, 99, 100,
101, 102, 103, 104, 105, 106, 107, 60, 61, 62, 63, 112, 113, 114, 115, 116, 117,
118, 119, 120, 121, 122, 123,
],
),
13 => simd_shuffle!(
a,
zero,
[
13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 29, 30, 31, 80, 81,
82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 45, 46, 47, 96, 97, 98, 99, 100, 101,
102, 103, 104, 105, 106, 107, 108, 61, 62, 63, 112, 113, 114, 115, 116, 117, 118,
119, 120, 121, 122, 123, 124,
],
),
14 => simd_shuffle!(
a,
zero,
[
14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 30, 31, 80, 81, 82,
83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 46, 47, 96, 97, 98, 99, 100, 101, 102,
103, 104, 105, 106, 107, 108, 109, 62, 63, 112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125,
],
),
15 => simd_shuffle!(
a,
zero,
[
15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 31, 80, 81, 82, 83,
84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 47, 96, 97, 98, 99, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 63, 112, 113, 114, 115, 116, 117, 118, 119, 120,
121, 122, 123, 124, 125, 126,
],
),
_ => zero,
};
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))]
#[rustc_legacy_const_generics(2)]
pub unsafe fn _mm512_alignr_epi8<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
if IMM8 > 32 {
return _mm512_set1_epi8(0);
}
let (a, b) = if IMM8 > 16 {
(_mm512_set1_epi8(0), a)
} else {
(a, b)
};
let a = a.as_i8x64();
let b = b.as_i8x64();
let r: i8x64 = match IMM8 % 16 {
0 => simd_shuffle!(
b,
a,
[
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
],
),
1 => simd_shuffle!(
b,
a,
[
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 80, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 96, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112,
],
),
2 => simd_shuffle!(
b,
a,
[
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 80, 81, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 96, 97, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113,
],
),
3 => simd_shuffle!(
b,
a,
[
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 80, 81, 82, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 96, 97, 98, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113,
114,
],
),
4 => simd_shuffle!(
b,
a,
[
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 80, 81, 82, 83, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
47, 96, 97, 98, 99, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114,
115,
],
),
5 => simd_shuffle!(
b,
a,
[
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 80, 81, 82, 83, 84, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
96, 97, 98, 99, 100, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114,
115, 116,
],
),
6 => simd_shuffle!(
b,
a,
[
6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 80, 81, 82, 83, 84, 85, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 96,
97, 98, 99, 100, 101, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115,
116, 117,
],
),
7 => simd_shuffle!(
b,
a,
[
7, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 23, 24, 25, 26, 27,
28, 29, 30, 31, 80, 81, 82, 83, 84, 85, 86, 39, 40, 41, 42, 43, 44, 45, 46, 47, 96,
97, 98, 99, 100, 101, 102, 55, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115,
116, 117, 118,
],
),
8 => simd_shuffle!(
b,
a,
[
8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 24, 25, 26, 27, 28,
29, 30, 31, 80, 81, 82, 83, 84, 85, 86, 87, 40, 41, 42, 43, 44, 45, 46, 47, 96, 97,
98, 99, 100, 101, 102, 103, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115,
116, 117, 118, 119,
],
),
9 => simd_shuffle!(
b,
a,
[
9, 10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 25, 26, 27, 28, 29,
30, 31, 80, 81, 82, 83, 84, 85, 86, 87, 88, 41, 42, 43, 44, 45, 46, 47, 96, 97, 98,
99, 100, 101, 102, 103, 104, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115, 116,
117, 118, 119, 120,
],
),
10 => simd_shuffle!(
b,
a,
[
10, 11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 26, 27, 28, 29, 30,
31, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 42, 43, 44, 45, 46, 47, 96, 97, 98, 99,
100, 101, 102, 103, 104, 105, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115, 116, 117,
118, 119, 120, 121,
],
),
11 => simd_shuffle!(
b,
a,
[
11, 12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 27, 28, 29, 30, 31,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 43, 44, 45, 46, 47, 96, 97, 98, 99,
100, 101, 102, 103, 104, 105, 106, 59, 60, 61, 62, 63, 112, 113, 114, 115, 116,
117, 118, 119, 120, 121, 122,
],
),
12 => simd_shuffle!(
b,
a,
[
12, 13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 28, 29, 30, 31, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 44, 45, 46, 47, 96, 97, 98, 99, 100,
101, 102, 103, 104, 105, 106, 107, 60, 61, 62, 63, 112, 113, 114, 115, 116, 117,
118, 119, 120, 121, 122, 123,
],
),
13 => simd_shuffle!(
b,
a,
[
13, 14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 29, 30, 31, 80, 81,
82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 45, 46, 47, 96, 97, 98, 99, 100, 101,
102, 103, 104, 105, 106, 107, 108, 61, 62, 63, 112, 113, 114, 115, 116, 117, 118,
119, 120, 121, 122, 123, 124,
],
),
14 => simd_shuffle!(
b,
a,
[
14, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 30, 31, 80, 81, 82,
83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 46, 47, 96, 97, 98, 99, 100, 101, 102,
103, 104, 105, 106, 107, 108, 109, 62, 63, 112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125,
],
),
15 => simd_shuffle!(
b,
a,
[
15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 31, 80, 81, 82, 83,
84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 47, 96, 97, 98, 99, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 63, 112, 113, 114, 115, 116, 117, 118, 119, 120,
121, 122, 123, 124, 125, 126,
],
),
_ => b,
};
transmute(r)
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))]
#[rustc_legacy_const_generics(4)]
pub unsafe fn _mm512_mask_alignr_epi8<const IMM8: i32>(
src: __m512i,
k: __mmask64,
a: __m512i,
b: __m512i,
) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let r = _mm512_alignr_epi8::<IMM8>(a, b);
transmute(simd_select_bitmask(k, r.as_i8x64(), src.as_i8x64()))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))]
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm512_maskz_alignr_epi8<const IMM8: i32>(
k: __mmask64,
a: __m512i,
b: __m512i,
) -> __m512i {
static_assert_uimm_bits!(IMM8, 8);
let r = _mm512_alignr_epi8::<IMM8>(a, b);
let zero = _mm512_setzero_si512().as_i8x64();
transmute(simd_select_bitmask(k, r.as_i8x64(), zero))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(4)]
#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
pub unsafe fn _mm256_mask_alignr_epi8<const IMM8: i32>(
src: __m256i,
k: __mmask32,
a: __m256i,
b: __m256i,
) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let r = _mm256_alignr_epi8::<IMM8>(a, b);
transmute(simd_select_bitmask(k, r.as_i8x32(), src.as_i8x32()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
pub unsafe fn _mm256_maskz_alignr_epi8<const IMM8: i32>(
k: __mmask32,
a: __m256i,
b: __m256i,
) -> __m256i {
static_assert_uimm_bits!(IMM8, 8);
let r = _mm256_alignr_epi8::<IMM8>(a, b);
transmute(simd_select_bitmask(
k,
r.as_i8x32(),
_mm256_setzero_si256().as_i8x32(),
))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(4)]
#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
pub unsafe fn _mm_mask_alignr_epi8<const IMM8: i32>(
src: __m128i,
k: __mmask16,
a: __m128i,
b: __m128i,
) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let r = _mm_alignr_epi8::<IMM8>(a, b);
transmute(simd_select_bitmask(k, r.as_i8x16(), src.as_i8x16()))
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[rustc_legacy_const_generics(3)]
#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))]
pub unsafe fn _mm_maskz_alignr_epi8<const IMM8: i32>(
k: __mmask16,
a: __m128i,
b: __m128i,
) -> __m128i {
static_assert_uimm_bits!(IMM8, 8);
let r = _mm_alignr_epi8::<IMM8>(a, b);
let zero = _mm_setzero_si128().as_i8x16();
transmute(simd_select_bitmask(k, r.as_i8x16(), zero))
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm512_mask_cvtsepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) {
vpmovswbmem(mem_addr, a.as_i16x32(), k);
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm256_mask_cvtsepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) {
vpmovswbmem256(mem_addr, a.as_i16x16(), k);
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovswb))]
pub unsafe fn _mm_mask_cvtsepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
vpmovswbmem128(mem_addr, a.as_i16x8(), k);
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm512_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) {
vpmovwbmem(mem_addr, a.as_i16x32(), k);
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm256_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) {
vpmovwbmem256(mem_addr, a.as_i16x16(), k);
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovwb))]
pub unsafe fn _mm_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
vpmovwbmem128(mem_addr, a.as_i16x8(), k);
}
#[inline]
#[target_feature(enable = "avx512bw")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm512_mask_cvtusepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) {
vpmovuswbmem(mem_addr, a.as_i16x32(), k);
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm256_mask_cvtusepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) {
vpmovuswbmem256(mem_addr, a.as_i16x16(), k);
}
#[inline]
#[target_feature(enable = "avx512bw,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmovuswb))]
pub unsafe fn _mm_mask_cvtusepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
vpmovuswbmem128(mem_addr, a.as_i16x8(), k);
}
#[allow(improper_ctypes)]
extern "C" {
#[link_name = "llvm.x86.avx512.pmul.hr.sw.512"]
fn vpmulhrsw(a: i16x32, b: i16x32) -> i16x32;
#[link_name = "llvm.x86.avx512.pmaddw.d.512"]
fn vpmaddwd(a: i16x32, b: i16x32) -> i32x16;
#[link_name = "llvm.x86.avx512.pmaddubs.w.512"]
fn vpmaddubsw(a: i8x64, b: i8x64) -> i16x32;
#[link_name = "llvm.x86.avx512.packssdw.512"]
fn vpackssdw(a: i32x16, b: i32x16) -> i16x32;
#[link_name = "llvm.x86.avx512.packsswb.512"]
fn vpacksswb(a: i16x32, b: i16x32) -> i8x64;
#[link_name = "llvm.x86.avx512.packusdw.512"]
fn vpackusdw(a: i32x16, b: i32x16) -> u16x32;
#[link_name = "llvm.x86.avx512.packuswb.512"]
fn vpackuswb(a: i16x32, b: i16x32) -> u8x64;
#[link_name = "llvm.x86.avx512.psll.w.512"]
fn vpsllw(a: i16x32, count: i16x8) -> i16x32;
#[link_name = "llvm.x86.avx512.psllv.w.512"]
fn vpsllvw(a: i16x32, b: i16x32) -> i16x32;
#[link_name = "llvm.x86.avx512.psllv.w.256"]
fn vpsllvw256(a: i16x16, b: i16x16) -> i16x16;
#[link_name = "llvm.x86.avx512.psllv.w.128"]
fn vpsllvw128(a: i16x8, b: i16x8) -> i16x8;
#[link_name = "llvm.x86.avx512.psrl.w.512"]
fn vpsrlw(a: i16x32, count: i16x8) -> i16x32;
#[link_name = "llvm.x86.avx512.psrlv.w.512"]
fn vpsrlvw(a: i16x32, b: i16x32) -> i16x32;
#[link_name = "llvm.x86.avx512.psrlv.w.256"]
fn vpsrlvw256(a: i16x16, b: i16x16) -> i16x16;
#[link_name = "llvm.x86.avx512.psrlv.w.128"]
fn vpsrlvw128(a: i16x8, b: i16x8) -> i16x8;
#[link_name = "llvm.x86.avx512.psra.w.512"]
fn vpsraw(a: i16x32, count: i16x8) -> i16x32;
#[link_name = "llvm.x86.avx512.psrav.w.512"]
fn vpsravw(a: i16x32, count: i16x32) -> i16x32;
#[link_name = "llvm.x86.avx512.psrav.w.256"]
fn vpsravw256(a: i16x16, count: i16x16) -> i16x16;
#[link_name = "llvm.x86.avx512.psrav.w.128"]
fn vpsravw128(a: i16x8, count: i16x8) -> i16x8;
#[link_name = "llvm.x86.avx512.vpermi2var.hi.512"]
fn vpermi2w(a: i16x32, idx: i16x32, b: i16x32) -> i16x32;
#[link_name = "llvm.x86.avx512.vpermi2var.hi.256"]
fn vpermi2w256(a: i16x16, idx: i16x16, b: i16x16) -> i16x16;
#[link_name = "llvm.x86.avx512.vpermi2var.hi.128"]
fn vpermi2w128(a: i16x8, idx: i16x8, b: i16x8) -> i16x8;
#[link_name = "llvm.x86.avx512.permvar.hi.512"]
fn vpermw(a: i16x32, idx: i16x32) -> i16x32;
#[link_name = "llvm.x86.avx512.permvar.hi.256"]
fn vpermw256(a: i16x16, idx: i16x16) -> i16x16;
#[link_name = "llvm.x86.avx512.permvar.hi.128"]
fn vpermw128(a: i16x8, idx: i16x8) -> i16x8;
#[link_name = "llvm.x86.avx512.pshuf.b.512"]
fn vpshufb(a: i8x64, b: i8x64) -> i8x64;
#[link_name = "llvm.x86.avx512.psad.bw.512"]
fn vpsadbw(a: u8x64, b: u8x64) -> u64x8;
#[link_name = "llvm.x86.avx512.dbpsadbw.512"]
fn vdbpsadbw(a: u8x64, b: u8x64, imm8: i32) -> u16x32;
#[link_name = "llvm.x86.avx512.dbpsadbw.256"]
fn vdbpsadbw256(a: u8x32, b: u8x32, imm8: i32) -> u16x16;
#[link_name = "llvm.x86.avx512.dbpsadbw.128"]
fn vdbpsadbw128(a: u8x16, b: u8x16, imm8: i32) -> u16x8;
#[link_name = "llvm.x86.avx512.mask.pmovs.wb.512"]
fn vpmovswb(a: i16x32, src: i8x32, mask: u32) -> i8x32;
#[link_name = "llvm.x86.avx512.mask.pmovs.wb.256"]
fn vpmovswb256(a: i16x16, src: i8x16, mask: u16) -> i8x16;
#[link_name = "llvm.x86.avx512.mask.pmovs.wb.128"]
fn vpmovswb128(a: i16x8, src: i8x16, mask: u8) -> i8x16;
#[link_name = "llvm.x86.avx512.mask.pmovus.wb.512"]
fn vpmovuswb(a: u16x32, src: u8x32, mask: u32) -> u8x32;
#[link_name = "llvm.x86.avx512.mask.pmovus.wb.256"]
fn vpmovuswb256(a: u16x16, src: u8x16, mask: u16) -> u8x16;
#[link_name = "llvm.x86.avx512.mask.pmovus.wb.128"]
fn vpmovuswb128(a: u16x8, src: u8x16, mask: u8) -> u8x16;
#[link_name = "llvm.x86.avx512.mask.pmovs.wb.mem.512"]
fn vpmovswbmem(mem_addr: *mut i8, a: i16x32, mask: u32);
#[link_name = "llvm.x86.avx512.mask.pmovs.wb.mem.256"]
fn vpmovswbmem256(mem_addr: *mut i8, a: i16x16, mask: u16);
#[link_name = "llvm.x86.avx512.mask.pmovs.wb.mem.128"]
fn vpmovswbmem128(mem_addr: *mut i8, a: i16x8, mask: u8);
#[link_name = "llvm.x86.avx512.mask.pmov.wb.mem.512"]
fn vpmovwbmem(mem_addr: *mut i8, a: i16x32, mask: u32);
#[link_name = "llvm.x86.avx512.mask.pmov.wb.mem.256"]
fn vpmovwbmem256(mem_addr: *mut i8, a: i16x16, mask: u16);
#[link_name = "llvm.x86.avx512.mask.pmov.wb.mem.128"]
fn vpmovwbmem128(mem_addr: *mut i8, a: i16x8, mask: u8);
#[link_name = "llvm.x86.avx512.mask.pmovus.wb.mem.512"]
fn vpmovuswbmem(mem_addr: *mut i8, a: i16x32, mask: u32);
#[link_name = "llvm.x86.avx512.mask.pmovus.wb.mem.256"]
fn vpmovuswbmem256(mem_addr: *mut i8, a: i16x16, mask: u16);
#[link_name = "llvm.x86.avx512.mask.pmovus.wb.mem.128"]
fn vpmovuswbmem128(mem_addr: *mut i8, a: i16x8, mask: u8);
#[link_name = "llvm.x86.avx512.mask.loadu.b.128"]
fn loaddqu8_128(mem_addr: *const i8, a: i8x16, mask: u16) -> i8x16;
#[link_name = "llvm.x86.avx512.mask.loadu.w.128"]
fn loaddqu16_128(mem_addr: *const i16, a: i16x8, mask: u8) -> i16x8;
#[link_name = "llvm.x86.avx512.mask.loadu.b.256"]
fn loaddqu8_256(mem_addr: *const i8, a: i8x32, mask: u32) -> i8x32;
#[link_name = "llvm.x86.avx512.mask.loadu.w.256"]
fn loaddqu16_256(mem_addr: *const i16, a: i16x16, mask: u16) -> i16x16;
#[link_name = "llvm.x86.avx512.mask.loadu.b.512"]
fn loaddqu8_512(mem_addr: *const i8, a: i8x64, mask: u64) -> i8x64;
#[link_name = "llvm.x86.avx512.mask.loadu.w.512"]
fn loaddqu16_512(mem_addr: *const i16, a: i16x32, mask: u32) -> i16x32;
#[link_name = "llvm.x86.avx512.mask.storeu.b.128"]
fn storedqu8_128(mem_addr: *mut i8, a: i8x16, mask: u16);
#[link_name = "llvm.x86.avx512.mask.storeu.w.128"]
fn storedqu16_128(mem_addr: *mut i16, a: i16x8, mask: u8);
#[link_name = "llvm.x86.avx512.mask.storeu.b.256"]
fn storedqu8_256(mem_addr: *mut i8, a: i8x32, mask: u32);
#[link_name = "llvm.x86.avx512.mask.storeu.w.256"]
fn storedqu16_256(mem_addr: *mut i16, a: i16x16, mask: u16);
#[link_name = "llvm.x86.avx512.mask.storeu.b.512"]
fn storedqu8_512(mem_addr: *mut i8, a: i8x64, mask: u64);
#[link_name = "llvm.x86.avx512.mask.storeu.w.512"]
fn storedqu16_512(mem_addr: *mut i16, a: i16x32, mask: u32);
}
#[cfg(test)]
mod tests {
use stdarch_test::simd_test;
use crate::core_arch::x86::*;
use crate::hint::black_box;
use crate::mem::{self};
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_abs_epi16() {
let a = _mm512_set1_epi16(-1);
let r = _mm512_abs_epi16(a);
let e = _mm512_set1_epi16(1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_abs_epi16() {
let a = _mm512_set1_epi16(-1);
let r = _mm512_mask_abs_epi16(a, 0, a);
assert_eq_m512i(r, a);
let r = _mm512_mask_abs_epi16(a, 0b00000000_11111111_00000000_11111111, a);
#[rustfmt::skip]
let e = _mm512_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_abs_epi16() {
let a = _mm512_set1_epi16(-1);
let r = _mm512_maskz_abs_epi16(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_abs_epi16(0b00000000_11111111_00000000_11111111, a);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_abs_epi16() {
let a = _mm256_set1_epi16(-1);
let r = _mm256_mask_abs_epi16(a, 0, a);
assert_eq_m256i(r, a);
let r = _mm256_mask_abs_epi16(a, 0b00000000_11111111, a);
let e = _mm256_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_abs_epi16() {
let a = _mm256_set1_epi16(-1);
let r = _mm256_maskz_abs_epi16(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_abs_epi16(0b00000000_11111111, a);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_abs_epi16() {
let a = _mm_set1_epi16(-1);
let r = _mm_mask_abs_epi16(a, 0, a);
assert_eq_m128i(r, a);
let r = _mm_mask_abs_epi16(a, 0b00001111, a);
let e = _mm_set_epi16(-1, -1, -1, -1, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_abs_epi16() {
let a = _mm_set1_epi16(-1);
let r = _mm_maskz_abs_epi16(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_abs_epi16(0b00001111, a);
let e = _mm_set_epi16(0, 0, 0, 0, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_abs_epi8() {
let a = _mm512_set1_epi8(-1);
let r = _mm512_abs_epi8(a);
let e = _mm512_set1_epi8(1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_abs_epi8() {
let a = _mm512_set1_epi8(-1);
let r = _mm512_mask_abs_epi8(a, 0, a);
assert_eq_m512i(r, a);
let r = _mm512_mask_abs_epi8(
a,
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_abs_epi8() {
let a = _mm512_set1_epi8(-1);
let r = _mm512_maskz_abs_epi8(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_abs_epi8(
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_abs_epi8() {
let a = _mm256_set1_epi8(-1);
let r = _mm256_mask_abs_epi8(a, 0, a);
assert_eq_m256i(r, a);
let r = _mm256_mask_abs_epi8(a, 0b00000000_11111111_00000000_11111111, a);
#[rustfmt::skip]
let e = _mm256_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1,
-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_abs_epi8() {
let a = _mm256_set1_epi8(-1);
let r = _mm256_maskz_abs_epi8(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_abs_epi8(0b00000000_11111111_00000000_11111111, a);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_abs_epi8() {
let a = _mm_set1_epi8(-1);
let r = _mm_mask_abs_epi8(a, 0, a);
assert_eq_m128i(r, a);
let r = _mm_mask_abs_epi8(a, 0b00000000_11111111, a);
let e = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_abs_epi8() {
let a = _mm_set1_epi8(-1);
let r = _mm_maskz_abs_epi8(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_abs_epi8(0b00000000_11111111, a);
#[rustfmt::skip]
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_add_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(2);
let r = _mm512_add_epi16(a, b);
let e = _mm512_set1_epi16(3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_add_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(2);
let r = _mm512_mask_add_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_add_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_add_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(2);
let r = _mm512_maskz_add_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_add_epi16(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_add_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(2);
let r = _mm256_mask_add_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_add_epi16(a, 0b00000000_11111111, a, b);
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_add_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(2);
let r = _mm256_maskz_add_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_add_epi16(0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_add_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(2);
let r = _mm_mask_add_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_add_epi16(a, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, 3, 3, 3, 3);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_add_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(2);
let r = _mm_maskz_add_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_add_epi16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 3, 3, 3, 3);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_add_epi8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(2);
let r = _mm512_add_epi8(a, b);
let e = _mm512_set1_epi8(3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_add_epi8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(2);
let r = _mm512_mask_add_epi8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_add_epi8(
a,
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_add_epi8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(2);
let r = _mm512_maskz_add_epi8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_add_epi8(
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_add_epi8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(2);
let r = _mm256_mask_add_epi8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_add_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_add_epi8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(2);
let r = _mm256_maskz_add_epi8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_add_epi8(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_add_epi8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(2);
let r = _mm_mask_add_epi8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_add_epi8(a, 0b00000000_11111111, a, b);
let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_add_epi8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(2);
let r = _mm_maskz_add_epi8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_add_epi8(0b00000000_11111111, a, b);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_adds_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(u16::MAX as i16);
let r = _mm512_adds_epu16(a, b);
let e = _mm512_set1_epi16(u16::MAX as i16);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_adds_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(u16::MAX as i16);
let r = _mm512_mask_adds_epu16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_adds_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_adds_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(u16::MAX as i16);
let r = _mm512_maskz_adds_epu16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_adds_epu16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_adds_epu16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(u16::MAX as i16);
let r = _mm256_mask_adds_epu16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_adds_epu16(a, 0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_adds_epu16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(u16::MAX as i16);
let r = _mm256_maskz_adds_epu16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_adds_epu16(0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_adds_epu16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(u16::MAX as i16);
let r = _mm_mask_adds_epu16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_adds_epu16(a, 0b00001111, a, b);
#[rustfmt::skip]
let e = _mm_set_epi16(1, 1, 1, 1, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_adds_epu16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(u16::MAX as i16);
let r = _mm_maskz_adds_epu16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_adds_epu16(0b00001111, a, b);
#[rustfmt::skip]
let e = _mm_set_epi16(0, 0, 0, 0, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16, u16::MAX as i16);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_adds_epu8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(u8::MAX as i8);
let r = _mm512_adds_epu8(a, b);
let e = _mm512_set1_epi8(u8::MAX as i8);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_adds_epu8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(u8::MAX as i8);
let r = _mm512_mask_adds_epu8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_adds_epu8(
a,
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_adds_epu8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(u8::MAX as i8);
let r = _mm512_maskz_adds_epu8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_adds_epu8(
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_adds_epu8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(u8::MAX as i8);
let r = _mm256_mask_adds_epu8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_adds_epu8(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_adds_epu8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(u8::MAX as i8);
let r = _mm256_maskz_adds_epu8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_adds_epu8(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_adds_epu8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(u8::MAX as i8);
let r = _mm_mask_adds_epu8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_adds_epu8(a, 0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_adds_epu8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(u8::MAX as i8);
let r = _mm_maskz_adds_epu8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_adds_epu8(0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_adds_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(i16::MAX);
let r = _mm512_adds_epi16(a, b);
let e = _mm512_set1_epi16(i16::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_adds_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(i16::MAX);
let r = _mm512_mask_adds_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_adds_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_adds_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(i16::MAX);
let r = _mm512_maskz_adds_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_adds_epi16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_adds_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(i16::MAX);
let r = _mm256_mask_adds_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_adds_epi16(a, 0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_adds_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(i16::MAX);
let r = _mm256_maskz_adds_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_adds_epi16(0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_adds_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(i16::MAX);
let r = _mm_mask_adds_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_adds_epi16(a, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_adds_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(i16::MAX);
let r = _mm_maskz_adds_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_adds_epi16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_adds_epi8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(i8::MAX);
let r = _mm512_adds_epi8(a, b);
let e = _mm512_set1_epi8(i8::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_adds_epi8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(i8::MAX);
let r = _mm512_mask_adds_epi8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_adds_epi8(
a,
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_adds_epi8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(i8::MAX);
let r = _mm512_maskz_adds_epi8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_adds_epi8(
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_adds_epi8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(i8::MAX);
let r = _mm256_mask_adds_epi8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_adds_epi8(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_adds_epi8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(i8::MAX);
let r = _mm256_maskz_adds_epi8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_adds_epi8(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_adds_epi8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(i8::MAX);
let r = _mm_mask_adds_epi8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_adds_epi8(a, 0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_adds_epi8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(i8::MAX);
let r = _mm_maskz_adds_epi8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_adds_epi8(0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_sub_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(2);
let r = _mm512_sub_epi16(a, b);
let e = _mm512_set1_epi16(-1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_sub_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(2);
let r = _mm512_mask_sub_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_sub_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_sub_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(2);
let r = _mm512_maskz_sub_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_sub_epi16(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_sub_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(2);
let r = _mm256_mask_sub_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_sub_epi16(a, 0b00000000_11111111, a, b);
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_sub_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(2);
let r = _mm256_maskz_sub_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_sub_epi16(0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_sub_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(2);
let r = _mm_mask_sub_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_sub_epi16(a, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, -1, -1, -1, -1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_sub_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(2);
let r = _mm_maskz_sub_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_sub_epi16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, -1, -1, -1, -1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_sub_epi8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(2);
let r = _mm512_sub_epi8(a, b);
let e = _mm512_set1_epi8(-1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_sub_epi8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(2);
let r = _mm512_mask_sub_epi8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_sub_epi8(
a,
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_sub_epi8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(2);
let r = _mm512_maskz_sub_epi8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_sub_epi8(
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_sub_epi8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(2);
let r = _mm256_mask_sub_epi8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_sub_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_sub_epi8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(2);
let r = _mm256_maskz_sub_epi8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_sub_epi8(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_sub_epi8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(2);
let r = _mm_mask_sub_epi8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_sub_epi8(a, 0b00000000_11111111, a, b);
let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_sub_epi8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(2);
let r = _mm_maskz_sub_epi8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_sub_epi8(0b00000000_11111111, a, b);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_subs_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(u16::MAX as i16);
let r = _mm512_subs_epu16(a, b);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_subs_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(u16::MAX as i16);
let r = _mm512_mask_subs_epu16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_subs_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_subs_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(u16::MAX as i16);
let r = _mm512_maskz_subs_epu16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_subs_epu16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_subs_epu16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(u16::MAX as i16);
let r = _mm256_mask_subs_epu16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_subs_epu16(a, 0b00000000_00001111, a, b);
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_subs_epu16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(u16::MAX as i16);
let r = _mm256_maskz_subs_epu16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_subs_epu16(0b00000000_00001111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_subs_epu16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(u16::MAX as i16);
let r = _mm_mask_subs_epu16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_subs_epu16(a, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_subs_epu16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(u16::MAX as i16);
let r = _mm_maskz_subs_epu16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_subs_epu16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_subs_epu8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(u8::MAX as i8);
let r = _mm512_subs_epu8(a, b);
let e = _mm512_set1_epi8(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_subs_epu8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(u8::MAX as i8);
let r = _mm512_mask_subs_epu8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_subs_epu8(
a,
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_subs_epu8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(u8::MAX as i8);
let r = _mm512_maskz_subs_epu8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_subs_epu8(
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_subs_epu8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(u8::MAX as i8);
let r = _mm256_mask_subs_epu8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_subs_epu8(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_subs_epu8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(u8::MAX as i8);
let r = _mm256_maskz_subs_epu8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_subs_epu8(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_subs_epu8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(u8::MAX as i8);
let r = _mm_mask_subs_epu8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_subs_epu8(a, 0b00000000_00001111, a, b);
let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_subs_epu8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(u8::MAX as i8);
let r = _mm_maskz_subs_epu8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_subs_epu8(0b00000000_00001111, a, b);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_subs_epi16() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(i16::MAX);
let r = _mm512_subs_epi16(a, b);
let e = _mm512_set1_epi16(i16::MIN);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_subs_epi16() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(i16::MAX);
let r = _mm512_mask_subs_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_subs_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_subs_epi16() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(i16::MAX);
let r = _mm512_maskz_subs_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_subs_epi16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_subs_epi16() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(i16::MAX);
let r = _mm256_mask_subs_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_subs_epi16(a, 0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_subs_epi16() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(i16::MAX);
let r = _mm256_maskz_subs_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_subs_epi16(0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_subs_epi16() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(i16::MAX);
let r = _mm_mask_subs_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_subs_epi16(a, 0b00001111, a, b);
let e = _mm_set_epi16(-1, -1, -1, -1, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_subs_epi16() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(i16::MAX);
let r = _mm_maskz_subs_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_subs_epi16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, i16::MIN, i16::MIN, i16::MIN, i16::MIN);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_subs_epi8() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(i8::MAX);
let r = _mm512_subs_epi8(a, b);
let e = _mm512_set1_epi8(i8::MIN);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_subs_epi8() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(i8::MAX);
let r = _mm512_mask_subs_epi8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_subs_epi8(
a,
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_subs_epi8() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(i8::MAX);
let r = _mm512_maskz_subs_epi8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_subs_epi8(
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_subs_epi8() {
let a = _mm256_set1_epi8(-1);
let b = _mm256_set1_epi8(i8::MAX);
let r = _mm256_mask_subs_epi8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_subs_epi8(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_subs_epi8() {
let a = _mm256_set1_epi8(-1);
let b = _mm256_set1_epi8(i8::MAX);
let r = _mm256_maskz_subs_epi8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_subs_epi8(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_subs_epi8() {
let a = _mm_set1_epi8(-1);
let b = _mm_set1_epi8(i8::MAX);
let r = _mm_mask_subs_epi8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_subs_epi8(a, 0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_subs_epi8() {
let a = _mm_set1_epi8(-1);
let b = _mm_set1_epi8(i8::MAX);
let r = _mm_maskz_subs_epi8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_subs_epi8(0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MIN, i8::MIN, i8::MIN);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mulhi_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_mulhi_epu16(a, b);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_mulhi_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_mask_mulhi_epu16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_mulhi_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_mulhi_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_maskz_mulhi_epu16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_mulhi_epu16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_mulhi_epu16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_mask_mulhi_epu16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_mulhi_epu16(a, 0b00000000_00001111, a, b);
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_mulhi_epu16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_maskz_mulhi_epu16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_mulhi_epu16(0b00000000_00001111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_mulhi_epu16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_mask_mulhi_epu16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_mulhi_epu16(a, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_mulhi_epu16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_maskz_mulhi_epu16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_mulhi_epu16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mulhi_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_mulhi_epi16(a, b);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_mulhi_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_mask_mulhi_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_mulhi_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_mulhi_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_maskz_mulhi_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_mulhi_epi16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_mulhi_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_mask_mulhi_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_mulhi_epi16(a, 0b00000000_00001111, a, b);
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_mulhi_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_maskz_mulhi_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_mulhi_epi16(0b00000000_00001111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_mulhi_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_mask_mulhi_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_mulhi_epi16(a, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_mulhi_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_maskz_mulhi_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_mulhi_epi16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mulhrs_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_mulhrs_epi16(a, b);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_mulhrs_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_mask_mulhrs_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_mulhrs_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_mulhrs_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_maskz_mulhrs_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_mulhrs_epi16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_mulhrs_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_mask_mulhrs_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_mulhrs_epi16(a, 0b00000000_00001111, a, b);
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_mulhrs_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_maskz_mulhrs_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_mulhrs_epi16(0b00000000_00001111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_mulhrs_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_mask_mulhrs_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_mulhrs_epi16(a, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_mulhrs_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_maskz_mulhrs_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_mulhrs_epi16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mullo_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_mullo_epi16(a, b);
let e = _mm512_set1_epi16(1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_mullo_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_mask_mullo_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_mullo_epi16(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_mullo_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_maskz_mullo_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_mullo_epi16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_mullo_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_mask_mullo_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_mullo_epi16(a, 0b00000000_00001111, a, b);
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_mullo_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_maskz_mullo_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_mullo_epi16(0b00000000_00001111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_mullo_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_mask_mullo_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_mullo_epi16(a, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_mullo_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_maskz_mullo_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_mullo_epi16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_max_epu16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_max_epu16(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_mask_max_epu16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_mask_max_epu16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_max_epu16(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_maskz_max_epu16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_maskz_max_epu16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_max_epu16(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_mask_max_epu16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_mask_max_epu16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_max_epu16(a, 0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_maskz_max_epu16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_maskz_max_epu16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_max_epu16(0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_mask_max_epu16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_mask_max_epu16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_max_epu16(a, 0b00001111, a, b);
let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_maskz_max_epu16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_maskz_max_epu16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_max_epu16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_max_epu8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_max_epu8(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_mask_max_epu8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_mask_max_epu8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_max_epu8(
a,
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_maskz_max_epu8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_maskz_max_epu8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_max_epu8(
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_mask_max_epu8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_mask_max_epu8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_max_epu8(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_maskz_max_epu8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_maskz_max_epu8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_max_epu8(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_mask_max_epu8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_mask_max_epu8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_max_epu8(a, 0b00000000_11111111, a, b);
let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_maskz_max_epu8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_maskz_max_epu8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_max_epu8(0b00000000_11111111, a, b);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_max_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_max_epi16(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_mask_max_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_mask_max_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_max_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_maskz_max_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_maskz_max_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_max_epi16(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_mask_max_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_mask_max_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_max_epi16(a, 0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_maskz_max_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_maskz_max_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_max_epi16(0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_mask_max_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_mask_max_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_max_epi16(a, 0b00001111, a, b);
let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_maskz_max_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_maskz_max_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_max_epi16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_max_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_max_epi8(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15,
15, 14, 13, 12, 11, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_mask_max_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_mask_max_epi8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_max_epi8(
a,
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_maskz_max_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_maskz_max_epi8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_max_epi8(
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_mask_max_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_mask_max_epi8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_max_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_maskz_max_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_maskz_max_epi8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_max_epi8(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_mask_max_epi8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_mask_max_epi8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_max_epi8(a, 0b00000000_11111111, a, b);
let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_maskz_max_epi8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_maskz_max_epi8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_max_epi8(0b00000000_11111111, a, b);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_min_epu16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_min_epu16(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_mask_min_epu16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_mask_min_epu16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_min_epu16(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_maskz_min_epu16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_maskz_min_epu16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_min_epu16(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_mask_min_epu16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_mask_min_epu16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_min_epu16(a, 0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_maskz_min_epu16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_maskz_min_epu16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_min_epu16(0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_mask_min_epu16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_mask_min_epu16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_min_epu16(a, 0b00001111, a, b);
let e = _mm_set_epi16(0, 1, 2, 3, 3, 2, 1, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_maskz_min_epu16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_maskz_min_epu16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_min_epu16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 3, 2, 1, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_min_epu8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_min_epu8(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_mask_min_epu8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_mask_min_epu8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_min_epu8(
a,
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_maskz_min_epu8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_maskz_min_epu8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_min_epu8(
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_mask_min_epu8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_mask_min_epu8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_min_epu8(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_maskz_min_epu8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_maskz_min_epu8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_min_epu8(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_mask_min_epu8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_mask_min_epu8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_min_epu8(a, 0b00000000_11111111, a, b);
let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_maskz_min_epu8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_maskz_min_epu8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_min_epu8(0b00000000_11111111, a, b);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_min_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_min_epi16(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_mask_min_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_mask_min_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_min_epi16(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_maskz_min_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_maskz_min_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_min_epi16(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_mask_min_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_mask_min_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_min_epi16(a, 0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_maskz_min_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_maskz_min_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_min_epi16(0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_mask_min_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_mask_min_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_min_epi16(a, 0b00001111, a, b);
let e = _mm_set_epi16(0, 1, 2, 3, 3, 2, 1, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_maskz_min_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_maskz_min_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_min_epi16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 3, 2, 1, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_min_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_min_epi8(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_mask_min_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_mask_min_epi8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_min_epi8(
a,
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f")]
unsafe fn test_mm512_maskz_min_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm512_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm512_maskz_min_epi8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_min_epi8(
0b00000000_11111111_00000000_11111111_00000000_11111111_00000000_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_mask_min_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_mask_min_epi8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_min_epi8(a, 0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_maskz_min_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let b = _mm256_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm256_maskz_min_epi8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_min_epi8(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_mask_min_epi8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_mask_min_epi8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_min_epi8(a, 0b00000000_11111111, a, b);
let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm_maskz_min_epi8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
let r = _mm_maskz_min_epi8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_min_epi8(0b00000000_11111111, a, b);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmplt_epu16_mask() {
let a = _mm512_set1_epi16(-2);
let b = _mm512_set1_epi16(-1);
let m = _mm512_cmplt_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmplt_epu16_mask() {
let a = _mm512_set1_epi16(-2);
let b = _mm512_set1_epi16(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmplt_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmplt_epu16_mask() {
let a = _mm256_set1_epi16(-2);
let b = _mm256_set1_epi16(-1);
let m = _mm256_cmplt_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmplt_epu16_mask() {
let a = _mm256_set1_epi16(-2);
let b = _mm256_set1_epi16(-1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmplt_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmplt_epu16_mask() {
let a = _mm_set1_epi16(-2);
let b = _mm_set1_epi16(-1);
let m = _mm_cmplt_epu16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmplt_epu16_mask() {
let a = _mm_set1_epi16(-2);
let b = _mm_set1_epi16(-1);
let mask = 0b01010101;
let r = _mm_mask_cmplt_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmplt_epu8_mask() {
let a = _mm512_set1_epi8(-2);
let b = _mm512_set1_epi8(-1);
let m = _mm512_cmplt_epu8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmplt_epu8_mask() {
let a = _mm512_set1_epi8(-2);
let b = _mm512_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmplt_epu8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmplt_epu8_mask() {
let a = _mm256_set1_epi8(-2);
let b = _mm256_set1_epi8(-1);
let m = _mm256_cmplt_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmplt_epu8_mask() {
let a = _mm256_set1_epi8(-2);
let b = _mm256_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmplt_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmplt_epu8_mask() {
let a = _mm_set1_epi8(-2);
let b = _mm_set1_epi8(-1);
let m = _mm_cmplt_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmplt_epu8_mask() {
let a = _mm_set1_epi8(-2);
let b = _mm_set1_epi8(-1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmplt_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmplt_epi16_mask() {
let a = _mm512_set1_epi16(-2);
let b = _mm512_set1_epi16(-1);
let m = _mm512_cmplt_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmplt_epi16_mask() {
let a = _mm512_set1_epi16(-2);
let b = _mm512_set1_epi16(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmplt_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmplt_epi16_mask() {
let a = _mm256_set1_epi16(-2);
let b = _mm256_set1_epi16(-1);
let m = _mm256_cmplt_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmplt_epi16_mask() {
let a = _mm256_set1_epi16(-2);
let b = _mm256_set1_epi16(-1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmplt_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmplt_epi16_mask() {
let a = _mm_set1_epi16(-2);
let b = _mm_set1_epi16(-1);
let m = _mm_cmplt_epi16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmplt_epi16_mask() {
let a = _mm_set1_epi16(-2);
let b = _mm_set1_epi16(-1);
let mask = 0b01010101;
let r = _mm_mask_cmplt_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmplt_epi8_mask() {
let a = _mm512_set1_epi8(-2);
let b = _mm512_set1_epi8(-1);
let m = _mm512_cmplt_epi8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmplt_epi8_mask() {
let a = _mm512_set1_epi8(-2);
let b = _mm512_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmplt_epi8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmplt_epi8_mask() {
let a = _mm256_set1_epi8(-2);
let b = _mm256_set1_epi8(-1);
let m = _mm256_cmplt_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmplt_epi8_mask() {
let a = _mm256_set1_epi8(-2);
let b = _mm256_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmplt_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmplt_epi8_mask() {
let a = _mm_set1_epi8(-2);
let b = _mm_set1_epi8(-1);
let m = _mm_cmplt_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmplt_epi8_mask() {
let a = _mm_set1_epi8(-2);
let b = _mm_set1_epi8(-1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmplt_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpgt_epu16_mask() {
let a = _mm512_set1_epi16(2);
let b = _mm512_set1_epi16(1);
let m = _mm512_cmpgt_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpgt_epu16_mask() {
let a = _mm512_set1_epi16(2);
let b = _mm512_set1_epi16(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpgt_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpgt_epu16_mask() {
let a = _mm256_set1_epi16(2);
let b = _mm256_set1_epi16(1);
let m = _mm256_cmpgt_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpgt_epu16_mask() {
let a = _mm256_set1_epi16(2);
let b = _mm256_set1_epi16(1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmpgt_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpgt_epu16_mask() {
let a = _mm_set1_epi16(2);
let b = _mm_set1_epi16(1);
let m = _mm_cmpgt_epu16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpgt_epu16_mask() {
let a = _mm_set1_epi16(2);
let b = _mm_set1_epi16(1);
let mask = 0b01010101;
let r = _mm_mask_cmpgt_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpgt_epu8_mask() {
let a = _mm512_set1_epi8(2);
let b = _mm512_set1_epi8(1);
let m = _mm512_cmpgt_epu8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpgt_epu8_mask() {
let a = _mm512_set1_epi8(2);
let b = _mm512_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpgt_epu8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpgt_epu8_mask() {
let a = _mm256_set1_epi8(2);
let b = _mm256_set1_epi8(1);
let m = _mm256_cmpgt_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpgt_epu8_mask() {
let a = _mm256_set1_epi8(2);
let b = _mm256_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmpgt_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpgt_epu8_mask() {
let a = _mm_set1_epi8(2);
let b = _mm_set1_epi8(1);
let m = _mm_cmpgt_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpgt_epu8_mask() {
let a = _mm_set1_epi8(2);
let b = _mm_set1_epi8(1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmpgt_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpgt_epi16_mask() {
let a = _mm512_set1_epi16(2);
let b = _mm512_set1_epi16(-1);
let m = _mm512_cmpgt_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpgt_epi16_mask() {
let a = _mm512_set1_epi16(2);
let b = _mm512_set1_epi16(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpgt_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpgt_epi16_mask() {
let a = _mm256_set1_epi16(2);
let b = _mm256_set1_epi16(-1);
let m = _mm256_cmpgt_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpgt_epi16_mask() {
let a = _mm256_set1_epi16(2);
let b = _mm256_set1_epi16(-1);
let mask = 0b001010101_01010101;
let r = _mm256_mask_cmpgt_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpgt_epi16_mask() {
let a = _mm_set1_epi16(2);
let b = _mm_set1_epi16(-1);
let m = _mm_cmpgt_epi16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpgt_epi16_mask() {
let a = _mm_set1_epi16(2);
let b = _mm_set1_epi16(-1);
let mask = 0b01010101;
let r = _mm_mask_cmpgt_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpgt_epi8_mask() {
let a = _mm512_set1_epi8(2);
let b = _mm512_set1_epi8(-1);
let m = _mm512_cmpgt_epi8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpgt_epi8_mask() {
let a = _mm512_set1_epi8(2);
let b = _mm512_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpgt_epi8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpgt_epi8_mask() {
let a = _mm256_set1_epi8(2);
let b = _mm256_set1_epi8(-1);
let m = _mm256_cmpgt_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpgt_epi8_mask() {
let a = _mm256_set1_epi8(2);
let b = _mm256_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmpgt_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpgt_epi8_mask() {
let a = _mm_set1_epi8(2);
let b = _mm_set1_epi8(-1);
let m = _mm_cmpgt_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpgt_epi8_mask() {
let a = _mm_set1_epi8(2);
let b = _mm_set1_epi8(-1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmpgt_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmple_epu16_mask() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(-1);
let m = _mm512_cmple_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmple_epu16_mask() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmple_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmple_epu16_mask() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(-1);
let m = _mm256_cmple_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmple_epu16_mask() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(-1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmple_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmple_epu16_mask() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(-1);
let m = _mm_cmple_epu16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmple_epu16_mask() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(-1);
let mask = 0b01010101;
let r = _mm_mask_cmple_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmple_epu8_mask() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(-1);
let m = _mm512_cmple_epu8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmple_epu8_mask() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmple_epu8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmple_epu8_mask() {
let a = _mm256_set1_epi8(-1);
let b = _mm256_set1_epi8(-1);
let m = _mm256_cmple_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmple_epu8_mask() {
let a = _mm256_set1_epi8(-1);
let b = _mm256_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmple_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmple_epu8_mask() {
let a = _mm_set1_epi8(-1);
let b = _mm_set1_epi8(-1);
let m = _mm_cmple_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmple_epu8_mask() {
let a = _mm_set1_epi8(-1);
let b = _mm_set1_epi8(-1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmple_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmple_epi16_mask() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(-1);
let m = _mm512_cmple_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmple_epi16_mask() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmple_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmple_epi16_mask() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(-1);
let m = _mm256_cmple_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmple_epi16_mask() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(-1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmple_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmple_epi16_mask() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(-1);
let m = _mm_cmple_epi16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmple_epi16_mask() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(-1);
let mask = 0b01010101;
let r = _mm_mask_cmple_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmple_epi8_mask() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(-1);
let m = _mm512_cmple_epi8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmple_epi8_mask() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmple_epi8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmple_epi8_mask() {
let a = _mm256_set1_epi8(-1);
let b = _mm256_set1_epi8(-1);
let m = _mm256_cmple_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmple_epi8_mask() {
let a = _mm256_set1_epi8(-1);
let b = _mm256_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmple_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmple_epi8_mask() {
let a = _mm_set1_epi8(-1);
let b = _mm_set1_epi8(-1);
let m = _mm_cmple_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmple_epi8_mask() {
let a = _mm_set1_epi8(-1);
let b = _mm_set1_epi8(-1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmple_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpge_epu16_mask() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let m = _mm512_cmpge_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpge_epu16_mask() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpge_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpge_epu16_mask() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let m = _mm256_cmpge_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpge_epu16_mask() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmpge_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpge_epu16_mask() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let m = _mm_cmpge_epu16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpge_epu16_mask() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let mask = 0b01010101;
let r = _mm_mask_cmpge_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpge_epu8_mask() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(1);
let m = _mm512_cmpge_epu8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpge_epu8_mask() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpge_epu8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpge_epu8_mask() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(1);
let m = _mm256_cmpge_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpge_epu8_mask() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmpge_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpge_epu8_mask() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(1);
let m = _mm_cmpge_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpge_epu8_mask() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmpge_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpge_epi16_mask() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(-1);
let m = _mm512_cmpge_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpge_epi16_mask() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpge_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpge_epi16_mask() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(-1);
let m = _mm256_cmpge_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpge_epi16_mask() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(-1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmpge_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpge_epi16_mask() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(-1);
let m = _mm_cmpge_epi16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpge_epi16_mask() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(-1);
let mask = 0b01010101;
let r = _mm_mask_cmpge_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpge_epi8_mask() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(-1);
let m = _mm512_cmpge_epi8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpge_epi8_mask() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpge_epi8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpge_epi8_mask() {
let a = _mm256_set1_epi8(-1);
let b = _mm256_set1_epi8(-1);
let m = _mm256_cmpge_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpge_epi8_mask() {
let a = _mm256_set1_epi8(-1);
let b = _mm256_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmpge_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpge_epi8_mask() {
let a = _mm_set1_epi8(-1);
let b = _mm_set1_epi8(-1);
let m = _mm_cmpge_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpge_epi8_mask() {
let a = _mm_set1_epi8(-1);
let b = _mm_set1_epi8(-1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmpge_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpeq_epu16_mask() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let m = _mm512_cmpeq_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpeq_epu16_mask() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpeq_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpeq_epu16_mask() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let m = _mm256_cmpeq_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpeq_epu16_mask() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmpeq_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpeq_epu16_mask() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let m = _mm_cmpeq_epu16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpeq_epu16_mask() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let mask = 0b01010101;
let r = _mm_mask_cmpeq_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpeq_epu8_mask() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(1);
let m = _mm512_cmpeq_epu8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpeq_epu8_mask() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpeq_epu8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpeq_epu8_mask() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(1);
let m = _mm256_cmpeq_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpeq_epu8_mask() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmpeq_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpeq_epu8_mask() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(1);
let m = _mm_cmpeq_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpeq_epu8_mask() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmpeq_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpeq_epi16_mask() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(-1);
let m = _mm512_cmpeq_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpeq_epi16_mask() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpeq_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpeq_epi16_mask() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(-1);
let m = _mm256_cmpeq_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpeq_epi16_mask() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(-1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmpeq_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpeq_epi16_mask() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(-1);
let m = _mm_cmpeq_epi16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpeq_epi16_mask() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(-1);
let mask = 0b01010101;
let r = _mm_mask_cmpeq_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpeq_epi8_mask() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(-1);
let m = _mm512_cmpeq_epi8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpeq_epi8_mask() {
let a = _mm512_set1_epi8(-1);
let b = _mm512_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpeq_epi8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpeq_epi8_mask() {
let a = _mm256_set1_epi8(-1);
let b = _mm256_set1_epi8(-1);
let m = _mm256_cmpeq_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpeq_epi8_mask() {
let a = _mm256_set1_epi8(-1);
let b = _mm256_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmpeq_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpeq_epi8_mask() {
let a = _mm_set1_epi8(-1);
let b = _mm_set1_epi8(-1);
let m = _mm_cmpeq_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpeq_epi8_mask() {
let a = _mm_set1_epi8(-1);
let b = _mm_set1_epi8(-1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmpeq_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpneq_epu16_mask() {
let a = _mm512_set1_epi16(2);
let b = _mm512_set1_epi16(1);
let m = _mm512_cmpneq_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpneq_epu16_mask() {
let a = _mm512_set1_epi16(2);
let b = _mm512_set1_epi16(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpneq_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpneq_epu16_mask() {
let a = _mm256_set1_epi16(2);
let b = _mm256_set1_epi16(1);
let m = _mm256_cmpneq_epu16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpneq_epu16_mask() {
let a = _mm256_set1_epi16(2);
let b = _mm256_set1_epi16(1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmpneq_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpneq_epu16_mask() {
let a = _mm_set1_epi16(2);
let b = _mm_set1_epi16(1);
let m = _mm_cmpneq_epu16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpneq_epu16_mask() {
let a = _mm_set1_epi16(2);
let b = _mm_set1_epi16(1);
let mask = 0b01010101;
let r = _mm_mask_cmpneq_epu16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpneq_epu8_mask() {
let a = _mm512_set1_epi8(2);
let b = _mm512_set1_epi8(1);
let m = _mm512_cmpneq_epu8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpneq_epu8_mask() {
let a = _mm512_set1_epi8(2);
let b = _mm512_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpneq_epu8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpneq_epu8_mask() {
let a = _mm256_set1_epi8(2);
let b = _mm256_set1_epi8(1);
let m = _mm256_cmpneq_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpneq_epu8_mask() {
let a = _mm256_set1_epi8(2);
let b = _mm256_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmpneq_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpneq_epu8_mask() {
let a = _mm_set1_epi8(2);
let b = _mm_set1_epi8(1);
let m = _mm_cmpneq_epu8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpneq_epu8_mask() {
let a = _mm_set1_epi8(2);
let b = _mm_set1_epi8(1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmpneq_epu8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpneq_epi16_mask() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(-1);
let m = _mm512_cmpneq_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpneq_epi16_mask() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpneq_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpneq_epi16_mask() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(-1);
let m = _mm256_cmpneq_epi16_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpneq_epi16_mask() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(-1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmpneq_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpneq_epi16_mask() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(-1);
let m = _mm_cmpneq_epi16_mask(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpneq_epi16_mask() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(-1);
let mask = 0b01010101;
let r = _mm_mask_cmpneq_epi16_mask(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmpneq_epi8_mask() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(-1);
let m = _mm512_cmpneq_epi8_mask(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmpneq_epi8_mask() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmpneq_epi8_mask(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmpneq_epi8_mask() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(-1);
let m = _mm256_cmpneq_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmpneq_epi8_mask() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(-1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmpneq_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmpneq_epi8_mask() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(-1);
let m = _mm_cmpneq_epi8_mask(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmpneq_epi8_mask() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(-1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmpneq_epi8_mask(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmp_epu16_mask() {
let a = _mm512_set1_epi16(0);
let b = _mm512_set1_epi16(1);
let m = _mm512_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmp_epu16_mask() {
let a = _mm512_set1_epi16(0);
let b = _mm512_set1_epi16(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmp_epu16_mask() {
let a = _mm256_set1_epi16(0);
let b = _mm256_set1_epi16(1);
let m = _mm256_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmp_epu16_mask() {
let a = _mm256_set1_epi16(0);
let b = _mm256_set1_epi16(1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmp_epu16_mask() {
let a = _mm_set1_epi16(0);
let b = _mm_set1_epi16(1);
let m = _mm_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmp_epu16_mask() {
let a = _mm_set1_epi16(0);
let b = _mm_set1_epi16(1);
let mask = 0b01010101;
let r = _mm_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmp_epu8_mask() {
let a = _mm512_set1_epi8(0);
let b = _mm512_set1_epi8(1);
let m = _mm512_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmp_epu8_mask() {
let a = _mm512_set1_epi8(0);
let b = _mm512_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmp_epu8_mask() {
let a = _mm256_set1_epi8(0);
let b = _mm256_set1_epi8(1);
let m = _mm256_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmp_epu8_mask() {
let a = _mm256_set1_epi8(0);
let b = _mm256_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmp_epu8_mask() {
let a = _mm_set1_epi8(0);
let b = _mm_set1_epi8(1);
let m = _mm_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmp_epu8_mask() {
let a = _mm_set1_epi8(0);
let b = _mm_set1_epi8(1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmp_epi16_mask() {
let a = _mm512_set1_epi16(0);
let b = _mm512_set1_epi16(1);
let m = _mm512_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmp_epi16_mask() {
let a = _mm512_set1_epi16(0);
let b = _mm512_set1_epi16(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmp_epi16_mask() {
let a = _mm256_set1_epi16(0);
let b = _mm256_set1_epi16(1);
let m = _mm256_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmp_epi16_mask() {
let a = _mm256_set1_epi16(0);
let b = _mm256_set1_epi16(1);
let mask = 0b01010101_01010101;
let r = _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmp_epi16_mask() {
let a = _mm_set1_epi16(0);
let b = _mm_set1_epi16(1);
let m = _mm_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(m, 0b11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmp_epi16_mask() {
let a = _mm_set1_epi16(0);
let b = _mm_set1_epi16(1);
let mask = 0b01010101;
let r = _mm_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(r, 0b01010101);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cmp_epi8_mask() {
let a = _mm512_set1_epi8(0);
let b = _mm512_set1_epi8(1);
let m = _mm512_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(
m,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111
);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cmp_epi8_mask() {
let a = _mm512_set1_epi8(0);
let b = _mm512_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101;
let r = _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(
r,
0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101
);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cmp_epi8_mask() {
let a = _mm256_set1_epi8(0);
let b = _mm256_set1_epi8(1);
let m = _mm256_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(m, 0b11111111_11111111_11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cmp_epi8_mask() {
let a = _mm256_set1_epi8(0);
let b = _mm256_set1_epi8(1);
let mask = 0b01010101_01010101_01010101_01010101;
let r = _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(r, 0b01010101_01010101_01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cmp_epi8_mask() {
let a = _mm_set1_epi8(0);
let b = _mm_set1_epi8(1);
let m = _mm_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b);
assert_eq!(m, 0b11111111_11111111);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cmp_epi8_mask() {
let a = _mm_set1_epi8(0);
let b = _mm_set1_epi8(1);
let mask = 0b01010101_01010101;
let r = _mm_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(mask, a, b);
assert_eq!(r, 0b01010101_01010101);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_add_epi16() {
let a = _mm256_set1_epi16(1);
let e = _mm256_reduce_add_epi16(a);
assert_eq!(16, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_add_epi16() {
let a = _mm256_set1_epi16(1);
let e = _mm256_mask_reduce_add_epi16(0b11111111_00000000, a);
assert_eq!(8, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_add_epi16() {
let a = _mm_set1_epi16(1);
let e = _mm_reduce_add_epi16(a);
assert_eq!(8, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_add_epi16() {
let a = _mm_set1_epi16(1);
let e = _mm_mask_reduce_add_epi16(0b11110000, a);
assert_eq!(4, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_add_epi8() {
let a = _mm256_set1_epi8(1);
let e = _mm256_reduce_add_epi8(a);
assert_eq!(32, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_add_epi8() {
let a = _mm256_set1_epi8(1);
let e = _mm256_mask_reduce_add_epi8(0b11111111_00000000_11111111_00000000, a);
assert_eq!(16, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_add_epi8() {
let a = _mm_set1_epi8(1);
let e = _mm_reduce_add_epi8(a);
assert_eq!(16, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_add_epi8() {
let a = _mm_set1_epi8(1);
let e = _mm_mask_reduce_add_epi8(0b11111111_00000000, a);
assert_eq!(8, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_and_epi16() {
let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
let e = _mm256_reduce_and_epi16(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_and_epi16() {
let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
let e = _mm256_mask_reduce_and_epi16(0b11111111_00000000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_and_epi16() {
let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
let e = _mm_reduce_and_epi16(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_and_epi16() {
let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
let e = _mm_mask_reduce_and_epi16(0b11110000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_and_epi8() {
let a = _mm256_set_epi8(
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
2, 2, 2,
);
let e = _mm256_reduce_and_epi8(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_and_epi8() {
let a = _mm256_set_epi8(
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
2, 2, 2,
);
let e = _mm256_mask_reduce_and_epi8(0b11111111_00000000_11111111_00000000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_and_epi8() {
let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
let e = _mm_reduce_and_epi8(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_and_epi8() {
let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
let e = _mm_mask_reduce_and_epi8(0b11111111_00000000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_mul_epi16() {
let a = _mm256_set_epi16(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
let e = _mm256_reduce_mul_epi16(a);
assert_eq!(256, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_mul_epi16() {
let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
let e = _mm256_mask_reduce_mul_epi16(0b11111111_00000000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_mul_epi16() {
let a = _mm_set_epi16(2, 2, 2, 2, 1, 1, 1, 1);
let e = _mm_reduce_mul_epi16(a);
assert_eq!(16, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_mul_epi16() {
let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
let e = _mm_mask_reduce_mul_epi16(0b11110000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_mul_epi8() {
let a = _mm256_set_epi8(
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2,
);
let e = _mm256_reduce_mul_epi8(a);
assert_eq!(64, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_mul_epi8() {
let a = _mm256_set_epi8(
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2,
);
let e = _mm256_mask_reduce_mul_epi8(0b11111111_00000000_11111111_00000000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_mul_epi8() {
let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2);
let e = _mm_reduce_mul_epi8(a);
assert_eq!(8, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_mul_epi8() {
let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2);
let e = _mm_mask_reduce_mul_epi8(0b11111111_00000000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_max_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: i16 = _mm256_reduce_max_epi16(a);
assert_eq!(15, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_max_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: i16 = _mm256_mask_reduce_max_epi16(0b11111111_00000000, a);
assert_eq!(7, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_max_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let e: i16 = _mm_reduce_max_epi16(a);
assert_eq!(7, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_max_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let e: i16 = _mm_mask_reduce_max_epi16(0b11110000, a);
assert_eq!(3, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_max_epi8() {
let a = _mm256_set_epi8(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
);
let e: i8 = _mm256_reduce_max_epi8(a);
assert_eq!(31, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_max_epi8() {
let a = _mm256_set_epi8(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
);
let e: i8 = _mm256_mask_reduce_max_epi8(0b1111111111111111_0000000000000000, a);
assert_eq!(15, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_max_epi8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: i8 = _mm_reduce_max_epi8(a);
assert_eq!(15, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_max_epi8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: i8 = _mm_mask_reduce_max_epi8(0b11111111_00000000, a);
assert_eq!(7, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_max_epu16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: u16 = _mm256_reduce_max_epu16(a);
assert_eq!(15, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_max_epu16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: u16 = _mm256_mask_reduce_max_epu16(0b11111111_00000000, a);
assert_eq!(7, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_max_epu16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let e: u16 = _mm_reduce_max_epu16(a);
assert_eq!(7, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_max_epu16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let e: u16 = _mm_mask_reduce_max_epu16(0b11110000, a);
assert_eq!(3, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_max_epu8() {
let a = _mm256_set_epi8(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
);
let e: u8 = _mm256_reduce_max_epu8(a);
assert_eq!(31, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_max_epu8() {
let a = _mm256_set_epi8(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
);
let e: u8 = _mm256_mask_reduce_max_epu8(0b1111111111111111_0000000000000000, a);
assert_eq!(15, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_max_epu8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: u8 = _mm_reduce_max_epu8(a);
assert_eq!(15, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_max_epu8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: u8 = _mm_mask_reduce_max_epu8(0b11111111_00000000, a);
assert_eq!(7, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_min_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: i16 = _mm256_reduce_min_epi16(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_min_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: i16 = _mm256_mask_reduce_min_epi16(0b11111111_00000000, a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_min_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let e: i16 = _mm_reduce_min_epi16(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_min_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let e: i16 = _mm_mask_reduce_min_epi16(0b11110000, a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_min_epi8() {
let a = _mm256_set_epi8(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
);
let e: i8 = _mm256_reduce_min_epi8(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_min_epi8() {
let a = _mm256_set_epi8(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
);
let e: i8 = _mm256_mask_reduce_min_epi8(0b1111111111111111_0000000000000000, a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_min_epi8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: i8 = _mm_reduce_min_epi8(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_min_epi8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: i8 = _mm_mask_reduce_min_epi8(0b11111111_00000000, a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_min_epu16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: u16 = _mm256_reduce_min_epu16(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_min_epu16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: u16 = _mm256_mask_reduce_min_epu16(0b11111111_00000000, a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_min_epu16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let e: u16 = _mm_reduce_min_epu16(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_min_epu16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let e: u16 = _mm_mask_reduce_min_epu16(0b11110000, a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_min_epu8() {
let a = _mm256_set_epi8(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
);
let e: u8 = _mm256_reduce_min_epu8(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_min_epu8() {
let a = _mm256_set_epi8(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
);
let e: u8 = _mm256_mask_reduce_min_epu8(0b1111111111111111_0000000000000000, a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_min_epu8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: u8 = _mm_reduce_min_epu8(a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_min_epu8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let e: u8 = _mm_mask_reduce_min_epu8(0b11111111_00000000, a);
assert_eq!(0, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_or_epi16() {
let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
let e = _mm256_reduce_or_epi16(a);
assert_eq!(3, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_or_epi16() {
let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
let e = _mm256_mask_reduce_or_epi16(0b11111111_00000000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_or_epi16() {
let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
let e = _mm_reduce_or_epi16(a);
assert_eq!(3, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_or_epi16() {
let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2);
let e = _mm_mask_reduce_or_epi16(0b11110000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_reduce_or_epi8() {
let a = _mm256_set_epi8(
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
2, 2, 2,
);
let e = _mm256_reduce_or_epi8(a);
assert_eq!(3, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_reduce_or_epi8() {
let a = _mm256_set_epi8(
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
2, 2, 2,
);
let e = _mm256_mask_reduce_or_epi8(0b11111111_00000000_11111111_00000000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_reduce_or_epi8() {
let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
let e = _mm_reduce_or_epi8(a);
assert_eq!(3, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_reduce_or_epi8() {
let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
let e = _mm_mask_reduce_or_epi8(0b11111111_00000000, a);
assert_eq!(1, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_loadu_epi16() {
#[rustfmt::skip]
let a: [i16; 32] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32];
let r = _mm512_loadu_epi16(&a[0]);
#[rustfmt::skip]
let e = _mm512_set_epi16(32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_loadu_epi16() {
let a: [i16; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let r = _mm256_loadu_epi16(&a[0]);
let e = _mm256_set_epi16(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_loadu_epi16() {
let a: [i16; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
let r = _mm_loadu_epi16(&a[0]);
let e = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_loadu_epi8() {
#[rustfmt::skip]
let a: [i8; 64] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32];
let r = _mm512_loadu_epi8(&a[0]);
#[rustfmt::skip]
let e = _mm512_set_epi8(32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_loadu_epi8() {
#[rustfmt::skip]
let a: [i8; 32] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32];
let r = _mm256_loadu_epi8(&a[0]);
#[rustfmt::skip]
let e = _mm256_set_epi8(32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_loadu_epi8() {
let a: [i8; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let r = _mm_loadu_epi8(&a[0]);
let e = _mm_set_epi8(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_storeu_epi16() {
let a = _mm512_set1_epi16(9);
let mut r = _mm512_undefined_epi32();
_mm512_storeu_epi16(&mut r as *mut _ as *mut i16, a);
assert_eq_m512i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_storeu_epi16() {
let a = _mm256_set1_epi16(9);
let mut r = _mm256_set1_epi32(0);
_mm256_storeu_epi16(&mut r as *mut _ as *mut i16, a);
assert_eq_m256i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_storeu_epi16() {
let a = _mm_set1_epi16(9);
let mut r = _mm_set1_epi32(0);
_mm_storeu_epi16(&mut r as *mut _ as *mut i16, a);
assert_eq_m128i(r, a);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_storeu_epi8() {
let a = _mm512_set1_epi8(9);
let mut r = _mm512_undefined_epi32();
_mm512_storeu_epi8(&mut r as *mut _ as *mut i8, a);
assert_eq_m512i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_storeu_epi8() {
let a = _mm256_set1_epi8(9);
let mut r = _mm256_set1_epi32(0);
_mm256_storeu_epi8(&mut r as *mut _ as *mut i8, a);
assert_eq_m256i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_storeu_epi8() {
let a = _mm_set1_epi8(9);
let mut r = _mm_set1_epi32(0);
_mm_storeu_epi8(&mut r as *mut _ as *mut i8, a);
assert_eq_m128i(r, a);
}
#[simd_test(enable = "avx512f,avx512bw")]
unsafe fn test_mm512_mask_loadu_epi16() {
let src = _mm512_set1_epi16(42);
let a = &[
1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32,
];
let p = a.as_ptr();
let m = 0b10101010_11001100_11101000_11001010;
let r = _mm512_mask_loadu_epi16(src, m, black_box(p));
let e = &[
42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
];
let e = _mm512_loadu_epi16(e.as_ptr());
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw")]
unsafe fn test_mm512_maskz_loadu_epi16() {
let a = &[
1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32,
];
let p = a.as_ptr();
let m = 0b10101010_11001100_11101000_11001010;
let r = _mm512_maskz_loadu_epi16(m, black_box(p));
let e = &[
0_i16, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16, 0, 0, 19, 20, 0, 0, 23, 24, 0,
26, 0, 28, 0, 30, 0, 32,
];
let e = _mm512_loadu_epi16(e.as_ptr());
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw")]
unsafe fn test_mm512_mask_storeu_epi16() {
let mut r = [42_i16; 32];
let a = &[
1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32,
];
let a = _mm512_loadu_epi16(a.as_ptr());
let m = 0b10101010_11001100_11101000_11001010;
_mm512_mask_storeu_epi16(r.as_mut_ptr(), m, a);
let e = &[
42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
];
let e = _mm512_loadu_epi16(e.as_ptr());
assert_eq_m512i(_mm512_loadu_epi16(r.as_ptr()), e);
}
#[simd_test(enable = "avx512f,avx512bw")]
unsafe fn test_mm512_mask_loadu_epi8() {
let src = _mm512_set1_epi8(42);
let a = &[
1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
];
let p = a.as_ptr();
let m = 0b00000000_11111111_11111111_00000000_10101010_11001100_11101000_11001010;
let r = _mm512_mask_loadu_epi8(src, m, black_box(p));
let e = &[
42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
23, 24, 42, 26, 42, 28, 42, 30, 42, 32, 42, 42, 42, 42, 42, 42, 42, 42, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 42, 42, 42, 42, 42, 42, 42, 42,
];
let e = _mm512_loadu_epi8(e.as_ptr());
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw")]
unsafe fn test_mm512_maskz_loadu_epi8() {
let a = &[
1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
];
let p = a.as_ptr();
let m = 0b00000000_11111111_11111111_00000000_10101010_11001100_11101000_11001010;
let r = _mm512_maskz_loadu_epi8(m, black_box(p));
let e = &[
0_i8, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16, 0, 0, 19, 20, 0, 0, 23, 24, 0,
26, 0, 28, 0, 30, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 0, 0, 0, 0, 0, 0, 0, 0,
];
let e = _mm512_loadu_epi8(e.as_ptr());
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw")]
unsafe fn test_mm512_mask_storeu_epi8() {
let mut r = [42_i8; 64];
let a = &[
1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
];
let a = _mm512_loadu_epi8(a.as_ptr());
let m = 0b00000000_11111111_11111111_00000000_10101010_11001100_11101000_11001010;
_mm512_mask_storeu_epi8(r.as_mut_ptr(), m, a);
let e = &[
42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
23, 24, 42, 26, 42, 28, 42, 30, 42, 32, 42, 42, 42, 42, 42, 42, 42, 42, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 42, 42, 42, 42, 42, 42, 42, 42,
];
let e = _mm512_loadu_epi8(e.as_ptr());
assert_eq_m512i(_mm512_loadu_epi8(r.as_ptr()), e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm256_mask_loadu_epi16() {
let src = _mm256_set1_epi16(42);
let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let p = a.as_ptr();
let m = 0b11101000_11001010;
let r = _mm256_mask_loadu_epi16(src, m, black_box(p));
let e = &[
42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
];
let e = _mm256_loadu_epi16(e.as_ptr());
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_loadu_epi16() {
let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let p = a.as_ptr();
let m = 0b11101000_11001010;
let r = _mm256_maskz_loadu_epi16(m, black_box(p));
let e = &[0_i16, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16];
let e = _mm256_loadu_epi16(e.as_ptr());
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm256_mask_storeu_epi16() {
let mut r = [42_i16; 16];
let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let a = _mm256_loadu_epi16(a.as_ptr());
let m = 0b11101000_11001010;
_mm256_mask_storeu_epi16(r.as_mut_ptr(), m, a);
let e = &[
42_i16, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
];
let e = _mm256_loadu_epi16(e.as_ptr());
assert_eq_m256i(_mm256_loadu_epi16(r.as_ptr()), e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm256_mask_loadu_epi8() {
let src = _mm256_set1_epi8(42);
let a = &[
1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32,
];
let p = a.as_ptr();
let m = 0b10101010_11001100_11101000_11001010;
let r = _mm256_mask_loadu_epi8(src, m, black_box(p));
let e = &[
42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
];
let e = _mm256_loadu_epi8(e.as_ptr());
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_loadu_epi8() {
let a = &[
1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32,
];
let p = a.as_ptr();
let m = 0b10101010_11001100_11101000_11001010;
let r = _mm256_maskz_loadu_epi8(m, black_box(p));
let e = &[
0_i8, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16, 0, 0, 19, 20, 0, 0, 23, 24, 0,
26, 0, 28, 0, 30, 0, 32,
];
let e = _mm256_loadu_epi8(e.as_ptr());
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm256_mask_storeu_epi8() {
let mut r = [42_i8; 32];
let a = &[
1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32,
];
let a = _mm256_loadu_epi8(a.as_ptr());
let m = 0b10101010_11001100_11101000_11001010;
_mm256_mask_storeu_epi8(r.as_mut_ptr(), m, a);
let e = &[
42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16, 42, 42, 19, 20, 42, 42,
23, 24, 42, 26, 42, 28, 42, 30, 42, 32,
];
let e = _mm256_loadu_epi8(e.as_ptr());
assert_eq_m256i(_mm256_loadu_epi8(r.as_ptr()), e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm_mask_loadu_epi16() {
let src = _mm_set1_epi16(42);
let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8];
let p = a.as_ptr();
let m = 0b11001010;
let r = _mm_mask_loadu_epi16(src, m, black_box(p));
let e = &[42_i16, 2, 42, 4, 42, 42, 7, 8];
let e = _mm_loadu_epi16(e.as_ptr());
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm_maskz_loadu_epi16() {
let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8];
let p = a.as_ptr();
let m = 0b11001010;
let r = _mm_maskz_loadu_epi16(m, black_box(p));
let e = &[0_i16, 2, 0, 4, 0, 0, 7, 8];
let e = _mm_loadu_epi16(e.as_ptr());
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm_mask_storeu_epi16() {
let mut r = [42_i16; 8];
let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8];
let a = _mm_loadu_epi16(a.as_ptr());
let m = 0b11001010;
_mm_mask_storeu_epi16(r.as_mut_ptr(), m, a);
let e = &[42_i16, 2, 42, 4, 42, 42, 7, 8];
let e = _mm_loadu_epi16(e.as_ptr());
assert_eq_m128i(_mm_loadu_epi16(r.as_ptr()), e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm_mask_loadu_epi8() {
let src = _mm_set1_epi8(42);
let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let p = a.as_ptr();
let m = 0b11101000_11001010;
let r = _mm_mask_loadu_epi8(src, m, black_box(p));
let e = &[
42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
];
let e = _mm_loadu_epi8(e.as_ptr());
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm_maskz_loadu_epi8() {
let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let p = a.as_ptr();
let m = 0b11101000_11001010;
let r = _mm_maskz_loadu_epi8(m, black_box(p));
let e = &[0_i8, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16];
let e = _mm_loadu_epi8(e.as_ptr());
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512f,avx512bw,avx512vl")]
unsafe fn test_mm_mask_storeu_epi8() {
let mut r = [42_i8; 16];
let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let a = _mm_loadu_epi8(a.as_ptr());
let m = 0b11101000_11001010;
_mm_mask_storeu_epi8(r.as_mut_ptr(), m, a);
let e = &[
42_i8, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16,
];
let e = _mm_loadu_epi8(e.as_ptr());
assert_eq_m128i(_mm_loadu_epi8(r.as_ptr()), e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_madd_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_madd_epi16(a, b);
let e = _mm512_set1_epi32(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_madd_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_mask_madd_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_madd_epi16(a, 0b00000000_00001111, a, b);
let e = _mm512_set_epi32(
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
2,
2,
2,
2,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_madd_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_maskz_madd_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_madd_epi16(0b00000000_00001111, a, b);
let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_madd_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_mask_madd_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_madd_epi16(a, 0b00001111, a, b);
let e = _mm256_set_epi32(
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
1 << 16 | 1,
2,
2,
2,
2,
);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_madd_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_maskz_madd_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_madd_epi16(0b00001111, a, b);
let e = _mm256_set_epi32(0, 0, 0, 0, 2, 2, 2, 2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_madd_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_mask_madd_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_madd_epi16(a, 0b00001111, a, b);
let e = _mm_set_epi32(2, 2, 2, 2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_madd_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_maskz_madd_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_madd_epi16(0b00001111, a, b);
let e = _mm_set_epi32(2, 2, 2, 2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maddubs_epi16() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(1);
let r = _mm512_maddubs_epi16(a, b);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_maddubs_epi16() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(1);
let src = _mm512_set1_epi16(1);
let r = _mm512_mask_maddubs_epi16(src, 0, a, b);
assert_eq_m512i(r, src);
let r = _mm512_mask_add_epi16(src, 0b00000000_00000000_00000000_00000001, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1<<9|2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_maddubs_epi16() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(1);
let r = _mm512_maskz_maddubs_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_maddubs_epi16(0b00000000_11111111_00000000_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2,
0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_maddubs_epi16() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(1);
let src = _mm256_set1_epi16(1);
let r = _mm256_mask_maddubs_epi16(src, 0, a, b);
assert_eq_m256i(r, src);
let r = _mm256_mask_add_epi16(src, 0b00000000_00000001, a, b);
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 9 | 2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_maddubs_epi16() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(1);
let r = _mm256_maskz_maddubs_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_maddubs_epi16(0b00000000_11111111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_maddubs_epi16() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(1);
let src = _mm_set1_epi16(1);
let r = _mm_mask_maddubs_epi16(src, 0, a, b);
assert_eq_m128i(r, src);
let r = _mm_mask_add_epi16(src, 0b00000001, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, 1, 1, 1, 1 << 9 | 2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_maddubs_epi16() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(1);
let r = _mm_maskz_maddubs_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_maddubs_epi16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 2, 2, 2, 2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_packs_epi32() {
let a = _mm512_set1_epi32(i32::MAX);
let b = _mm512_set1_epi32(1);
let r = _mm512_packs_epi32(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX,
1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_packs_epi32() {
let a = _mm512_set1_epi32(i32::MAX);
let b = _mm512_set1_epi32(1 << 16 | 1);
let r = _mm512_mask_packs_epi32(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_packs_epi32(b, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_packs_epi32() {
let a = _mm512_set1_epi32(i32::MAX);
let b = _mm512_set1_epi32(1);
let r = _mm512_maskz_packs_epi32(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_packs_epi32(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_packs_epi32() {
let a = _mm256_set1_epi32(i32::MAX);
let b = _mm256_set1_epi32(1 << 16 | 1);
let r = _mm256_mask_packs_epi32(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_packs_epi32(b, 0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_packs_epi32() {
let a = _mm256_set1_epi32(i32::MAX);
let b = _mm256_set1_epi32(1);
let r = _mm256_maskz_packs_epi32(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_packs_epi32(0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_packs_epi32() {
let a = _mm_set1_epi32(i32::MAX);
let b = _mm_set1_epi32(1 << 16 | 1);
let r = _mm_mask_packs_epi32(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_packs_epi32(b, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_packs_epi32() {
let a = _mm_set1_epi32(i32::MAX);
let b = _mm_set1_epi32(1);
let r = _mm_maskz_packs_epi32(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_packs_epi32(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, i16::MAX, i16::MAX, i16::MAX, i16::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_packs_epi16() {
let a = _mm512_set1_epi16(i16::MAX);
let b = _mm512_set1_epi16(1);
let r = _mm512_packs_epi16(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_packs_epi16() {
let a = _mm512_set1_epi16(i16::MAX);
let b = _mm512_set1_epi16(1 << 8 | 1);
let r = _mm512_mask_packs_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_packs_epi16(
b,
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_packs_epi16() {
let a = _mm512_set1_epi16(i16::MAX);
let b = _mm512_set1_epi16(1);
let r = _mm512_maskz_packs_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_packs_epi16(
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_packs_epi16() {
let a = _mm256_set1_epi16(i16::MAX);
let b = _mm256_set1_epi16(1 << 8 | 1);
let r = _mm256_mask_packs_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_packs_epi16(b, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_packs_epi16() {
let a = _mm256_set1_epi16(i16::MAX);
let b = _mm256_set1_epi16(1);
let r = _mm256_maskz_packs_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_packs_epi16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_packs_epi16() {
let a = _mm_set1_epi16(i16::MAX);
let b = _mm_set1_epi16(1 << 8 | 1);
let r = _mm_mask_packs_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_packs_epi16(b, 0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_packs_epi16() {
let a = _mm_set1_epi16(i16::MAX);
let b = _mm_set1_epi16(1);
let r = _mm_maskz_packs_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_packs_epi16(0b00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_packus_epi32() {
let a = _mm512_set1_epi32(-1);
let b = _mm512_set1_epi32(1);
let r = _mm512_packus_epi32(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_packus_epi32() {
let a = _mm512_set1_epi32(-1);
let b = _mm512_set1_epi32(1 << 16 | 1);
let r = _mm512_mask_packus_epi32(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_packus_epi32(b, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_packus_epi32() {
let a = _mm512_set1_epi32(-1);
let b = _mm512_set1_epi32(1);
let r = _mm512_maskz_packus_epi32(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_packus_epi32(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_packus_epi32() {
let a = _mm256_set1_epi32(-1);
let b = _mm256_set1_epi32(1 << 16 | 1);
let r = _mm256_mask_packus_epi32(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_packus_epi32(b, 0b00000000_00001111, a, b);
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_packus_epi32() {
let a = _mm256_set1_epi32(-1);
let b = _mm256_set1_epi32(1);
let r = _mm256_maskz_packus_epi32(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_packus_epi32(0b00000000_00001111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_packus_epi32() {
let a = _mm_set1_epi32(-1);
let b = _mm_set1_epi32(1 << 16 | 1);
let r = _mm_mask_packus_epi32(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_packus_epi32(b, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_packus_epi32() {
let a = _mm_set1_epi32(-1);
let b = _mm_set1_epi32(1);
let r = _mm_maskz_packus_epi32(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_packus_epi32(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_packus_epi16() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(1);
let r = _mm512_packus_epi16(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_packus_epi16() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(1 << 8 | 1);
let r = _mm512_mask_packus_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_packus_epi16(
b,
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_packus_epi16() {
let a = _mm512_set1_epi16(-1);
let b = _mm512_set1_epi16(1);
let r = _mm512_maskz_packus_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_packus_epi16(
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_packus_epi16() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(1 << 8 | 1);
let r = _mm256_mask_packus_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_packus_epi16(b, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_packus_epi16() {
let a = _mm256_set1_epi16(-1);
let b = _mm256_set1_epi16(1);
let r = _mm256_maskz_packus_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_packus_epi16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_packus_epi16() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(1 << 8 | 1);
let r = _mm_mask_packus_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_packus_epi16(b, 0b00000000_00001111, a, b);
let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_packus_epi16() {
let a = _mm_set1_epi16(-1);
let b = _mm_set1_epi16(1);
let r = _mm_maskz_packus_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_packus_epi16(0b00000000_00001111, a, b);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_avg_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_avg_epu16(a, b);
let e = _mm512_set1_epi16(1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_avg_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_mask_avg_epu16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_avg_epu16(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_avg_epu16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(1);
let r = _mm512_maskz_avg_epu16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_avg_epu16(0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_avg_epu16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_mask_avg_epu16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_avg_epu16(a, 0b00000000_00001111, a, b);
let e = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_avg_epu16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(1);
let r = _mm256_maskz_avg_epu16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_avg_epu16(0b00000000_00001111, a, b);
let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_avg_epu16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_mask_avg_epu16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_avg_epu16(a, 0b00001111, a, b);
let e = _mm_set_epi16(1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_avg_epu16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(1);
let r = _mm_maskz_avg_epu16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_avg_epu16(0b00001111, a, b);
let e = _mm_set_epi16(0, 0, 0, 0, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_avg_epu8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(1);
let r = _mm512_avg_epu8(a, b);
let e = _mm512_set1_epi8(1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_avg_epu8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(1);
let r = _mm512_mask_avg_epu8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_avg_epu8(
a,
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_avg_epu8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(1);
let r = _mm512_maskz_avg_epu8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_avg_epu8(
0b00000000_000000000_00000000_00000000_00000000_0000000_00000000_00001111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_avg_epu8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(1);
let r = _mm256_mask_avg_epu8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_avg_epu8(a, 0b00000000_00000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_avg_epu8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(1);
let r = _mm256_maskz_avg_epu8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_avg_epu8(0b00000000_0000000_00000000_00001111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_avg_epu8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(1);
let r = _mm_mask_avg_epu8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_avg_epu8(a, 0b00000000_00001111, a, b);
let e = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_avg_epu8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(1);
let r = _mm_maskz_avg_epu8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_avg_epu8(0b00000000_00001111, a, b);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_sll_epi16() {
let a = _mm512_set1_epi16(1 << 15);
let count = _mm_set1_epi16(2);
let r = _mm512_sll_epi16(a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_sll_epi16() {
let a = _mm512_set1_epi16(1 << 15);
let count = _mm_set1_epi16(2);
let r = _mm512_mask_sll_epi16(a, 0, a, count);
assert_eq_m512i(r, a);
let r = _mm512_mask_sll_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_sll_epi16() {
let a = _mm512_set1_epi16(1 << 15);
let count = _mm_set1_epi16(2);
let r = _mm512_maskz_sll_epi16(0, a, count);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_sll_epi16(0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_sll_epi16() {
let a = _mm256_set1_epi16(1 << 15);
let count = _mm_set1_epi16(2);
let r = _mm256_mask_sll_epi16(a, 0, a, count);
assert_eq_m256i(r, a);
let r = _mm256_mask_sll_epi16(a, 0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_sll_epi16() {
let a = _mm256_set1_epi16(1 << 15);
let count = _mm_set1_epi16(2);
let r = _mm256_maskz_sll_epi16(0, a, count);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_sll_epi16(0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_sll_epi16() {
let a = _mm_set1_epi16(1 << 15);
let count = _mm_set1_epi16(2);
let r = _mm_mask_sll_epi16(a, 0, a, count);
assert_eq_m128i(r, a);
let r = _mm_mask_sll_epi16(a, 0b11111111, a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_sll_epi16() {
let a = _mm_set1_epi16(1 << 15);
let count = _mm_set1_epi16(2);
let r = _mm_maskz_sll_epi16(0, a, count);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_sll_epi16(0b11111111, a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_slli_epi16() {
let a = _mm512_set1_epi16(1 << 15);
let r = _mm512_slli_epi16::<1>(a);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_slli_epi16() {
let a = _mm512_set1_epi16(1 << 15);
let r = _mm512_mask_slli_epi16::<1>(a, 0, a);
assert_eq_m512i(r, a);
let r = _mm512_mask_slli_epi16::<1>(a, 0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_slli_epi16() {
let a = _mm512_set1_epi16(1 << 15);
let r = _mm512_maskz_slli_epi16::<1>(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_slli_epi16::<1>(0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_slli_epi16() {
let a = _mm256_set1_epi16(1 << 15);
let r = _mm256_mask_slli_epi16::<1>(a, 0, a);
assert_eq_m256i(r, a);
let r = _mm256_mask_slli_epi16::<1>(a, 0b11111111_11111111, a);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_slli_epi16() {
let a = _mm256_set1_epi16(1 << 15);
let r = _mm256_maskz_slli_epi16::<1>(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_slli_epi16::<1>(0b11111111_11111111, a);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_slli_epi16() {
let a = _mm_set1_epi16(1 << 15);
let r = _mm_mask_slli_epi16::<1>(a, 0, a);
assert_eq_m128i(r, a);
let r = _mm_mask_slli_epi16::<1>(a, 0b11111111, a);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_slli_epi16() {
let a = _mm_set1_epi16(1 << 15);
let r = _mm_maskz_slli_epi16::<1>(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_slli_epi16::<1>(0b11111111, a);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_sllv_epi16() {
let a = _mm512_set1_epi16(1 << 15);
let count = _mm512_set1_epi16(2);
let r = _mm512_sllv_epi16(a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_sllv_epi16() {
let a = _mm512_set1_epi16(1 << 15);
let count = _mm512_set1_epi16(2);
let r = _mm512_mask_sllv_epi16(a, 0, a, count);
assert_eq_m512i(r, a);
let r = _mm512_mask_sllv_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_sllv_epi16() {
let a = _mm512_set1_epi16(1 << 15);
let count = _mm512_set1_epi16(2);
let r = _mm512_maskz_sllv_epi16(0, a, count);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_sllv_epi16(0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_sllv_epi16() {
let a = _mm256_set1_epi16(1 << 15);
let count = _mm256_set1_epi16(2);
let r = _mm256_sllv_epi16(a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_sllv_epi16() {
let a = _mm256_set1_epi16(1 << 15);
let count = _mm256_set1_epi16(2);
let r = _mm256_mask_sllv_epi16(a, 0, a, count);
assert_eq_m256i(r, a);
let r = _mm256_mask_sllv_epi16(a, 0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_sllv_epi16() {
let a = _mm256_set1_epi16(1 << 15);
let count = _mm256_set1_epi16(2);
let r = _mm256_maskz_sllv_epi16(0, a, count);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_sllv_epi16(0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_sllv_epi16() {
let a = _mm_set1_epi16(1 << 15);
let count = _mm_set1_epi16(2);
let r = _mm_sllv_epi16(a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_sllv_epi16() {
let a = _mm_set1_epi16(1 << 15);
let count = _mm_set1_epi16(2);
let r = _mm_mask_sllv_epi16(a, 0, a, count);
assert_eq_m128i(r, a);
let r = _mm_mask_sllv_epi16(a, 0b11111111, a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_sllv_epi16() {
let a = _mm_set1_epi16(1 << 15);
let count = _mm_set1_epi16(2);
let r = _mm_maskz_sllv_epi16(0, a, count);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_sllv_epi16(0b11111111, a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_srl_epi16() {
let a = _mm512_set1_epi16(1 << 1);
let count = _mm_set1_epi16(2);
let r = _mm512_srl_epi16(a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_srl_epi16() {
let a = _mm512_set1_epi16(1 << 1);
let count = _mm_set1_epi16(2);
let r = _mm512_mask_srl_epi16(a, 0, a, count);
assert_eq_m512i(r, a);
let r = _mm512_mask_srl_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_srl_epi16() {
let a = _mm512_set1_epi16(1 << 1);
let count = _mm_set1_epi16(2);
let r = _mm512_maskz_srl_epi16(0, a, count);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_srl_epi16(0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_srl_epi16() {
let a = _mm256_set1_epi16(1 << 1);
let count = _mm_set1_epi16(2);
let r = _mm256_mask_srl_epi16(a, 0, a, count);
assert_eq_m256i(r, a);
let r = _mm256_mask_srl_epi16(a, 0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_srl_epi16() {
let a = _mm256_set1_epi16(1 << 1);
let count = _mm_set1_epi16(2);
let r = _mm256_maskz_srl_epi16(0, a, count);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_srl_epi16(0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_srl_epi16() {
let a = _mm_set1_epi16(1 << 1);
let count = _mm_set1_epi16(2);
let r = _mm_mask_srl_epi16(a, 0, a, count);
assert_eq_m128i(r, a);
let r = _mm_mask_srl_epi16(a, 0b11111111, a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_srl_epi16() {
let a = _mm_set1_epi16(1 << 1);
let count = _mm_set1_epi16(2);
let r = _mm_maskz_srl_epi16(0, a, count);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_srl_epi16(0b11111111, a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_srli_epi16() {
let a = _mm512_set1_epi16(1 << 1);
let r = _mm512_srli_epi16::<2>(a);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_srli_epi16() {
let a = _mm512_set1_epi16(1 << 1);
let r = _mm512_mask_srli_epi16::<2>(a, 0, a);
assert_eq_m512i(r, a);
let r = _mm512_mask_srli_epi16::<2>(a, 0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_srli_epi16() {
let a = _mm512_set1_epi16(1 << 1);
let r = _mm512_maskz_srli_epi16::<2>(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_srli_epi16::<2>(0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_srli_epi16() {
let a = _mm256_set1_epi16(1 << 1);
let r = _mm256_mask_srli_epi16::<2>(a, 0, a);
assert_eq_m256i(r, a);
let r = _mm256_mask_srli_epi16::<2>(a, 0b11111111_11111111, a);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_srli_epi16() {
let a = _mm256_set1_epi16(1 << 1);
let r = _mm256_maskz_srli_epi16::<2>(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_srli_epi16::<2>(0b11111111_11111111, a);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_srli_epi16() {
let a = _mm_set1_epi16(1 << 1);
let r = _mm_mask_srli_epi16::<2>(a, 0, a);
assert_eq_m128i(r, a);
let r = _mm_mask_srli_epi16::<2>(a, 0b11111111, a);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_srli_epi16() {
let a = _mm_set1_epi16(1 << 1);
let r = _mm_maskz_srli_epi16::<2>(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_srli_epi16::<2>(0b11111111, a);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_srlv_epi16() {
let a = _mm512_set1_epi16(1 << 1);
let count = _mm512_set1_epi16(2);
let r = _mm512_srlv_epi16(a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_srlv_epi16() {
let a = _mm512_set1_epi16(1 << 1);
let count = _mm512_set1_epi16(2);
let r = _mm512_mask_srlv_epi16(a, 0, a, count);
assert_eq_m512i(r, a);
let r = _mm512_mask_srlv_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_srlv_epi16() {
let a = _mm512_set1_epi16(1 << 1);
let count = _mm512_set1_epi16(2);
let r = _mm512_maskz_srlv_epi16(0, a, count);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_srlv_epi16(0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_srlv_epi16() {
let a = _mm256_set1_epi16(1 << 1);
let count = _mm256_set1_epi16(2);
let r = _mm256_srlv_epi16(a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_srlv_epi16() {
let a = _mm256_set1_epi16(1 << 1);
let count = _mm256_set1_epi16(2);
let r = _mm256_mask_srlv_epi16(a, 0, a, count);
assert_eq_m256i(r, a);
let r = _mm256_mask_srlv_epi16(a, 0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_srlv_epi16() {
let a = _mm256_set1_epi16(1 << 1);
let count = _mm256_set1_epi16(2);
let r = _mm256_maskz_srlv_epi16(0, a, count);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_srlv_epi16(0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_srlv_epi16() {
let a = _mm_set1_epi16(1 << 1);
let count = _mm_set1_epi16(2);
let r = _mm_srlv_epi16(a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_srlv_epi16() {
let a = _mm_set1_epi16(1 << 1);
let count = _mm_set1_epi16(2);
let r = _mm_mask_srlv_epi16(a, 0, a, count);
assert_eq_m128i(r, a);
let r = _mm_mask_srlv_epi16(a, 0b11111111, a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_srlv_epi16() {
let a = _mm_set1_epi16(1 << 1);
let count = _mm_set1_epi16(2);
let r = _mm_maskz_srlv_epi16(0, a, count);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_srlv_epi16(0b11111111, a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_sra_epi16() {
let a = _mm512_set1_epi16(8);
let count = _mm_set1_epi16(1);
let r = _mm512_sra_epi16(a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_sra_epi16() {
let a = _mm512_set1_epi16(8);
let count = _mm_set1_epi16(1);
let r = _mm512_mask_sra_epi16(a, 0, a, count);
assert_eq_m512i(r, a);
let r = _mm512_mask_sra_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_sra_epi16() {
let a = _mm512_set1_epi16(8);
let count = _mm_set1_epi16(1);
let r = _mm512_maskz_sra_epi16(0, a, count);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_sra_epi16(0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_sra_epi16() {
let a = _mm256_set1_epi16(8);
let count = _mm_set1_epi16(1);
let r = _mm256_mask_sra_epi16(a, 0, a, count);
assert_eq_m256i(r, a);
let r = _mm256_mask_sra_epi16(a, 0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_sra_epi16() {
let a = _mm256_set1_epi16(8);
let count = _mm_set1_epi16(1);
let r = _mm256_maskz_sra_epi16(0, a, count);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_sra_epi16(0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_sra_epi16() {
let a = _mm_set1_epi16(8);
let count = _mm_set1_epi16(1);
let r = _mm_mask_sra_epi16(a, 0, a, count);
assert_eq_m128i(r, a);
let r = _mm_mask_sra_epi16(a, 0b11111111, a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_sra_epi16() {
let a = _mm_set1_epi16(8);
let count = _mm_set1_epi16(1);
let r = _mm_maskz_sra_epi16(0, a, count);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_sra_epi16(0b11111111, a, count);
let e = _mm_set1_epi16(0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_srai_epi16() {
let a = _mm512_set1_epi16(8);
let r = _mm512_srai_epi16::<2>(a);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_srai_epi16() {
let a = _mm512_set1_epi16(8);
let r = _mm512_mask_srai_epi16::<2>(a, 0, a);
assert_eq_m512i(r, a);
let r = _mm512_mask_srai_epi16::<2>(a, 0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_srai_epi16() {
let a = _mm512_set1_epi16(8);
let r = _mm512_maskz_srai_epi16::<2>(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_srai_epi16::<2>(0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_srai_epi16() {
let a = _mm256_set1_epi16(8);
let r = _mm256_mask_srai_epi16::<2>(a, 0, a);
assert_eq_m256i(r, a);
let r = _mm256_mask_srai_epi16::<2>(a, 0b11111111_11111111, a);
let e = _mm256_set1_epi16(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_srai_epi16() {
let a = _mm256_set1_epi16(8);
let r = _mm256_maskz_srai_epi16::<2>(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_srai_epi16::<2>(0b11111111_11111111, a);
let e = _mm256_set1_epi16(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_srai_epi16() {
let a = _mm_set1_epi16(8);
let r = _mm_mask_srai_epi16::<2>(a, 0, a);
assert_eq_m128i(r, a);
let r = _mm_mask_srai_epi16::<2>(a, 0b11111111, a);
let e = _mm_set1_epi16(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_srai_epi16() {
let a = _mm_set1_epi16(8);
let r = _mm_maskz_srai_epi16::<2>(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_srai_epi16::<2>(0b11111111, a);
let e = _mm_set1_epi16(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_srav_epi16() {
let a = _mm512_set1_epi16(8);
let count = _mm512_set1_epi16(2);
let r = _mm512_srav_epi16(a, count);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_srav_epi16() {
let a = _mm512_set1_epi16(8);
let count = _mm512_set1_epi16(2);
let r = _mm512_mask_srav_epi16(a, 0, a, count);
assert_eq_m512i(r, a);
let r = _mm512_mask_srav_epi16(a, 0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_srav_epi16() {
let a = _mm512_set1_epi16(8);
let count = _mm512_set1_epi16(2);
let r = _mm512_maskz_srav_epi16(0, a, count);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_srav_epi16(0b11111111_11111111_11111111_11111111, a, count);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_srav_epi16() {
let a = _mm256_set1_epi16(8);
let count = _mm256_set1_epi16(2);
let r = _mm256_srav_epi16(a, count);
let e = _mm256_set1_epi16(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_srav_epi16() {
let a = _mm256_set1_epi16(8);
let count = _mm256_set1_epi16(2);
let r = _mm256_mask_srav_epi16(a, 0, a, count);
assert_eq_m256i(r, a);
let r = _mm256_mask_srav_epi16(a, 0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_srav_epi16() {
let a = _mm256_set1_epi16(8);
let count = _mm256_set1_epi16(2);
let r = _mm256_maskz_srav_epi16(0, a, count);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_srav_epi16(0b11111111_11111111, a, count);
let e = _mm256_set1_epi16(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_srav_epi16() {
let a = _mm_set1_epi16(8);
let count = _mm_set1_epi16(2);
let r = _mm_srav_epi16(a, count);
let e = _mm_set1_epi16(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_srav_epi16() {
let a = _mm_set1_epi16(8);
let count = _mm_set1_epi16(2);
let r = _mm_mask_srav_epi16(a, 0, a, count);
assert_eq_m128i(r, a);
let r = _mm_mask_srav_epi16(a, 0b11111111, a, count);
let e = _mm_set1_epi16(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_srav_epi16() {
let a = _mm_set1_epi16(8);
let count = _mm_set1_epi16(2);
let r = _mm_maskz_srav_epi16(0, a, count);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_srav_epi16(0b11111111, a, count);
let e = _mm_set1_epi16(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_permutex2var_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
#[rustfmt::skip]
let idx = _mm512_set_epi16(1, 1<<5, 2, 1<<5, 3, 1<<5, 4, 1<<5, 5, 1<<5, 6, 1<<5, 7, 1<<5, 8, 1<<5,
9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
let b = _mm512_set1_epi16(100);
let r = _mm512_permutex2var_epi16(a, idx, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(
30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_permutex2var_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
#[rustfmt::skip]
let idx = _mm512_set_epi16(1, 1<<5, 2, 1<<5, 3, 1<<5, 4, 1<<5, 5, 1<<5, 6, 1<<5, 7, 1<<5, 8, 1<<5,
9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
let b = _mm512_set1_epi16(100);
let r = _mm512_mask_permutex2var_epi16(a, 0, idx, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_permutex2var_epi16(a, 0b11111111_11111111_11111111_11111111, idx, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(
30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_permutex2var_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
#[rustfmt::skip]
let idx = _mm512_set_epi16(1, 1<<5, 2, 1<<5, 3, 1<<5, 4, 1<<5, 5, 1<<5, 6, 1<<5, 7, 1<<5, 8, 1<<5,
9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
let b = _mm512_set1_epi16(100);
let r = _mm512_maskz_permutex2var_epi16(0, a, idx, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_permutex2var_epi16(0b11111111_11111111_11111111_11111111, a, idx, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(
30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask2_permutex2var_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
#[rustfmt::skip]
let idx = _mm512_set_epi16(1, 1<<5, 2, 1<<5, 3, 1<<5, 4, 1<<5, 5, 1<<5, 6, 1<<5, 7, 1<<5, 8, 1<<5,
9, 1<<5, 10, 1<<5, 11, 1<<5, 12, 1<<5, 13, 1<<5, 14, 1<<5, 15, 1<<5, 16, 1<<5);
let b = _mm512_set1_epi16(100);
let r = _mm512_mask2_permutex2var_epi16(a, idx, 0, b);
assert_eq_m512i(r, idx);
let r = _mm512_mask2_permutex2var_epi16(a, idx, 0b11111111_11111111_11111111_11111111, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(
30, 100, 29, 100, 28, 100, 27, 100, 26, 100, 25, 100, 24, 100, 23, 100,
22, 100, 21, 100, 20, 100, 19, 100, 18, 100, 17, 100, 16, 100, 15, 100,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_permutex2var_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4);
let b = _mm256_set1_epi16(100);
let r = _mm256_permutex2var_epi16(a, idx, b);
let e = _mm256_set_epi16(
14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_permutex2var_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4);
let b = _mm256_set1_epi16(100);
let r = _mm256_mask_permutex2var_epi16(a, 0, idx, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_permutex2var_epi16(a, 0b11111111_11111111, idx, b);
let e = _mm256_set_epi16(
14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_permutex2var_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4);
let b = _mm256_set1_epi16(100);
let r = _mm256_maskz_permutex2var_epi16(0, a, idx, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_permutex2var_epi16(0b11111111_11111111, a, idx, b);
let e = _mm256_set_epi16(
14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask2_permutex2var_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
#[rustfmt::skip]
let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4);
let b = _mm256_set1_epi16(100);
let r = _mm256_mask2_permutex2var_epi16(a, idx, 0, b);
assert_eq_m256i(r, idx);
let r = _mm256_mask2_permutex2var_epi16(a, idx, 0b11111111_11111111, b);
#[rustfmt::skip]
let e = _mm256_set_epi16(
14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_permutex2var_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
let b = _mm_set1_epi16(100);
let r = _mm_permutex2var_epi16(a, idx, b);
let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_permutex2var_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
let b = _mm_set1_epi16(100);
let r = _mm_mask_permutex2var_epi16(a, 0, idx, b);
assert_eq_m128i(r, a);
let r = _mm_mask_permutex2var_epi16(a, 0b11111111, idx, b);
let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_permutex2var_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
let b = _mm_set1_epi16(100);
let r = _mm_maskz_permutex2var_epi16(0, a, idx, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_permutex2var_epi16(0b11111111, a, idx, b);
let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask2_permutex2var_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
let b = _mm_set1_epi16(100);
let r = _mm_mask2_permutex2var_epi16(a, idx, 0, b);
assert_eq_m128i(r, idx);
let r = _mm_mask2_permutex2var_epi16(a, idx, 0b11111111, b);
let e = _mm_set_epi16(6, 100, 5, 100, 4, 100, 3, 100);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_permutexvar_epi16() {
let idx = _mm512_set1_epi16(1);
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
let r = _mm512_permutexvar_epi16(idx, a);
let e = _mm512_set1_epi16(30);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_permutexvar_epi16() {
let idx = _mm512_set1_epi16(1);
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
let r = _mm512_mask_permutexvar_epi16(a, 0, idx, a);
assert_eq_m512i(r, a);
let r = _mm512_mask_permutexvar_epi16(a, 0b11111111_11111111_11111111_11111111, idx, a);
let e = _mm512_set1_epi16(30);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_permutexvar_epi16() {
let idx = _mm512_set1_epi16(1);
#[rustfmt::skip]
let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
let r = _mm512_maskz_permutexvar_epi16(0, idx, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_permutexvar_epi16(0b11111111_11111111_11111111_11111111, idx, a);
let e = _mm512_set1_epi16(30);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_permutexvar_epi16() {
let idx = _mm256_set1_epi16(1);
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let r = _mm256_permutexvar_epi16(idx, a);
let e = _mm256_set1_epi16(14);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_permutexvar_epi16() {
let idx = _mm256_set1_epi16(1);
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let r = _mm256_mask_permutexvar_epi16(a, 0, idx, a);
assert_eq_m256i(r, a);
let r = _mm256_mask_permutexvar_epi16(a, 0b11111111_11111111, idx, a);
let e = _mm256_set1_epi16(14);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_permutexvar_epi16() {
let idx = _mm256_set1_epi16(1);
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let r = _mm256_maskz_permutexvar_epi16(0, idx, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_permutexvar_epi16(0b11111111_11111111, idx, a);
let e = _mm256_set1_epi16(14);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_permutexvar_epi16() {
let idx = _mm_set1_epi16(1);
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let r = _mm_permutexvar_epi16(idx, a);
let e = _mm_set1_epi16(6);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_permutexvar_epi16() {
let idx = _mm_set1_epi16(1);
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let r = _mm_mask_permutexvar_epi16(a, 0, idx, a);
assert_eq_m128i(r, a);
let r = _mm_mask_permutexvar_epi16(a, 0b11111111, idx, a);
let e = _mm_set1_epi16(6);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_permutexvar_epi16() {
let idx = _mm_set1_epi16(1);
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let r = _mm_maskz_permutexvar_epi16(0, idx, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_permutexvar_epi16(0b11111111, idx, a);
let e = _mm_set1_epi16(6);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_blend_epi16() {
let a = _mm512_set1_epi16(1);
let b = _mm512_set1_epi16(2);
let r = _mm512_mask_blend_epi16(0b11111111_00000000_11111111_00000000, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_blend_epi16() {
let a = _mm256_set1_epi16(1);
let b = _mm256_set1_epi16(2);
let r = _mm256_mask_blend_epi16(0b11111111_00000000, a, b);
let e = _mm256_set_epi16(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_blend_epi16() {
let a = _mm_set1_epi16(1);
let b = _mm_set1_epi16(2);
let r = _mm_mask_blend_epi16(0b11110000, a, b);
let e = _mm_set_epi16(2, 2, 2, 2, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_blend_epi8() {
let a = _mm512_set1_epi8(1);
let b = _mm512_set1_epi8(2);
let r = _mm512_mask_blend_epi8(
0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_blend_epi8() {
let a = _mm256_set1_epi8(1);
let b = _mm256_set1_epi8(2);
let r = _mm256_mask_blend_epi8(0b11111111_00000000_11111111_00000000, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_blend_epi8() {
let a = _mm_set1_epi8(1);
let b = _mm_set1_epi8(2);
let r = _mm_mask_blend_epi8(0b11111111_00000000, a, b);
let e = _mm_set_epi8(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_broadcastw_epi16() {
let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
let r = _mm512_broadcastw_epi16(a);
let e = _mm512_set1_epi16(24);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_broadcastw_epi16() {
let src = _mm512_set1_epi16(1);
let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
let r = _mm512_mask_broadcastw_epi16(src, 0, a);
assert_eq_m512i(r, src);
let r = _mm512_mask_broadcastw_epi16(src, 0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(24);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_broadcastw_epi16() {
let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
let r = _mm512_maskz_broadcastw_epi16(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_broadcastw_epi16(0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(24);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_broadcastw_epi16() {
let src = _mm256_set1_epi16(1);
let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
let r = _mm256_mask_broadcastw_epi16(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm256_mask_broadcastw_epi16(src, 0b11111111_11111111, a);
let e = _mm256_set1_epi16(24);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_broadcastw_epi16() {
let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
let r = _mm256_maskz_broadcastw_epi16(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_broadcastw_epi16(0b11111111_11111111, a);
let e = _mm256_set1_epi16(24);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_broadcastw_epi16() {
let src = _mm_set1_epi16(1);
let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
let r = _mm_mask_broadcastw_epi16(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_broadcastw_epi16(src, 0b11111111, a);
let e = _mm_set1_epi16(24);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_broadcastw_epi16() {
let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24);
let r = _mm_maskz_broadcastw_epi16(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_broadcastw_epi16(0b11111111, a);
let e = _mm_set1_epi16(24);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_broadcastb_epi8() {
let a = _mm_set_epi8(
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
);
let r = _mm512_broadcastb_epi8(a);
let e = _mm512_set1_epi8(32);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_broadcastb_epi8() {
let src = _mm512_set1_epi8(1);
let a = _mm_set_epi8(
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
);
let r = _mm512_mask_broadcastb_epi8(src, 0, a);
assert_eq_m512i(r, src);
let r = _mm512_mask_broadcastb_epi8(
src,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
);
let e = _mm512_set1_epi8(32);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_broadcastb_epi8() {
let a = _mm_set_epi8(
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
);
let r = _mm512_maskz_broadcastb_epi8(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_broadcastb_epi8(
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
);
let e = _mm512_set1_epi8(32);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_broadcastb_epi8() {
let src = _mm256_set1_epi8(1);
let a = _mm_set_epi8(
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
);
let r = _mm256_mask_broadcastb_epi8(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm256_mask_broadcastb_epi8(src, 0b11111111_11111111_11111111_11111111, a);
let e = _mm256_set1_epi8(32);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_broadcastb_epi8() {
let a = _mm_set_epi8(
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
);
let r = _mm256_maskz_broadcastb_epi8(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_broadcastb_epi8(0b11111111_11111111_11111111_11111111, a);
let e = _mm256_set1_epi8(32);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_broadcastb_epi8() {
let src = _mm_set1_epi8(1);
let a = _mm_set_epi8(
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
);
let r = _mm_mask_broadcastb_epi8(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_broadcastb_epi8(src, 0b11111111_11111111, a);
let e = _mm_set1_epi8(32);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_broadcastb_epi8() {
let a = _mm_set_epi8(
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
);
let r = _mm_maskz_broadcastb_epi8(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_broadcastb_epi8(0b11111111_11111111, a);
let e = _mm_set1_epi8(32);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_unpackhi_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
#[rustfmt::skip]
let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
let r = _mm512_unpackhi_epi16(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(33, 1, 34, 2, 35, 3, 36, 4, 41, 9, 42, 10, 43, 11, 44, 12,
49, 17, 50, 18, 51, 19, 52, 20, 57, 25, 58, 26, 59, 27, 60, 28);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_unpackhi_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
#[rustfmt::skip]
let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
let r = _mm512_mask_unpackhi_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_unpackhi_epi16(a, 0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(33, 1, 34, 2, 35, 3, 36, 4, 41, 9, 42, 10, 43, 11, 44, 12,
49, 17, 50, 18, 51, 19, 52, 20, 57, 25, 58, 26, 59, 27, 60, 28);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_unpackhi_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
#[rustfmt::skip]
let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
let r = _mm512_maskz_unpackhi_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_unpackhi_epi16(0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(33, 1, 34, 2, 35, 3, 36, 4, 41, 9, 42, 10, 43, 11, 44, 12,
49, 17, 50, 18, 51, 19, 52, 20, 57, 25, 58, 26, 59, 27, 60, 28);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_unpackhi_epi16() {
let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let b = _mm256_set_epi16(
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
);
let r = _mm256_mask_unpackhi_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_unpackhi_epi16(a, 0b11111111_11111111, a, b);
let e = _mm256_set_epi16(33, 1, 34, 2, 35, 3, 36, 4, 41, 9, 42, 10, 43, 11, 44, 12);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_unpackhi_epi16() {
let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let b = _mm256_set_epi16(
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
);
let r = _mm256_maskz_unpackhi_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_unpackhi_epi16(0b11111111_11111111, a, b);
let e = _mm256_set_epi16(33, 1, 34, 2, 35, 3, 36, 4, 41, 9, 42, 10, 43, 11, 44, 12);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_unpackhi_epi16() {
let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
let r = _mm_mask_unpackhi_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_unpackhi_epi16(a, 0b11111111, a, b);
let e = _mm_set_epi16(33, 1, 34, 2, 35, 3, 36, 4);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_unpackhi_epi16() {
let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
let r = _mm_maskz_unpackhi_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_unpackhi_epi16(0b11111111, a, b);
let e = _mm_set_epi16(33, 1, 34, 2, 35, 3, 36, 4);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_unpackhi_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
#[rustfmt::skip]
let b = _mm512_set_epi8(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
let r = _mm512_unpackhi_epi8(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8,
81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24,
97, 33, 98, 34, 99, 35, 100, 36, 101, 37, 102, 38, 103, 39, 104, 40,
113, 49, 114, 50, 115, 51, 116, 52, 117, 53, 118, 54, 119, 55, 120, 56);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_unpackhi_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
#[rustfmt::skip]
let b = _mm512_set_epi8(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
let r = _mm512_mask_unpackhi_epi8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_unpackhi_epi8(
a,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8,
81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24,
97, 33, 98, 34, 99, 35, 100, 36, 101, 37, 102, 38, 103, 39, 104, 40,
113, 49, 114, 50, 115, 51, 116, 52, 117, 53, 118, 54, 119, 55, 120, 56);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_unpackhi_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
#[rustfmt::skip]
let b = _mm512_set_epi8(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
let r = _mm512_maskz_unpackhi_epi8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_unpackhi_epi8(
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8,
81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24,
97, 33, 98, 34, 99, 35, 100, 36, 101, 37, 102, 38, 103, 39, 104, 40,
113, 49, 114, 50, 115, 51, 116, 52, 117, 53, 118, 54, 119, 55, 120, 56);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_unpackhi_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
#[rustfmt::skip]
let b = _mm256_set_epi8(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96);
let r = _mm256_mask_unpackhi_epi8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_unpackhi_epi8(a, 0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8,
81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_unpackhi_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
#[rustfmt::skip]
let b = _mm256_set_epi8(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96);
let r = _mm256_maskz_unpackhi_epi8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_unpackhi_epi8(0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8,
81, 17, 82, 18, 83, 19, 84, 20, 85, 21, 86, 22, 87, 23, 88, 24);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_unpackhi_epi8() {
let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let b = _mm_set_epi8(
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
);
let r = _mm_mask_unpackhi_epi8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_unpackhi_epi8(a, 0b11111111_11111111, a, b);
let e = _mm_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_unpackhi_epi8() {
let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let b = _mm_set_epi8(
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
);
let r = _mm_maskz_unpackhi_epi8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_unpackhi_epi8(0b11111111_11111111, a, b);
let e = _mm_set_epi8(65, 1, 66, 2, 67, 3, 68, 4, 69, 5, 70, 6, 71, 7, 72, 8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_unpacklo_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
#[rustfmt::skip]
let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
let r = _mm512_unpacklo_epi16(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(37, 5, 38, 6, 39, 7, 40, 8, 45, 13, 46, 14, 47, 15, 48, 16,
53, 21, 54, 22, 55, 23, 56, 24, 61, 29, 62, 30, 63, 31, 64, 32);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_unpacklo_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
#[rustfmt::skip]
let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
let r = _mm512_mask_unpacklo_epi16(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_unpacklo_epi16(a, 0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(37, 5, 38, 6, 39, 7, 40, 8, 45, 13, 46, 14, 47, 15, 48, 16,
53, 21, 54, 22, 55, 23, 56, 24, 61, 29, 62, 30, 63, 31, 64, 32);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_unpacklo_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
#[rustfmt::skip]
let b = _mm512_set_epi16(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
let r = _mm512_maskz_unpacklo_epi16(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_unpacklo_epi16(0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm512_set_epi16(37, 5, 38, 6, 39, 7, 40, 8, 45, 13, 46, 14, 47, 15, 48, 16,
53, 21, 54, 22, 55, 23, 56, 24, 61, 29, 62, 30, 63, 31, 64, 32);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_unpacklo_epi16() {
let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let b = _mm256_set_epi16(
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
);
let r = _mm256_mask_unpacklo_epi16(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_unpacklo_epi16(a, 0b11111111_11111111, a, b);
let e = _mm256_set_epi16(37, 5, 38, 6, 39, 7, 40, 8, 45, 13, 46, 14, 47, 15, 48, 16);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_unpacklo_epi16() {
let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let b = _mm256_set_epi16(
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
);
let r = _mm256_maskz_unpacklo_epi16(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_unpacklo_epi16(0b11111111_11111111, a, b);
let e = _mm256_set_epi16(37, 5, 38, 6, 39, 7, 40, 8, 45, 13, 46, 14, 47, 15, 48, 16);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_unpacklo_epi16() {
let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
let r = _mm_mask_unpacklo_epi16(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_unpacklo_epi16(a, 0b11111111, a, b);
let e = _mm_set_epi16(37, 5, 38, 6, 39, 7, 40, 8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_unpacklo_epi16() {
let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40);
let r = _mm_maskz_unpacklo_epi16(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_unpacklo_epi16(0b11111111, a, b);
let e = _mm_set_epi16(37, 5, 38, 6, 39, 7, 40, 8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_unpacklo_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
#[rustfmt::skip]
let b = _mm512_set_epi8(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
let r = _mm512_unpacklo_epi8(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi8(73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
89, 25, 90, 26, 91, 27, 92, 28, 93, 29, 94, 30, 95, 31, 96, 32,
105, 41, 106, 42, 107, 43, 108, 44, 109, 45, 110, 46, 111, 47, 112, 48,
121, 57, 122, 58, 123, 59, 124, 60, 125, 61, 126, 62, 127, 63, 0, 64);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_unpacklo_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
#[rustfmt::skip]
let b = _mm512_set_epi8(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
let r = _mm512_mask_unpacklo_epi8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_unpacklo_epi8(
a,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
89, 25, 90, 26, 91, 27, 92, 28, 93, 29, 94, 30, 95, 31, 96, 32,
105, 41, 106, 42, 107, 43, 108, 44, 109, 45, 110, 46, 111, 47, 112, 48,
121, 57, 122, 58, 123, 59, 124, 60, 125, 61, 126, 62, 127, 63, 0, 64);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_unpacklo_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64);
#[rustfmt::skip]
let b = _mm512_set_epi8(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0);
let r = _mm512_maskz_unpacklo_epi8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_unpacklo_epi8(
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
89, 25, 90, 26, 91, 27, 92, 28, 93, 29, 94, 30, 95, 31, 96, 32,
105, 41, 106, 42, 107, 43, 108, 44, 109, 45, 110, 46, 111, 47, 112, 48,
121, 57, 122, 58, 123, 59, 124, 60, 125, 61, 126, 62, 127, 63, 0, 64);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_unpacklo_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
#[rustfmt::skip]
let b = _mm256_set_epi8(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96);
let r = _mm256_mask_unpacklo_epi8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_unpacklo_epi8(a, 0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
89, 25, 90, 26, 91, 27, 92, 28, 93, 29, 94, 30, 95, 31, 96, 32);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_unpacklo_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);
#[rustfmt::skip]
let b = _mm256_set_epi8(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96);
let r = _mm256_maskz_unpacklo_epi8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_unpacklo_epi8(0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
89, 25, 90, 26, 91, 27, 92, 28, 93, 29, 94, 30, 95, 31, 96, 32);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_unpacklo_epi8() {
let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let b = _mm_set_epi8(
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
);
let r = _mm_mask_unpacklo_epi8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_unpacklo_epi8(a, 0b11111111_11111111, a, b);
let e = _mm_set_epi8(
73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_unpacklo_epi8() {
let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let b = _mm_set_epi8(
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
);
let r = _mm_maskz_unpacklo_epi8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_unpacklo_epi8(0b11111111_11111111, a, b);
let e = _mm_set_epi8(
73, 9, 74, 10, 75, 11, 76, 12, 77, 13, 78, 14, 79, 15, 80, 16,
);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_mov_epi16() {
let src = _mm512_set1_epi16(1);
let a = _mm512_set1_epi16(2);
let r = _mm512_mask_mov_epi16(src, 0, a);
assert_eq_m512i(r, src);
let r = _mm512_mask_mov_epi16(src, 0b11111111_11111111_11111111_11111111, a);
assert_eq_m512i(r, a);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_mov_epi16() {
let a = _mm512_set1_epi16(2);
let r = _mm512_maskz_mov_epi16(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_mov_epi16(0b11111111_11111111_11111111_11111111, a);
assert_eq_m512i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_mov_epi16() {
let src = _mm256_set1_epi16(1);
let a = _mm256_set1_epi16(2);
let r = _mm256_mask_mov_epi16(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm256_mask_mov_epi16(src, 0b11111111_11111111, a);
assert_eq_m256i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_mov_epi16() {
let a = _mm256_set1_epi16(2);
let r = _mm256_maskz_mov_epi16(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_mov_epi16(0b11111111_11111111, a);
assert_eq_m256i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_mov_epi16() {
let src = _mm_set1_epi16(1);
let a = _mm_set1_epi16(2);
let r = _mm_mask_mov_epi16(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_mov_epi16(src, 0b11111111, a);
assert_eq_m128i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_mov_epi16() {
let a = _mm_set1_epi16(2);
let r = _mm_maskz_mov_epi16(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_mov_epi16(0b11111111, a);
assert_eq_m128i(r, a);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_mov_epi8() {
let src = _mm512_set1_epi8(1);
let a = _mm512_set1_epi8(2);
let r = _mm512_mask_mov_epi8(src, 0, a);
assert_eq_m512i(r, src);
let r = _mm512_mask_mov_epi8(
src,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
);
assert_eq_m512i(r, a);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_mov_epi8() {
let a = _mm512_set1_epi8(2);
let r = _mm512_maskz_mov_epi8(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_mov_epi8(
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
);
assert_eq_m512i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_mov_epi8() {
let src = _mm256_set1_epi8(1);
let a = _mm256_set1_epi8(2);
let r = _mm256_mask_mov_epi8(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm256_mask_mov_epi8(src, 0b11111111_11111111_11111111_11111111, a);
assert_eq_m256i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_mov_epi8() {
let a = _mm256_set1_epi8(2);
let r = _mm256_maskz_mov_epi8(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_mov_epi8(0b11111111_11111111_11111111_11111111, a);
assert_eq_m256i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_mov_epi8() {
let src = _mm_set1_epi8(1);
let a = _mm_set1_epi8(2);
let r = _mm_mask_mov_epi8(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_mov_epi8(src, 0b11111111_11111111, a);
assert_eq_m128i(r, a);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_mov_epi8() {
let a = _mm_set1_epi8(2);
let r = _mm_maskz_mov_epi8(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_mov_epi8(0b11111111_11111111, a);
assert_eq_m128i(r, a);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_set1_epi16() {
let src = _mm512_set1_epi16(2);
let a: i16 = 11;
let r = _mm512_mask_set1_epi16(src, 0, a);
assert_eq_m512i(r, src);
let r = _mm512_mask_set1_epi16(src, 0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(11);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_set1_epi16() {
let a: i16 = 11;
let r = _mm512_maskz_set1_epi16(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_set1_epi16(0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(11);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_set1_epi16() {
let src = _mm256_set1_epi16(2);
let a: i16 = 11;
let r = _mm256_mask_set1_epi16(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm256_mask_set1_epi16(src, 0b11111111_11111111, a);
let e = _mm256_set1_epi16(11);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_set1_epi16() {
let a: i16 = 11;
let r = _mm256_maskz_set1_epi16(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_set1_epi16(0b11111111_11111111, a);
let e = _mm256_set1_epi16(11);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_set1_epi16() {
let src = _mm_set1_epi16(2);
let a: i16 = 11;
let r = _mm_mask_set1_epi16(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_set1_epi16(src, 0b11111111, a);
let e = _mm_set1_epi16(11);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_set1_epi16() {
let a: i16 = 11;
let r = _mm_maskz_set1_epi16(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_set1_epi16(0b11111111, a);
let e = _mm_set1_epi16(11);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_set1_epi8() {
let src = _mm512_set1_epi8(2);
let a: i8 = 11;
let r = _mm512_mask_set1_epi8(src, 0, a);
assert_eq_m512i(r, src);
let r = _mm512_mask_set1_epi8(
src,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
);
let e = _mm512_set1_epi8(11);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_set1_epi8() {
let a: i8 = 11;
let r = _mm512_maskz_set1_epi8(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_set1_epi8(
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
);
let e = _mm512_set1_epi8(11);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_set1_epi8() {
let src = _mm256_set1_epi8(2);
let a: i8 = 11;
let r = _mm256_mask_set1_epi8(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm256_mask_set1_epi8(src, 0b11111111_11111111_11111111_11111111, a);
let e = _mm256_set1_epi8(11);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_set1_epi8() {
let a: i8 = 11;
let r = _mm256_maskz_set1_epi8(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_set1_epi8(0b11111111_11111111_11111111_11111111, a);
let e = _mm256_set1_epi8(11);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_set1_epi8() {
let src = _mm_set1_epi8(2);
let a: i8 = 11;
let r = _mm_mask_set1_epi8(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_set1_epi8(src, 0b11111111_11111111, a);
let e = _mm_set1_epi8(11);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_set1_epi8() {
let a: i8 = 11;
let r = _mm_maskz_set1_epi8(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_set1_epi8(0b11111111_11111111, a);
let e = _mm_set1_epi8(11);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_shufflelo_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
);
#[rustfmt::skip]
let e = _mm512_set_epi16(
0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12,
16, 17, 18, 19, 23, 22, 22, 20, 24, 25, 26, 27, 31, 30, 30, 28,
);
let r = _mm512_shufflelo_epi16::<0b00_01_01_11>(a);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_shufflelo_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
);
let r = _mm512_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a);
assert_eq_m512i(r, a);
let r = _mm512_mask_shufflelo_epi16::<0b00_01_01_11>(
a,
0b11111111_11111111_11111111_11111111,
a,
);
#[rustfmt::skip]
let e = _mm512_set_epi16(
0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12,
16, 17, 18, 19, 23, 22, 22, 20, 24, 25, 26, 27, 31, 30, 30, 28,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_shufflelo_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
);
let r = _mm512_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r =
_mm512_maskz_shufflelo_epi16::<0b00_01_01_11>(0b11111111_11111111_11111111_11111111, a);
#[rustfmt::skip]
let e = _mm512_set_epi16(
0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12,
16, 17, 18, 19, 23, 22, 22, 20, 24, 25, 26, 27, 31, 30, 30, 28,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_shufflelo_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let r = _mm256_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a);
assert_eq_m256i(r, a);
let r = _mm256_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0b11111111_11111111, a);
let e = _mm256_set_epi16(0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_shufflelo_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let r = _mm256_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_shufflelo_epi16::<0b00_01_01_11>(0b11111111_11111111, a);
let e = _mm256_set_epi16(0, 1, 2, 3, 7, 6, 6, 4, 8, 9, 10, 11, 15, 14, 14, 12);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_shufflelo_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let r = _mm_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a);
assert_eq_m128i(r, a);
let r = _mm_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0b11111111, a);
let e = _mm_set_epi16(0, 1, 2, 3, 7, 6, 6, 4);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_shufflelo_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let r = _mm_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_shufflelo_epi16::<0b00_01_01_11>(0b11111111, a);
let e = _mm_set_epi16(0, 1, 2, 3, 7, 6, 6, 4);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_shufflehi_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
);
#[rustfmt::skip]
let e = _mm512_set_epi16(
3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15,
19, 18, 18, 16, 20, 21, 22, 23, 27, 26, 26, 24, 28, 29, 30, 31,
);
let r = _mm512_shufflehi_epi16::<0b00_01_01_11>(a);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_shufflehi_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
);
let r = _mm512_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a);
assert_eq_m512i(r, a);
let r = _mm512_mask_shufflehi_epi16::<0b00_01_01_11>(
a,
0b11111111_11111111_11111111_11111111,
a,
);
#[rustfmt::skip]
let e = _mm512_set_epi16(
3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15,
19, 18, 18, 16, 20, 21, 22, 23, 27, 26, 26, 24, 28, 29, 30, 31,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_shufflehi_epi16() {
#[rustfmt::skip]
let a = _mm512_set_epi16(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
);
let r = _mm512_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r =
_mm512_maskz_shufflehi_epi16::<0b00_01_01_11>(0b11111111_11111111_11111111_11111111, a);
#[rustfmt::skip]
let e = _mm512_set_epi16(
3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15,
19, 18, 18, 16, 20, 21, 22, 23, 27, 26, 26, 24, 28, 29, 30, 31,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_shufflehi_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let r = _mm256_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a);
assert_eq_m256i(r, a);
let r = _mm256_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0b11111111_11111111, a);
let e = _mm256_set_epi16(3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_shufflehi_epi16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let r = _mm256_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_shufflehi_epi16::<0b00_01_01_11>(0b11111111_11111111, a);
let e = _mm256_set_epi16(3, 2, 2, 0, 4, 5, 6, 7, 11, 10, 10, 8, 12, 13, 14, 15);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_shufflehi_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let r = _mm_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a);
assert_eq_m128i(r, a);
let r = _mm_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0b11111111, a);
let e = _mm_set_epi16(3, 2, 2, 0, 4, 5, 6, 7);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_shufflehi_epi16() {
let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
let r = _mm_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_shufflehi_epi16::<0b00_01_01_11>(0b11111111, a);
let e = _mm_set_epi16(3, 2, 2, 0, 4, 5, 6, 7);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_shuffle_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63);
let b = _mm512_set1_epi8(1);
let r = _mm512_shuffle_epi8(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_shuffle_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63);
let b = _mm512_set1_epi8(1);
let r = _mm512_mask_shuffle_epi8(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_shuffle_epi8(
a,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_shuffle_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63);
let b = _mm512_set1_epi8(1);
let r = _mm512_maskz_shuffle_epi8(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_shuffle_epi8(
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_shuffle_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
let b = _mm256_set1_epi8(1);
let r = _mm256_mask_shuffle_epi8(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_shuffle_epi8(a, 0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_shuffle_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
let b = _mm256_set1_epi8(1);
let r = _mm256_maskz_shuffle_epi8(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_shuffle_epi8(0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_shuffle_epi8() {
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm_set1_epi8(1);
let r = _mm_mask_shuffle_epi8(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_shuffle_epi8(a, 0b11111111_11111111, a, b);
let e = _mm_set_epi8(
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_shuffle_epi8() {
#[rustfmt::skip]
let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let b = _mm_set1_epi8(1);
let r = _mm_maskz_shuffle_epi8(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_shuffle_epi8(0b11111111_11111111, a, b);
let e = _mm_set_epi8(
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_test_epi16_mask() {
let a = _mm512_set1_epi16(1 << 0);
let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
let r = _mm512_test_epi16_mask(a, b);
let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_test_epi16_mask() {
let a = _mm512_set1_epi16(1 << 0);
let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
let r = _mm512_mask_test_epi16_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm512_mask_test_epi16_mask(0b11111111_11111111_11111111_11111111, a, b);
let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_test_epi16_mask() {
let a = _mm256_set1_epi16(1 << 0);
let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
let r = _mm256_test_epi16_mask(a, b);
let e: __mmask16 = 0b11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_test_epi16_mask() {
let a = _mm256_set1_epi16(1 << 0);
let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
let r = _mm256_mask_test_epi16_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm256_mask_test_epi16_mask(0b11111111_11111111, a, b);
let e: __mmask16 = 0b11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_test_epi16_mask() {
let a = _mm_set1_epi16(1 << 0);
let b = _mm_set1_epi16(1 << 0 | 1 << 1);
let r = _mm_test_epi16_mask(a, b);
let e: __mmask8 = 0b11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_test_epi16_mask() {
let a = _mm_set1_epi16(1 << 0);
let b = _mm_set1_epi16(1 << 0 | 1 << 1);
let r = _mm_mask_test_epi16_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm_mask_test_epi16_mask(0b11111111, a, b);
let e: __mmask8 = 0b11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_test_epi8_mask() {
let a = _mm512_set1_epi8(1 << 0);
let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
let r = _mm512_test_epi8_mask(a, b);
let e: __mmask64 =
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_test_epi8_mask() {
let a = _mm512_set1_epi8(1 << 0);
let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
let r = _mm512_mask_test_epi8_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm512_mask_test_epi8_mask(
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
b,
);
let e: __mmask64 =
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_test_epi8_mask() {
let a = _mm256_set1_epi8(1 << 0);
let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
let r = _mm256_test_epi8_mask(a, b);
let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_test_epi8_mask() {
let a = _mm256_set1_epi8(1 << 0);
let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
let r = _mm256_mask_test_epi8_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm256_mask_test_epi8_mask(0b11111111_11111111_11111111_11111111, a, b);
let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_test_epi8_mask() {
let a = _mm_set1_epi8(1 << 0);
let b = _mm_set1_epi8(1 << 0 | 1 << 1);
let r = _mm_test_epi8_mask(a, b);
let e: __mmask16 = 0b11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_test_epi8_mask() {
let a = _mm_set1_epi8(1 << 0);
let b = _mm_set1_epi8(1 << 0 | 1 << 1);
let r = _mm_mask_test_epi8_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm_mask_test_epi8_mask(0b11111111_11111111, a, b);
let e: __mmask16 = 0b11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_testn_epi16_mask() {
let a = _mm512_set1_epi16(1 << 0);
let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
let r = _mm512_testn_epi16_mask(a, b);
let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_testn_epi16_mask() {
let a = _mm512_set1_epi16(1 << 0);
let b = _mm512_set1_epi16(1 << 0 | 1 << 1);
let r = _mm512_mask_testn_epi16_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm512_mask_testn_epi16_mask(0b11111111_11111111_11111111_11111111, a, b);
let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_testn_epi16_mask() {
let a = _mm256_set1_epi16(1 << 0);
let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
let r = _mm256_testn_epi16_mask(a, b);
let e: __mmask16 = 0b00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_testn_epi16_mask() {
let a = _mm256_set1_epi16(1 << 0);
let b = _mm256_set1_epi16(1 << 0 | 1 << 1);
let r = _mm256_mask_testn_epi16_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm256_mask_testn_epi16_mask(0b11111111_11111111, a, b);
let e: __mmask16 = 0b00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_testn_epi16_mask() {
let a = _mm_set1_epi16(1 << 0);
let b = _mm_set1_epi16(1 << 0 | 1 << 1);
let r = _mm_testn_epi16_mask(a, b);
let e: __mmask8 = 0b00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_testn_epi16_mask() {
let a = _mm_set1_epi16(1 << 0);
let b = _mm_set1_epi16(1 << 0 | 1 << 1);
let r = _mm_mask_testn_epi16_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm_mask_testn_epi16_mask(0b11111111, a, b);
let e: __mmask8 = 0b00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_testn_epi8_mask() {
let a = _mm512_set1_epi8(1 << 0);
let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
let r = _mm512_testn_epi8_mask(a, b);
let e: __mmask64 =
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_testn_epi8_mask() {
let a = _mm512_set1_epi8(1 << 0);
let b = _mm512_set1_epi8(1 << 0 | 1 << 1);
let r = _mm512_mask_testn_epi8_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm512_mask_testn_epi8_mask(
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
b,
);
let e: __mmask64 =
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_testn_epi8_mask() {
let a = _mm256_set1_epi8(1 << 0);
let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
let r = _mm256_testn_epi8_mask(a, b);
let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_testn_epi8_mask() {
let a = _mm256_set1_epi8(1 << 0);
let b = _mm256_set1_epi8(1 << 0 | 1 << 1);
let r = _mm256_mask_testn_epi8_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm256_mask_testn_epi8_mask(0b11111111_11111111_11111111_11111111, a, b);
let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_testn_epi8_mask() {
let a = _mm_set1_epi8(1 << 0);
let b = _mm_set1_epi8(1 << 0 | 1 << 1);
let r = _mm_testn_epi8_mask(a, b);
let e: __mmask16 = 0b00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_testn_epi8_mask() {
let a = _mm_set1_epi8(1 << 0);
let b = _mm_set1_epi8(1 << 0 | 1 << 1);
let r = _mm_mask_testn_epi8_mask(0, a, b);
assert_eq!(r, 0);
let r = _mm_mask_testn_epi8_mask(0b11111111_11111111, a, b);
let e: __mmask16 = 0b00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_store_mask64() {
let a: __mmask64 =
0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000;
let mut r = 0;
_store_mask64(&mut r, a);
assert_eq!(r, a);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_store_mask32() {
let a: __mmask32 = 0b11111111_00000000_11111111_00000000;
let mut r = 0;
_store_mask32(&mut r, a);
assert_eq!(r, a);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_load_mask64() {
let p: __mmask64 =
0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000;
let r = _load_mask64(&p);
let e: __mmask64 =
0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_load_mask32() {
let p: __mmask32 = 0b11111111_00000000_11111111_00000000;
let r = _load_mask32(&p);
let e: __mmask32 = 0b11111111_00000000_11111111_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_sad_epu8() {
let a = _mm512_set1_epi8(2);
let b = _mm512_set1_epi8(4);
let r = _mm512_sad_epu8(a, b);
let e = _mm512_set1_epi64(16);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_dbsad_epu8() {
let a = _mm512_set1_epi8(2);
let b = _mm512_set1_epi8(4);
let r = _mm512_dbsad_epu8::<0>(a, b);
let e = _mm512_set1_epi16(8);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_dbsad_epu8() {
let src = _mm512_set1_epi16(1);
let a = _mm512_set1_epi8(2);
let b = _mm512_set1_epi8(4);
let r = _mm512_mask_dbsad_epu8::<0>(src, 0, a, b);
assert_eq_m512i(r, src);
let r = _mm512_mask_dbsad_epu8::<0>(src, 0b11111111_11111111_11111111_11111111, a, b);
let e = _mm512_set1_epi16(8);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_dbsad_epu8() {
let a = _mm512_set1_epi8(2);
let b = _mm512_set1_epi8(4);
let r = _mm512_maskz_dbsad_epu8::<0>(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_dbsad_epu8::<0>(0b11111111_11111111_11111111_11111111, a, b);
let e = _mm512_set1_epi16(8);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_dbsad_epu8() {
let a = _mm256_set1_epi8(2);
let b = _mm256_set1_epi8(4);
let r = _mm256_dbsad_epu8::<0>(a, b);
let e = _mm256_set1_epi16(8);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_dbsad_epu8() {
let src = _mm256_set1_epi16(1);
let a = _mm256_set1_epi8(2);
let b = _mm256_set1_epi8(4);
let r = _mm256_mask_dbsad_epu8::<0>(src, 0, a, b);
assert_eq_m256i(r, src);
let r = _mm256_mask_dbsad_epu8::<0>(src, 0b11111111_11111111, a, b);
let e = _mm256_set1_epi16(8);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_dbsad_epu8() {
let a = _mm256_set1_epi8(2);
let b = _mm256_set1_epi8(4);
let r = _mm256_maskz_dbsad_epu8::<0>(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_dbsad_epu8::<0>(0b11111111_11111111, a, b);
let e = _mm256_set1_epi16(8);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_dbsad_epu8() {
let a = _mm_set1_epi8(2);
let b = _mm_set1_epi8(4);
let r = _mm_dbsad_epu8::<0>(a, b);
let e = _mm_set1_epi16(8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_dbsad_epu8() {
let src = _mm_set1_epi16(1);
let a = _mm_set1_epi8(2);
let b = _mm_set1_epi8(4);
let r = _mm_mask_dbsad_epu8::<0>(src, 0, a, b);
assert_eq_m128i(r, src);
let r = _mm_mask_dbsad_epu8::<0>(src, 0b11111111, a, b);
let e = _mm_set1_epi16(8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
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>(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_dbsad_epu8::<0>(0b11111111, a, b);
let e = _mm_set1_epi16(8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_movepi16_mask() {
let a = _mm512_set1_epi16(1 << 15);
let r = _mm512_movepi16_mask(a);
let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_movepi16_mask() {
let a = _mm256_set1_epi16(1 << 15);
let r = _mm256_movepi16_mask(a);
let e: __mmask16 = 0b11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_movepi16_mask() {
let a = _mm_set1_epi16(1 << 15);
let r = _mm_movepi16_mask(a);
let e: __mmask8 = 0b11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_movepi8_mask() {
let a = _mm512_set1_epi8(1 << 7);
let r = _mm512_movepi8_mask(a);
let e: __mmask64 =
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_movepi8_mask() {
let a = _mm256_set1_epi8(1 << 7);
let r = _mm256_movepi8_mask(a);
let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_movepi8_mask() {
let a = _mm_set1_epi8(1 << 7);
let r = _mm_movepi8_mask(a);
let e: __mmask16 = 0b11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_movm_epi16() {
let a: __mmask32 = 0b11111111_11111111_11111111_11111111;
let r = _mm512_movm_epi16(a);
let e = _mm512_set1_epi16(
1 << 15
| 1 << 14
| 1 << 13
| 1 << 12
| 1 << 11
| 1 << 10
| 1 << 9
| 1 << 8
| 1 << 7
| 1 << 6
| 1 << 5
| 1 << 4
| 1 << 3
| 1 << 2
| 1 << 1
| 1 << 0,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_movm_epi16() {
let a: __mmask16 = 0b11111111_11111111;
let r = _mm256_movm_epi16(a);
let e = _mm256_set1_epi16(
1 << 15
| 1 << 14
| 1 << 13
| 1 << 12
| 1 << 11
| 1 << 10
| 1 << 9
| 1 << 8
| 1 << 7
| 1 << 6
| 1 << 5
| 1 << 4
| 1 << 3
| 1 << 2
| 1 << 1
| 1 << 0,
);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_movm_epi16() {
let a: __mmask8 = 0b11111111;
let r = _mm_movm_epi16(a);
let e = _mm_set1_epi16(
1 << 15
| 1 << 14
| 1 << 13
| 1 << 12
| 1 << 11
| 1 << 10
| 1 << 9
| 1 << 8
| 1 << 7
| 1 << 6
| 1 << 5
| 1 << 4
| 1 << 3
| 1 << 2
| 1 << 1
| 1 << 0,
);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_movm_epi8() {
let a: __mmask64 =
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
let r = _mm512_movm_epi8(a);
let e =
_mm512_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_movm_epi8() {
let a: __mmask32 = 0b11111111_11111111_11111111_11111111;
let r = _mm256_movm_epi8(a);
let e =
_mm256_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_movm_epi8() {
let a: __mmask16 = 0b11111111_11111111;
let r = _mm_movm_epi8(a);
let e =
_mm_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_cvtmask32_u32() {
let a: __mmask32 = 0b11001100_00110011_01100110_10011001;
let r = _cvtmask32_u32(a);
let e: u32 = 0b11001100_00110011_01100110_10011001;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_cvtu32_mask32() {
let a: u32 = 0b11001100_00110011_01100110_10011001;
let r = _cvtu32_mask32(a);
let e: __mmask32 = 0b11001100_00110011_01100110_10011001;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kadd_mask32() {
let a: __mmask32 = 11;
let b: __mmask32 = 22;
let r = _kadd_mask32(a, b);
let e: __mmask32 = 33;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kadd_mask64() {
let a: __mmask64 = 11;
let b: __mmask64 = 22;
let r = _kadd_mask64(a, b);
let e: __mmask64 = 33;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kand_mask32() {
let a: __mmask32 = 0b11001100_00110011_11001100_00110011;
let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
let r = _kand_mask32(a, b);
let e: __mmask32 = 0b11001100_00110011_11001100_00110011;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kand_mask64() {
let a: __mmask64 =
0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
let b: __mmask64 =
0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
let r = _kand_mask64(a, b);
let e: __mmask64 =
0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_knot_mask32() {
let a: __mmask32 = 0b11001100_00110011_11001100_00110011;
let r = _knot_mask32(a);
let e: __mmask32 = 0b00110011_11001100_00110011_11001100;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_knot_mask64() {
let a: __mmask64 =
0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
let r = _knot_mask64(a);
let e: __mmask64 =
0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kandn_mask32() {
let a: __mmask32 = 0b11001100_00110011_11001100_00110011;
let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
let r = _kandn_mask32(a, b);
let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kandn_mask64() {
let a: __mmask64 =
0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
let b: __mmask64 =
0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
let r = _kandn_mask64(a, b);
let e: __mmask64 =
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kor_mask32() {
let a: __mmask32 = 0b00110011_11001100_00110011_11001100;
let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
let r = _kor_mask32(a, b);
let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kor_mask64() {
let a: __mmask64 =
0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
let b: __mmask64 =
0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
let r = _kor_mask64(a, b);
let e: __mmask64 =
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kxor_mask32() {
let a: __mmask32 = 0b00110011_11001100_00110011_11001100;
let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
let r = _kxor_mask32(a, b);
let e: __mmask32 = 0b11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kxor_mask64() {
let a: __mmask64 =
0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
let b: __mmask64 =
0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
let r = _kxor_mask64(a, b);
let e: __mmask64 =
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kxnor_mask32() {
let a: __mmask32 = 0b00110011_11001100_00110011_11001100;
let b: __mmask32 = 0b11001100_00110011_11001100_00110011;
let r = _kxnor_mask32(a, b);
let e: __mmask32 = 0b00000000_00000000_00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kxnor_mask64() {
let a: __mmask64 =
0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100;
let b: __mmask64 =
0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011;
let r = _kxnor_mask64(a, b);
let e: __mmask64 =
0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kortest_mask32_u8() {
let a: __mmask32 = 0b0110100101101001_0110100101101001;
let b: __mmask32 = 0b1011011010110110_1011011010110110;
let mut all_ones: u8 = 0;
let r = _kortest_mask32_u8(a, b, &mut all_ones);
assert_eq!(r, 0);
assert_eq!(all_ones, 1);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kortest_mask64_u8() {
let a: __mmask64 = 0b0110100101101001_0110100101101001;
let b: __mmask64 = 0b1011011010110110_1011011010110110;
let mut all_ones: u8 = 0;
let r = _kortest_mask64_u8(a, b, &mut all_ones);
assert_eq!(r, 0);
assert_eq!(all_ones, 0);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kortestc_mask32_u8() {
let a: __mmask32 = 0b0110100101101001_0110100101101001;
let b: __mmask32 = 0b1011011010110110_1011011010110110;
let r = _kortestc_mask32_u8(a, b);
assert_eq!(r, 1);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kortestc_mask64_u8() {
let a: __mmask64 = 0b0110100101101001_0110100101101001;
let b: __mmask64 = 0b1011011010110110_1011011010110110;
let r = _kortestc_mask64_u8(a, b);
assert_eq!(r, 0);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kortestz_mask32_u8() {
let a: __mmask32 = 0b0110100101101001_0110100101101001;
let b: __mmask32 = 0b1011011010110110_1011011010110110;
let r = _kortestz_mask32_u8(a, b);
assert_eq!(r, 0);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kortestz_mask64_u8() {
let a: __mmask64 = 0b0110100101101001_0110100101101001;
let b: __mmask64 = 0b1011011010110110_1011011010110110;
let r = _kortestz_mask64_u8(a, b);
assert_eq!(r, 0);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kshiftli_mask32() {
let a: __mmask32 = 0b0110100101101001_0110100101101001;
let r = _kshiftli_mask32::<3>(a);
let e: __mmask32 = 0b0100101101001011_0100101101001000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kshiftli_mask64() {
let a: __mmask64 = 0b0110100101101001_0110100101101001;
let r = _kshiftli_mask64::<3>(a);
let e: __mmask64 = 0b0110100101101001011_0100101101001000;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kshiftri_mask32() {
let a: __mmask32 = 0b0110100101101001_0110100101101001;
let r = _kshiftri_mask32::<3>(a);
let e: __mmask32 = 0b0000110100101101_0010110100101101;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_kshiftri_mask64() {
let a: __mmask64 = 0b0110100101101001011_0100101101001000;
let r = _kshiftri_mask64::<3>(a);
let e: __mmask64 = 0b0110100101101001_0110100101101001;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_ktest_mask32_u8() {
let a: __mmask32 = 0b0110100100111100_0110100100111100;
let b: __mmask32 = 0b1001011011000011_1001011011000011;
let mut and_not: u8 = 0;
let r = _ktest_mask32_u8(a, b, &mut and_not);
assert_eq!(r, 1);
assert_eq!(and_not, 0);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_ktestc_mask32_u8() {
let a: __mmask32 = 0b0110100100111100_0110100100111100;
let b: __mmask32 = 0b1001011011000011_1001011011000011;
let r = _ktestc_mask32_u8(a, b);
assert_eq!(r, 0);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_ktestz_mask32_u8() {
let a: __mmask32 = 0b0110100100111100_0110100100111100;
let b: __mmask32 = 0b1001011011000011_1001011011000011;
let r = _ktestz_mask32_u8(a, b);
assert_eq!(r, 1);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_ktest_mask64_u8() {
let a: __mmask64 = 0b0110100100111100_0110100100111100;
let b: __mmask64 = 0b1001011011000011_1001011011000011;
let mut and_not: u8 = 0;
let r = _ktest_mask64_u8(a, b, &mut and_not);
assert_eq!(r, 1);
assert_eq!(and_not, 0);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_ktestc_mask64_u8() {
let a: __mmask64 = 0b0110100100111100_0110100100111100;
let b: __mmask64 = 0b1001011011000011_1001011011000011;
let r = _ktestc_mask64_u8(a, b);
assert_eq!(r, 0);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_ktestz_mask64_u8() {
let a: __mmask64 = 0b0110100100111100_0110100100111100;
let b: __mmask64 = 0b1001011011000011_1001011011000011;
let r = _ktestz_mask64_u8(a, b);
assert_eq!(r, 1);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_kunpackw() {
let a: u32 = 0x00110011;
let b: u32 = 0x00001011;
let r = _mm512_kunpackw(a, b);
let e: u32 = 0x00111011;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_kunpackd() {
let a: u64 = 0x11001100_00110011;
let b: u64 = 0x00101110_00001011;
let r = _mm512_kunpackd(a, b);
let e: u64 = 0x00110011_00001011;
assert_eq!(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cvtepi16_epi8() {
let a = _mm512_set1_epi16(2);
let r = _mm512_cvtepi16_epi8(a);
let e = _mm256_set1_epi8(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cvtepi16_epi8() {
let src = _mm256_set1_epi8(1);
let a = _mm512_set1_epi16(2);
let r = _mm512_mask_cvtepi16_epi8(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm512_mask_cvtepi16_epi8(src, 0b11111111_11111111_11111111_11111111, a);
let e = _mm256_set1_epi8(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_cvtepi16_epi8() {
let a = _mm512_set1_epi16(2);
let r = _mm512_maskz_cvtepi16_epi8(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm512_maskz_cvtepi16_epi8(0b11111111_11111111_11111111_11111111, a);
let e = _mm256_set1_epi8(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cvtepi16_epi8() {
let a = _mm256_set1_epi16(2);
let r = _mm256_cvtepi16_epi8(a);
let e = _mm_set1_epi8(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cvtepi16_epi8() {
let src = _mm_set1_epi8(1);
let a = _mm256_set1_epi16(2);
let r = _mm256_mask_cvtepi16_epi8(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm256_mask_cvtepi16_epi8(src, 0b11111111_11111111, a);
let e = _mm_set1_epi8(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_cvtepi16_epi8() {
let a = _mm256_set1_epi16(2);
let r = _mm256_maskz_cvtepi16_epi8(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm256_maskz_cvtepi16_epi8(0b11111111_11111111, a);
let e = _mm_set1_epi8(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cvtepi16_epi8() {
let a = _mm_set1_epi16(2);
let r = _mm_cvtepi16_epi8(a);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cvtepi16_epi8() {
let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
let a = _mm_set1_epi16(2);
let r = _mm_mask_cvtepi16_epi8(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_cvtepi16_epi8(src, 0b11111111, a);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_cvtepi16_epi8() {
let a = _mm_set1_epi16(2);
let r = _mm_maskz_cvtepi16_epi8(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_cvtepi16_epi8(0b11111111, a);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cvtsepi16_epi8() {
let a = _mm512_set1_epi16(i16::MAX);
let r = _mm512_cvtsepi16_epi8(a);
let e = _mm256_set1_epi8(i8::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cvtsepi16_epi8() {
let src = _mm256_set1_epi8(1);
let a = _mm512_set1_epi16(i16::MAX);
let r = _mm512_mask_cvtsepi16_epi8(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm512_mask_cvtsepi16_epi8(src, 0b11111111_11111111_11111111_11111111, a);
let e = _mm256_set1_epi8(i8::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cvtsepi16_epi8() {
let a = _mm256_set1_epi16(i16::MAX);
let r = _mm256_cvtsepi16_epi8(a);
let e = _mm_set1_epi8(i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cvtsepi16_epi8() {
let src = _mm_set1_epi8(1);
let a = _mm256_set1_epi16(i16::MAX);
let r = _mm256_mask_cvtsepi16_epi8(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm256_mask_cvtsepi16_epi8(src, 0b11111111_11111111, a);
let e = _mm_set1_epi8(i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_cvtsepi16_epi8() {
let a = _mm256_set1_epi16(i16::MAX);
let r = _mm256_maskz_cvtsepi16_epi8(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm256_maskz_cvtsepi16_epi8(0b11111111_11111111, a);
let e = _mm_set1_epi8(i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cvtsepi16_epi8() {
let a = _mm_set1_epi16(i16::MAX);
let r = _mm_cvtsepi16_epi8(a);
#[rustfmt::skip]
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cvtsepi16_epi8() {
let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
let a = _mm_set1_epi16(i16::MAX);
let r = _mm_mask_cvtsepi16_epi8(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_cvtsepi16_epi8(src, 0b11111111, a);
#[rustfmt::skip]
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_cvtsepi16_epi8() {
let a = _mm_set1_epi16(i16::MAX);
let r = _mm_maskz_cvtsepi16_epi8(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_cvtsepi16_epi8(0b11111111, a);
#[rustfmt::skip]
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_cvtsepi16_epi8() {
let a = _mm512_set1_epi16(i16::MAX);
let r = _mm512_maskz_cvtsepi16_epi8(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm512_maskz_cvtsepi16_epi8(0b11111111_11111111_11111111_11111111, a);
let e = _mm256_set1_epi8(i8::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cvtusepi16_epi8() {
let a = _mm512_set1_epi16(i16::MIN);
let r = _mm512_cvtusepi16_epi8(a);
let e = _mm256_set1_epi8(-1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cvtusepi16_epi8() {
let src = _mm256_set1_epi8(1);
let a = _mm512_set1_epi16(i16::MIN);
let r = _mm512_mask_cvtusepi16_epi8(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm512_mask_cvtusepi16_epi8(src, 0b11111111_11111111_11111111_11111111, a);
let e = _mm256_set1_epi8(-1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_cvtusepi16_epi8() {
let a = _mm512_set1_epi16(i16::MIN);
let r = _mm512_maskz_cvtusepi16_epi8(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm512_maskz_cvtusepi16_epi8(0b11111111_11111111_11111111_11111111, a);
let e = _mm256_set1_epi8(-1);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_cvtusepi16_epi8() {
let a = _mm256_set1_epi16(i16::MIN);
let r = _mm256_cvtusepi16_epi8(a);
let e = _mm_set1_epi8(-1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cvtusepi16_epi8() {
let src = _mm_set1_epi8(1);
let a = _mm256_set1_epi16(i16::MIN);
let r = _mm256_mask_cvtusepi16_epi8(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm256_mask_cvtusepi16_epi8(src, 0b11111111_11111111, a);
let e = _mm_set1_epi8(-1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_cvtusepi16_epi8() {
let a = _mm256_set1_epi16(i16::MIN);
let r = _mm256_maskz_cvtusepi16_epi8(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm256_maskz_cvtusepi16_epi8(0b11111111_11111111, a);
let e = _mm_set1_epi8(-1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_cvtusepi16_epi8() {
let a = _mm_set1_epi16(i16::MIN);
let r = _mm_cvtusepi16_epi8(a);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cvtusepi16_epi8() {
let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
let a = _mm_set1_epi16(i16::MIN);
let r = _mm_mask_cvtusepi16_epi8(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_cvtusepi16_epi8(src, 0b11111111, a);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_cvtusepi16_epi8() {
let a = _mm_set1_epi16(i16::MIN);
let r = _mm_maskz_cvtusepi16_epi8(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_cvtusepi16_epi8(0b11111111, a);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cvtepi8_epi16() {
let a = _mm256_set1_epi8(2);
let r = _mm512_cvtepi8_epi16(a);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cvtepi8_epi16() {
let src = _mm512_set1_epi16(1);
let a = _mm256_set1_epi8(2);
let r = _mm512_mask_cvtepi8_epi16(src, 0, a);
assert_eq_m512i(r, src);
let r = _mm512_mask_cvtepi8_epi16(src, 0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_cvtepi8_epi16() {
let a = _mm256_set1_epi8(2);
let r = _mm512_maskz_cvtepi8_epi16(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_cvtepi8_epi16(0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cvtepi8_epi16() {
let src = _mm256_set1_epi16(1);
let a = _mm_set1_epi8(2);
let r = _mm256_mask_cvtepi8_epi16(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm256_mask_cvtepi8_epi16(src, 0b11111111_11111111, a);
let e = _mm256_set1_epi16(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_cvtepi8_epi16() {
let a = _mm_set1_epi8(2);
let r = _mm256_maskz_cvtepi8_epi16(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_cvtepi8_epi16(0b11111111_11111111, a);
let e = _mm256_set1_epi16(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cvtepi8_epi16() {
let src = _mm_set1_epi16(1);
let a = _mm_set1_epi8(2);
let r = _mm_mask_cvtepi8_epi16(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_cvtepi8_epi16(src, 0b11111111, a);
let e = _mm_set1_epi16(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_cvtepi8_epi16() {
let a = _mm_set1_epi8(2);
let r = _mm_maskz_cvtepi8_epi16(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_cvtepi8_epi16(0b11111111, a);
let e = _mm_set1_epi16(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_cvtepu8_epi16() {
let a = _mm256_set1_epi8(2);
let r = _mm512_cvtepu8_epi16(a);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cvtepu8_epi16() {
let src = _mm512_set1_epi16(1);
let a = _mm256_set1_epi8(2);
let r = _mm512_mask_cvtepu8_epi16(src, 0, a);
assert_eq_m512i(r, src);
let r = _mm512_mask_cvtepu8_epi16(src, 0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_cvtepu8_epi16() {
let a = _mm256_set1_epi8(2);
let r = _mm512_maskz_cvtepu8_epi16(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_cvtepu8_epi16(0b11111111_11111111_11111111_11111111, a);
let e = _mm512_set1_epi16(2);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cvtepu8_epi16() {
let src = _mm256_set1_epi16(1);
let a = _mm_set1_epi8(2);
let r = _mm256_mask_cvtepu8_epi16(src, 0, a);
assert_eq_m256i(r, src);
let r = _mm256_mask_cvtepu8_epi16(src, 0b11111111_11111111, a);
let e = _mm256_set1_epi16(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_cvtepu8_epi16() {
let a = _mm_set1_epi8(2);
let r = _mm256_maskz_cvtepu8_epi16(0, a);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_cvtepu8_epi16(0b11111111_11111111, a);
let e = _mm256_set1_epi16(2);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cvtepu8_epi16() {
let src = _mm_set1_epi16(1);
let a = _mm_set1_epi8(2);
let r = _mm_mask_cvtepu8_epi16(src, 0, a);
assert_eq_m128i(r, src);
let r = _mm_mask_cvtepu8_epi16(src, 0b11111111, a);
let e = _mm_set1_epi16(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_cvtepu8_epi16() {
let a = _mm_set1_epi8(2);
let r = _mm_maskz_cvtepu8_epi16(0, a);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_cvtepu8_epi16(0b11111111, a);
let e = _mm_set1_epi16(2);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_bslli_epi128() {
#[rustfmt::skip]
let a = _mm512_set_epi8(
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
);
let r = _mm512_bslli_epi128::<9>(a);
#[rustfmt::skip]
let e = _mm512_set_epi8(
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_bsrli_epi128() {
#[rustfmt::skip]
let a = _mm512_set_epi8(
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
);
let r = _mm512_bsrli_epi128::<3>(a);
#[rustfmt::skip]
let e = _mm512_set_epi8(
0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
0, 0, 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
0, 0, 0, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
0, 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_alignr_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
);
let b = _mm512_set1_epi8(1);
let r = _mm512_alignr_epi8::<14>(a, b);
#[rustfmt::skip]
let e = _mm512_set_epi8(
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_alignr_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
);
let b = _mm512_set1_epi8(1);
let r = _mm512_mask_alignr_epi8::<14>(a, 0, a, b);
assert_eq_m512i(r, a);
let r = _mm512_mask_alignr_epi8::<14>(
a,
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_maskz_alignr_epi8() {
#[rustfmt::skip]
let a = _mm512_set_epi8(
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
);
let b = _mm512_set1_epi8(1);
let r = _mm512_maskz_alignr_epi8::<14>(0, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_alignr_epi8::<14>(
0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
a,
b,
);
#[rustfmt::skip]
let e = _mm512_set_epi8(
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_alignr_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
);
let b = _mm256_set1_epi8(1);
let r = _mm256_mask_alignr_epi8::<14>(a, 0, a, b);
assert_eq_m256i(r, a);
let r = _mm256_mask_alignr_epi8::<14>(a, 0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_maskz_alignr_epi8() {
#[rustfmt::skip]
let a = _mm256_set_epi8(
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
);
let b = _mm256_set1_epi8(1);
let r = _mm256_maskz_alignr_epi8::<14>(0, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_alignr_epi8::<14>(0b11111111_11111111_11111111_11111111, a, b);
#[rustfmt::skip]
let e = _mm256_set_epi8(
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_alignr_epi8() {
let a = _mm_set_epi8(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);
let b = _mm_set1_epi8(1);
let r = _mm_mask_alignr_epi8::<14>(a, 0, a, b);
assert_eq_m128i(r, a);
let r = _mm_mask_alignr_epi8::<14>(a, 0b11111111_11111111, a, b);
let e = _mm_set_epi8(0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_maskz_alignr_epi8() {
let a = _mm_set_epi8(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);
let b = _mm_set1_epi8(1);
let r = _mm_maskz_alignr_epi8::<14>(0, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_alignr_epi8::<14>(0b11111111_11111111, a, b);
let e = _mm_set_epi8(0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cvtsepi16_storeu_epi8() {
let a = _mm512_set1_epi16(i16::MAX);
let mut r = _mm256_undefined_si256();
_mm512_mask_cvtsepi16_storeu_epi8(
&mut r as *mut _ as *mut i8,
0b11111111_11111111_11111111_11111111,
a,
);
let e = _mm256_set1_epi8(i8::MAX);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cvtsepi16_storeu_epi8() {
let a = _mm256_set1_epi16(i16::MAX);
let mut r = _mm_undefined_si128();
_mm256_mask_cvtsepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
let e = _mm_set1_epi8(i8::MAX);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cvtsepi16_storeu_epi8() {
let a = _mm_set1_epi16(i16::MAX);
let mut r = _mm_set1_epi8(0);
_mm_mask_cvtsepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
#[rustfmt::skip]
let e = _mm_set_epi8(
0, 0, 0, 0, 0, 0, 0, 0,
i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX, i8::MAX,
);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cvtepi16_storeu_epi8() {
let a = _mm512_set1_epi16(8);
let mut r = _mm256_undefined_si256();
_mm512_mask_cvtepi16_storeu_epi8(
&mut r as *mut _ as *mut i8,
0b11111111_11111111_11111111_11111111,
a,
);
let e = _mm256_set1_epi8(8);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cvtepi16_storeu_epi8() {
let a = _mm256_set1_epi16(8);
let mut r = _mm_undefined_si128();
_mm256_mask_cvtepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
let e = _mm_set1_epi8(8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cvtepi16_storeu_epi8() {
let a = _mm_set1_epi16(8);
let mut r = _mm_set1_epi8(0);
_mm_mask_cvtepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw")]
unsafe fn test_mm512_mask_cvtusepi16_storeu_epi8() {
let a = _mm512_set1_epi16(i16::MAX);
let mut r = _mm256_undefined_si256();
_mm512_mask_cvtusepi16_storeu_epi8(
&mut r as *mut _ as *mut i8,
0b11111111_11111111_11111111_11111111,
a,
);
let e = _mm256_set1_epi8(u8::MAX as i8);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm256_mask_cvtusepi16_storeu_epi8() {
let a = _mm256_set1_epi16(i16::MAX);
let mut r = _mm_undefined_si128();
_mm256_mask_cvtusepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
let e = _mm_set1_epi8(u8::MAX as i8);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512bw,avx512vl")]
unsafe fn test_mm_mask_cvtusepi16_storeu_epi8() {
let a = _mm_set1_epi16(i16::MAX);
let mut r = _mm_set1_epi8(0);
_mm_mask_cvtusepi16_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
#[rustfmt::skip]
let e = _mm_set_epi8(
0, 0, 0, 0,
0, 0, 0, 0,
u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8,
u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8,
);
assert_eq_m128i(r, e);
}
}