use crate::core_arch::x86::*;
#[cfg(test)]
use stdarch_test::assert_instr;
#[inline]
#[target_feature(enable = "avx512ifma")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmadd52huq))]
pub unsafe fn _mm512_madd52hi_epu64(a: __m512i, b: __m512i, c: __m512i) -> __m512i {
vpmadd52huq_512(a, b, c)
}
#[inline]
#[target_feature(enable = "avx512ifma")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmadd52luq))]
pub unsafe fn _mm512_madd52lo_epu64(a: __m512i, b: __m512i, c: __m512i) -> __m512i {
vpmadd52luq_512(a, b, c)
}
#[inline]
#[target_feature(enable = "avx512ifma,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmadd52huq))]
pub unsafe fn _mm256_madd52hi_epu64(a: __m256i, b: __m256i, c: __m256i) -> __m256i {
vpmadd52huq_256(a, b, c)
}
#[inline]
#[target_feature(enable = "avx512ifma,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmadd52luq))]
pub unsafe fn _mm256_madd52lo_epu64(a: __m256i, b: __m256i, c: __m256i) -> __m256i {
vpmadd52luq_256(a, b, c)
}
#[inline]
#[target_feature(enable = "avx512ifma,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmadd52huq))]
pub unsafe fn _mm_madd52hi_epu64(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
vpmadd52huq_128(a, b, c)
}
#[inline]
#[target_feature(enable = "avx512ifma,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
#[cfg_attr(test, assert_instr(vpmadd52luq))]
pub unsafe fn _mm_madd52lo_epu64(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
vpmadd52luq_128(a, b, c)
}
#[allow(improper_ctypes)]
extern "C" {
#[link_name = "llvm.x86.avx512.vpmadd52l.uq.128"]
fn vpmadd52luq_128(z: __m128i, x: __m128i, y: __m128i) -> __m128i;
#[link_name = "llvm.x86.avx512.vpmadd52h.uq.128"]
fn vpmadd52huq_128(z: __m128i, x: __m128i, y: __m128i) -> __m128i;
#[link_name = "llvm.x86.avx512.vpmadd52l.uq.256"]
fn vpmadd52luq_256(z: __m256i, x: __m256i, y: __m256i) -> __m256i;
#[link_name = "llvm.x86.avx512.vpmadd52h.uq.256"]
fn vpmadd52huq_256(z: __m256i, x: __m256i, y: __m256i) -> __m256i;
#[link_name = "llvm.x86.avx512.vpmadd52l.uq.512"]
fn vpmadd52luq_512(z: __m512i, x: __m512i, y: __m512i) -> __m512i;
#[link_name = "llvm.x86.avx512.vpmadd52h.uq.512"]
fn vpmadd52huq_512(z: __m512i, x: __m512i, y: __m512i) -> __m512i;
}
#[cfg(test)]
mod tests {
use stdarch_test::simd_test;
use crate::core_arch::x86::*;
#[simd_test(enable = "avx512ifma")]
unsafe fn test_mm512_madd52hi_epu64() {
let mut a = _mm512_set1_epi64(10 << 40);
let b = _mm512_set1_epi64((11 << 40) + 4);
let c = _mm512_set1_epi64((12 << 40) + 3);
a = _mm512_madd52hi_epu64(a, b, c);
let expected = _mm512_set1_epi64(11030549757952);
assert_eq_m512i(a, expected);
}
#[simd_test(enable = "avx512ifma")]
unsafe fn test_mm512_madd52lo_epu64() {
let mut a = _mm512_set1_epi64(10 << 40);
let b = _mm512_set1_epi64((11 << 40) + 4);
let c = _mm512_set1_epi64((12 << 40) + 3);
a = _mm512_madd52lo_epu64(a, b, c);
let expected = _mm512_set1_epi64(100055558127628);
assert_eq_m512i(a, expected);
}
#[simd_test(enable = "avx512ifma,avx512vl")]
unsafe fn test_mm256_madd52hi_epu64() {
let mut a = _mm256_set1_epi64x(10 << 40);
let b = _mm256_set1_epi64x((11 << 40) + 4);
let c = _mm256_set1_epi64x((12 << 40) + 3);
a = _mm256_madd52hi_epu64(a, b, c);
let expected = _mm256_set1_epi64x(11030549757952);
assert_eq_m256i(a, expected);
}
#[simd_test(enable = "avx512ifma,avx512vl")]
unsafe fn test_mm256_madd52lo_epu64() {
let mut a = _mm256_set1_epi64x(10 << 40);
let b = _mm256_set1_epi64x((11 << 40) + 4);
let c = _mm256_set1_epi64x((12 << 40) + 3);
a = _mm256_madd52lo_epu64(a, b, c);
let expected = _mm256_set1_epi64x(100055558127628);
assert_eq_m256i(a, expected);
}
#[simd_test(enable = "avx512ifma,avx512vl")]
unsafe fn test_mm_madd52hi_epu64() {
let mut a = _mm_set1_epi64x(10 << 40);
let b = _mm_set1_epi64x((11 << 40) + 4);
let c = _mm_set1_epi64x((12 << 40) + 3);
a = _mm_madd52hi_epu64(a, b, c);
let expected = _mm_set1_epi64x(11030549757952);
assert_eq_m128i(a, expected);
}
#[simd_test(enable = "avx512ifma,avx512vl")]
unsafe fn test_mm_madd52lo_epu64() {
let mut a = _mm_set1_epi64x(10 << 40);
let b = _mm_set1_epi64x((11 << 40) + 4);
let c = _mm_set1_epi64x((12 << 40) + 3);
a = _mm_madd52hi_epu64(a, b, c);
let expected = _mm_set1_epi64x(11030549757952);
assert_eq_m128i(a, expected);
}
}