use crate::{
core_arch::{simd::*, simd_llvm::*, x86::*},
mem::transmute,
};
#[cfg(test)]
use stdarch_test::assert_instr;
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpwssd))]
pub unsafe fn _mm512_dpwssd_epi32(src: __m512i, a: __m512i, b: __m512i) -> __m512i {
transmute(vpdpwssd(src.as_i32x16(), a.as_i32x16(), b.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpwssd))]
pub unsafe fn _mm512_mask_dpwssd_epi32(
src: __m512i,
k: __mmask16,
a: __m512i,
b: __m512i,
) -> __m512i {
let r = _mm512_dpwssd_epi32(src, a, b).as_i32x16();
transmute(simd_select_bitmask(k, r, src.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpwssd))]
pub unsafe fn _mm512_maskz_dpwssd_epi32(
k: __mmask16,
src: __m512i,
a: __m512i,
b: __m512i,
) -> __m512i {
let r = _mm512_dpwssd_epi32(src, a, b).as_i32x16();
let zero = _mm512_setzero_si512().as_i32x16();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssd))]
pub unsafe fn _mm256_dpwssd_epi32(src: __m256i, a: __m256i, b: __m256i) -> __m256i {
transmute(vpdpwssd256(src.as_i32x8(), a.as_i32x8(), b.as_i32x8()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssd))]
pub unsafe fn _mm256_mask_dpwssd_epi32(
src: __m256i,
k: __mmask8,
a: __m256i,
b: __m256i,
) -> __m256i {
let r = _mm256_dpwssd_epi32(src, a, b).as_i32x8();
transmute(simd_select_bitmask(k, r, src.as_i32x8()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssd))]
pub unsafe fn _mm256_maskz_dpwssd_epi32(
k: __mmask8,
src: __m256i,
a: __m256i,
b: __m256i,
) -> __m256i {
let r = _mm256_dpwssd_epi32(src, a, b).as_i32x8();
let zero = _mm256_setzero_si256().as_i32x8();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssd))]
pub unsafe fn _mm_dpwssd_epi32(src: __m128i, a: __m128i, b: __m128i) -> __m128i {
transmute(vpdpwssd128(src.as_i32x4(), a.as_i32x4(), b.as_i32x4()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssd))]
pub unsafe fn _mm_mask_dpwssd_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let r = _mm_dpwssd_epi32(src, a, b).as_i32x4();
transmute(simd_select_bitmask(k, r, src.as_i32x4()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssd))]
pub unsafe fn _mm_maskz_dpwssd_epi32(k: __mmask8, src: __m128i, a: __m128i, b: __m128i) -> __m128i {
let r = _mm_dpwssd_epi32(src, a, b).as_i32x4();
let zero = _mm_setzero_si128().as_i32x4();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpwssds))]
pub unsafe fn _mm512_dpwssds_epi32(src: __m512i, a: __m512i, b: __m512i) -> __m512i {
transmute(vpdpwssds(src.as_i32x16(), a.as_i32x16(), b.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpwssds))]
pub unsafe fn _mm512_mask_dpwssds_epi32(
src: __m512i,
k: __mmask16,
a: __m512i,
b: __m512i,
) -> __m512i {
let r = _mm512_dpwssds_epi32(src, a, b).as_i32x16();
transmute(simd_select_bitmask(k, r, src.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpwssds))]
pub unsafe fn _mm512_maskz_dpwssds_epi32(
k: __mmask16,
src: __m512i,
a: __m512i,
b: __m512i,
) -> __m512i {
let r = _mm512_dpwssds_epi32(src, a, b).as_i32x16();
let zero = _mm512_setzero_si512().as_i32x16();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssds))]
pub unsafe fn _mm256_dpwssds_epi32(src: __m256i, a: __m256i, b: __m256i) -> __m256i {
transmute(vpdpwssds256(src.as_i32x8(), a.as_i32x8(), b.as_i32x8()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssds))]
pub unsafe fn _mm256_mask_dpwssds_epi32(
src: __m256i,
k: __mmask8,
a: __m256i,
b: __m256i,
) -> __m256i {
let r = _mm256_dpwssds_epi32(src, a, b).as_i32x8();
transmute(simd_select_bitmask(k, r, src.as_i32x8()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssds))]
pub unsafe fn _mm256_maskz_dpwssds_epi32(
k: __mmask8,
src: __m256i,
a: __m256i,
b: __m256i,
) -> __m256i {
let r = _mm256_dpwssds_epi32(src, a, b).as_i32x8();
let zero = _mm256_setzero_si256().as_i32x8();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssds))]
pub unsafe fn _mm_dpwssds_epi32(src: __m128i, a: __m128i, b: __m128i) -> __m128i {
transmute(vpdpwssds128(src.as_i32x4(), a.as_i32x4(), b.as_i32x4()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssds))]
pub unsafe fn _mm_mask_dpwssds_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let r = _mm_dpwssds_epi32(src, a, b).as_i32x4();
transmute(simd_select_bitmask(k, r, src.as_i32x4()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpwssds))]
pub unsafe fn _mm_maskz_dpwssds_epi32(
k: __mmask8,
src: __m128i,
a: __m128i,
b: __m128i,
) -> __m128i {
let r = _mm_dpwssds_epi32(src, a, b).as_i32x4();
let zero = _mm_setzero_si128().as_i32x4();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpbusd))]
pub unsafe fn _mm512_dpbusd_epi32(src: __m512i, a: __m512i, b: __m512i) -> __m512i {
transmute(vpdpbusd(src.as_i32x16(), a.as_i32x16(), b.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpbusd))]
pub unsafe fn _mm512_mask_dpbusd_epi32(
src: __m512i,
k: __mmask16,
a: __m512i,
b: __m512i,
) -> __m512i {
let r = _mm512_dpbusd_epi32(src, a, b).as_i32x16();
transmute(simd_select_bitmask(k, r, src.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpbusd))]
pub unsafe fn _mm512_maskz_dpbusd_epi32(
k: __mmask16,
src: __m512i,
a: __m512i,
b: __m512i,
) -> __m512i {
let r = _mm512_dpbusd_epi32(src, a, b).as_i32x16();
let zero = _mm512_setzero_si512().as_i32x16();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusd))]
pub unsafe fn _mm256_dpbusd_epi32(src: __m256i, a: __m256i, b: __m256i) -> __m256i {
transmute(vpdpbusd256(src.as_i32x8(), a.as_i32x8(), b.as_i32x8()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusd))]
pub unsafe fn _mm256_mask_dpbusd_epi32(
src: __m256i,
k: __mmask8,
a: __m256i,
b: __m256i,
) -> __m256i {
let r = _mm256_dpbusd_epi32(src, a, b).as_i32x8();
transmute(simd_select_bitmask(k, r, src.as_i32x8()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusd))]
pub unsafe fn _mm256_maskz_dpbusd_epi32(
k: __mmask8,
src: __m256i,
a: __m256i,
b: __m256i,
) -> __m256i {
let r = _mm256_dpbusd_epi32(src, a, b).as_i32x8();
let zero = _mm256_setzero_si256().as_i32x8();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusd))]
pub unsafe fn _mm_dpbusd_epi32(src: __m128i, a: __m128i, b: __m128i) -> __m128i {
transmute(vpdpbusd128(src.as_i32x4(), a.as_i32x4(), b.as_i32x4()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusd))]
pub unsafe fn _mm_mask_dpbusd_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let r = _mm_dpbusd_epi32(src, a, b).as_i32x4();
transmute(simd_select_bitmask(k, r, src.as_i32x4()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusd))]
pub unsafe fn _mm_maskz_dpbusd_epi32(k: __mmask8, src: __m128i, a: __m128i, b: __m128i) -> __m128i {
let r = _mm_dpbusd_epi32(src, a, b).as_i32x4();
let zero = _mm_setzero_si128().as_i32x4();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpbusds))]
pub unsafe fn _mm512_dpbusds_epi32(src: __m512i, a: __m512i, b: __m512i) -> __m512i {
transmute(vpdpbusds(src.as_i32x16(), a.as_i32x16(), b.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpbusds))]
pub unsafe fn _mm512_mask_dpbusds_epi32(
src: __m512i,
k: __mmask16,
a: __m512i,
b: __m512i,
) -> __m512i {
let r = _mm512_dpbusds_epi32(src, a, b).as_i32x16();
transmute(simd_select_bitmask(k, r, src.as_i32x16()))
}
#[inline]
#[target_feature(enable = "avx512vnni")]
#[cfg_attr(test, assert_instr(vpdpbusds))]
pub unsafe fn _mm512_maskz_dpbusds_epi32(
k: __mmask16,
src: __m512i,
a: __m512i,
b: __m512i,
) -> __m512i {
let r = _mm512_dpbusds_epi32(src, a, b).as_i32x16();
let zero = _mm512_setzero_si512().as_i32x16();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusds))]
pub unsafe fn _mm256_dpbusds_epi32(src: __m256i, a: __m256i, b: __m256i) -> __m256i {
transmute(vpdpbusds256(src.as_i32x8(), a.as_i32x8(), b.as_i32x8()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusds))]
pub unsafe fn _mm256_mask_dpbusds_epi32(
src: __m256i,
k: __mmask8,
a: __m256i,
b: __m256i,
) -> __m256i {
let r = _mm256_dpbusds_epi32(src, a, b).as_i32x8();
transmute(simd_select_bitmask(k, r, src.as_i32x8()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusds))]
pub unsafe fn _mm256_maskz_dpbusds_epi32(
k: __mmask8,
src: __m256i,
a: __m256i,
b: __m256i,
) -> __m256i {
let r = _mm256_dpbusds_epi32(src, a, b).as_i32x8();
let zero = _mm256_setzero_si256().as_i32x8();
transmute(simd_select_bitmask(k, r, zero))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusds))]
pub unsafe fn _mm_dpbusds_epi32(src: __m128i, a: __m128i, b: __m128i) -> __m128i {
transmute(vpdpbusds128(src.as_i32x4(), a.as_i32x4(), b.as_i32x4()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusds))]
pub unsafe fn _mm_mask_dpbusds_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
let r = _mm_dpbusds_epi32(src, a, b).as_i32x4();
transmute(simd_select_bitmask(k, r, src.as_i32x4()))
}
#[inline]
#[target_feature(enable = "avx512vnni,avx512vl")]
#[cfg_attr(test, assert_instr(vpdpbusds))]
pub unsafe fn _mm_maskz_dpbusds_epi32(
k: __mmask8,
src: __m128i,
a: __m128i,
b: __m128i,
) -> __m128i {
let r = _mm_dpbusds_epi32(src, a, b).as_i32x4();
let zero = _mm_setzero_si128().as_i32x4();
transmute(simd_select_bitmask(k, r, zero))
}
#[allow(improper_ctypes)]
extern "C" {
#[link_name = "llvm.x86.avx512.vpdpwssd.512"]
fn vpdpwssd(src: i32x16, a: i32x16, b: i32x16) -> i32x16;
#[link_name = "llvm.x86.avx512.vpdpwssd.256"]
fn vpdpwssd256(src: i32x8, a: i32x8, b: i32x8) -> i32x8;
#[link_name = "llvm.x86.avx512.vpdpwssd.128"]
fn vpdpwssd128(src: i32x4, a: i32x4, b: i32x4) -> i32x4;
#[link_name = "llvm.x86.avx512.vpdpwssds.512"]
fn vpdpwssds(src: i32x16, a: i32x16, b: i32x16) -> i32x16;
#[link_name = "llvm.x86.avx512.vpdpwssds.256"]
fn vpdpwssds256(src: i32x8, a: i32x8, b: i32x8) -> i32x8;
#[link_name = "llvm.x86.avx512.vpdpwssds.128"]
fn vpdpwssds128(src: i32x4, a: i32x4, b: i32x4) -> i32x4;
#[link_name = "llvm.x86.avx512.vpdpbusd.512"]
fn vpdpbusd(src: i32x16, a: i32x16, b: i32x16) -> i32x16;
#[link_name = "llvm.x86.avx512.vpdpbusd.256"]
fn vpdpbusd256(src: i32x8, a: i32x8, b: i32x8) -> i32x8;
#[link_name = "llvm.x86.avx512.vpdpbusd.128"]
fn vpdpbusd128(src: i32x4, a: i32x4, b: i32x4) -> i32x4;
#[link_name = "llvm.x86.avx512.vpdpbusds.512"]
fn vpdpbusds(src: i32x16, a: i32x16, b: i32x16) -> i32x16;
#[link_name = "llvm.x86.avx512.vpdpbusds.256"]
fn vpdpbusds256(src: i32x8, a: i32x8, b: i32x8) -> i32x8;
#[link_name = "llvm.x86.avx512.vpdpbusds.128"]
fn vpdpbusds128(src: i32x4, a: i32x4, b: i32x4) -> i32x4;
}
#[cfg(test)]
mod tests {
use crate::core_arch::x86::*;
use stdarch_test::simd_test;
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_dpwssd_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 16 | 1 << 0);
let b = _mm512_set1_epi32(1 << 16 | 1 << 0);
let r = _mm512_dpwssd_epi32(src, a, b);
let e = _mm512_set1_epi32(3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_mask_dpwssd_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 16 | 1 << 0);
let b = _mm512_set1_epi32(1 << 16 | 1 << 0);
let r = _mm512_mask_dpwssd_epi32(src, 0b00000000_00000000, a, b);
assert_eq_m512i(r, src);
let r = _mm512_mask_dpwssd_epi32(src, 0b11111111_11111111, a, b);
let e = _mm512_set1_epi32(3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_maskz_dpwssd_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 16 | 1 << 0);
let b = _mm512_set1_epi32(1 << 16 | 1 << 0);
let r = _mm512_maskz_dpwssd_epi32(0b00000000_00000000, src, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_dpwssd_epi32(0b11111111_11111111, src, a, b);
let e = _mm512_set1_epi32(3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_dpwssd_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 16 | 1 << 0);
let b = _mm256_set1_epi32(1 << 16 | 1 << 0);
let r = _mm256_dpwssd_epi32(src, a, b);
let e = _mm256_set1_epi32(3);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_mask_dpwssd_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 16 | 1 << 0);
let b = _mm256_set1_epi32(1 << 16 | 1 << 0);
let r = _mm256_mask_dpwssd_epi32(src, 0b00000000, a, b);
assert_eq_m256i(r, src);
let r = _mm256_mask_dpwssd_epi32(src, 0b11111111, a, b);
let e = _mm256_set1_epi32(3);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_maskz_dpwssd_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 16 | 1 << 0);
let b = _mm256_set1_epi32(1 << 16 | 1 << 0);
let r = _mm256_maskz_dpwssd_epi32(0b00000000, src, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_dpwssd_epi32(0b11111111, src, a, b);
let e = _mm256_set1_epi32(3);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_dpwssd_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 16 | 1 << 0);
let b = _mm_set1_epi32(1 << 16 | 1 << 0);
let r = _mm_dpwssd_epi32(src, a, b);
let e = _mm_set1_epi32(3);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_mask_dpwssd_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 16 | 1 << 0);
let b = _mm_set1_epi32(1 << 16 | 1 << 0);
let r = _mm_mask_dpwssd_epi32(src, 0b00000000, a, b);
assert_eq_m128i(r, src);
let r = _mm_mask_dpwssd_epi32(src, 0b00001111, a, b);
let e = _mm_set1_epi32(3);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_maskz_dpwssd_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 16 | 1 << 0);
let b = _mm_set1_epi32(1 << 16 | 1 << 0);
let r = _mm_maskz_dpwssd_epi32(0b00000000, src, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_dpwssd_epi32(0b00001111, src, a, b);
let e = _mm_set1_epi32(3);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_dpwssds_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 16 | 1 << 0);
let b = _mm512_set1_epi32(1 << 16 | 1 << 0);
let r = _mm512_dpwssds_epi32(src, a, b);
let e = _mm512_set1_epi32(3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_mask_dpwssds_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 16 | 1 << 0);
let b = _mm512_set1_epi32(1 << 16 | 1 << 0);
let r = _mm512_mask_dpwssds_epi32(src, 0b00000000_00000000, a, b);
assert_eq_m512i(r, src);
let r = _mm512_mask_dpwssds_epi32(src, 0b11111111_11111111, a, b);
let e = _mm512_set1_epi32(3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_maskz_dpwssds_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 16 | 1 << 0);
let b = _mm512_set1_epi32(1 << 16 | 1 << 0);
let r = _mm512_maskz_dpwssds_epi32(0b00000000_00000000, src, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_dpwssds_epi32(0b11111111_11111111, src, a, b);
let e = _mm512_set1_epi32(3);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_dpwssds_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 16 | 1 << 0);
let b = _mm256_set1_epi32(1 << 16 | 1 << 0);
let r = _mm256_dpwssds_epi32(src, a, b);
let e = _mm256_set1_epi32(3);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_mask_dpwssds_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 16 | 1 << 0);
let b = _mm256_set1_epi32(1 << 16 | 1 << 0);
let r = _mm256_mask_dpwssds_epi32(src, 0b00000000, a, b);
assert_eq_m256i(r, src);
let r = _mm256_mask_dpwssds_epi32(src, 0b11111111, a, b);
let e = _mm256_set1_epi32(3);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_maskz_dpwssds_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 16 | 1 << 0);
let b = _mm256_set1_epi32(1 << 16 | 1 << 0);
let r = _mm256_maskz_dpwssds_epi32(0b00000000, src, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_dpwssds_epi32(0b11111111, src, a, b);
let e = _mm256_set1_epi32(3);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_dpwssds_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 16 | 1 << 0);
let b = _mm_set1_epi32(1 << 16 | 1 << 0);
let r = _mm_dpwssds_epi32(src, a, b);
let e = _mm_set1_epi32(3);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_mask_dpwssds_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 16 | 1 << 0);
let b = _mm_set1_epi32(1 << 16 | 1 << 0);
let r = _mm_mask_dpwssds_epi32(src, 0b00000000, a, b);
assert_eq_m128i(r, src);
let r = _mm_mask_dpwssds_epi32(src, 0b00001111, a, b);
let e = _mm_set1_epi32(3);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_maskz_dpwssds_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 16 | 1 << 0);
let b = _mm_set1_epi32(1 << 16 | 1 << 0);
let r = _mm_maskz_dpwssds_epi32(0b00000000, src, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_dpwssds_epi32(0b00001111, src, a, b);
let e = _mm_set1_epi32(3);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_dpbusd_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm512_dpbusd_epi32(src, a, b);
let e = _mm512_set1_epi32(5);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_mask_dpbusd_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm512_mask_dpbusd_epi32(src, 0b00000000_00000000, a, b);
assert_eq_m512i(r, src);
let r = _mm512_mask_dpbusd_epi32(src, 0b11111111_11111111, a, b);
let e = _mm512_set1_epi32(5);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_maskz_dpbusd_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm512_maskz_dpbusd_epi32(0b00000000_00000000, src, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_dpbusd_epi32(0b11111111_11111111, src, a, b);
let e = _mm512_set1_epi32(5);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_dpbusd_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm256_dpbusd_epi32(src, a, b);
let e = _mm256_set1_epi32(5);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_mask_dpbusd_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm256_mask_dpbusd_epi32(src, 0b00000000, a, b);
assert_eq_m256i(r, src);
let r = _mm256_mask_dpbusd_epi32(src, 0b11111111, a, b);
let e = _mm256_set1_epi32(5);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_maskz_dpbusd_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm256_maskz_dpbusd_epi32(0b00000000, src, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_dpbusd_epi32(0b11111111, src, a, b);
let e = _mm256_set1_epi32(5);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_dpbusd_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm_dpbusd_epi32(src, a, b);
let e = _mm_set1_epi32(5);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_mask_dpbusd_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm_mask_dpbusd_epi32(src, 0b00000000, a, b);
assert_eq_m128i(r, src);
let r = _mm_mask_dpbusd_epi32(src, 0b00001111, a, b);
let e = _mm_set1_epi32(5);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_maskz_dpbusd_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm_maskz_dpbusd_epi32(0b00000000, src, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_dpbusd_epi32(0b00001111, src, a, b);
let e = _mm_set1_epi32(5);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_dpbusds_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm512_dpbusds_epi32(src, a, b);
let e = _mm512_set1_epi32(5);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_mask_dpbusds_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm512_mask_dpbusds_epi32(src, 0b00000000_00000000, a, b);
assert_eq_m512i(r, src);
let r = _mm512_mask_dpbusds_epi32(src, 0b11111111_11111111, a, b);
let e = _mm512_set1_epi32(5);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni")]
unsafe fn test_mm512_maskz_dpbusds_epi32() {
let src = _mm512_set1_epi32(1);
let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm512_maskz_dpbusds_epi32(0b00000000_00000000, src, a, b);
assert_eq_m512i(r, _mm512_setzero_si512());
let r = _mm512_maskz_dpbusds_epi32(0b11111111_11111111, src, a, b);
let e = _mm512_set1_epi32(5);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_dpbusds_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm256_dpbusds_epi32(src, a, b);
let e = _mm256_set1_epi32(5);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_mask_dpbusds_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm256_mask_dpbusds_epi32(src, 0b00000000, a, b);
assert_eq_m256i(r, src);
let r = _mm256_mask_dpbusds_epi32(src, 0b11111111, a, b);
let e = _mm256_set1_epi32(5);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm256_maskz_dpbusds_epi32() {
let src = _mm256_set1_epi32(1);
let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm256_maskz_dpbusds_epi32(0b00000000, src, a, b);
assert_eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_dpbusds_epi32(0b11111111, src, a, b);
let e = _mm256_set1_epi32(5);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_dpbusds_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm_dpbusds_epi32(src, a, b);
let e = _mm_set1_epi32(5);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_mask_dpbusds_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm_mask_dpbusds_epi32(src, 0b00000000, a, b);
assert_eq_m128i(r, src);
let r = _mm_mask_dpbusds_epi32(src, 0b00001111, a, b);
let e = _mm_set1_epi32(5);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "avx512vnni,avx512vl")]
unsafe fn test_mm_maskz_dpbusds_epi32() {
let src = _mm_set1_epi32(1);
let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0);
let r = _mm_maskz_dpbusds_epi32(0b00000000, src, a, b);
assert_eq_m128i(r, _mm_setzero_si128());
let r = _mm_maskz_dpbusds_epi32(0b00001111, src, a, b);
let e = _mm_set1_epi32(5);
assert_eq_m128i(r, e);
}
}