summaryrefslogtreecommitdiffstats
path: root/library/stdarch/crates/core_arch/src/x86
diff options
context:
space:
mode:
Diffstat (limited to 'library/stdarch/crates/core_arch/src/x86')
-rw-r--r--library/stdarch/crates/core_arch/src/x86/abm.rs62
-rw-r--r--library/stdarch/crates/core_arch/src/x86/adx.rs158
-rw-r--r--library/stdarch/crates/core_arch/src/x86/aes.rs171
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx.rs4862
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx2.rs5908
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512bf16.rs1573
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512bitalg.rs760
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512bw.rs18785
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512cd.rs1170
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512f.rs55830
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512gfni.rs1492
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512ifma.rs196
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512vaes.rs332
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512vbmi.rs916
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512vbmi2.rs4121
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512vnni.rs939
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512vpclmulqdq.rs258
-rw-r--r--library/stdarch/crates/core_arch/src/x86/avx512vpopcntdq.rs541
-rw-r--r--library/stdarch/crates/core_arch/src/x86/bmi1.rs178
-rw-r--r--library/stdarch/crates/core_arch/src/x86/bmi2.rs133
-rw-r--r--library/stdarch/crates/core_arch/src/x86/bswap.rs28
-rw-r--r--library/stdarch/crates/core_arch/src/x86/bt.rs135
-rw-r--r--library/stdarch/crates/core_arch/src/x86/cpuid.rs197
-rw-r--r--library/stdarch/crates/core_arch/src/x86/eflags.rs85
-rw-r--r--library/stdarch/crates/core_arch/src/x86/f16c.rs112
-rw-r--r--library/stdarch/crates/core_arch/src/x86/fma.rs795
-rw-r--r--library/stdarch/crates/core_arch/src/x86/fxsr.rs112
-rw-r--r--library/stdarch/crates/core_arch/src/x86/macros.rs104
-rw-r--r--library/stdarch/crates/core_arch/src/x86/mod.rs860
-rw-r--r--library/stdarch/crates/core_arch/src/x86/pclmulqdq.rs70
-rw-r--r--library/stdarch/crates/core_arch/src/x86/rdrand.rs75
-rw-r--r--library/stdarch/crates/core_arch/src/x86/rdtsc.rs77
-rw-r--r--library/stdarch/crates/core_arch/src/x86/rtm.rs162
-rw-r--r--library/stdarch/crates/core_arch/src/x86/sha.rs221
-rw-r--r--library/stdarch/crates/core_arch/src/x86/sse.rs3276
-rw-r--r--library/stdarch/crates/core_arch/src/x86/sse2.rs4886
-rw-r--r--library/stdarch/crates/core_arch/src/x86/sse3.rs260
-rw-r--r--library/stdarch/crates/core_arch/src/x86/sse41.rs1887
-rw-r--r--library/stdarch/crates/core_arch/src/x86/sse42.rs802
-rw-r--r--library/stdarch/crates/core_arch/src/x86/sse4a.rs164
-rw-r--r--library/stdarch/crates/core_arch/src/x86/ssse3.rs537
-rw-r--r--library/stdarch/crates/core_arch/src/x86/tbm.rs460
-rw-r--r--library/stdarch/crates/core_arch/src/x86/test.rs144
-rw-r--r--library/stdarch/crates/core_arch/src/x86/xsave.rs282
44 files changed, 114116 insertions, 0 deletions
diff --git a/library/stdarch/crates/core_arch/src/x86/abm.rs b/library/stdarch/crates/core_arch/src/x86/abm.rs
new file mode 100644
index 000000000..50912f774
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/abm.rs
@@ -0,0 +1,62 @@
+//! Advanced Bit Manipulation (ABM) instructions
+//!
+//! The POPCNT and LZCNT have their own CPUID bits to indicate support.
+//!
+//! The references are:
+//!
+//! - [Intel 64 and IA-32 Architectures Software Developer's Manual Volume 2:
+//! Instruction Set Reference, A-Z][intel64_ref].
+//! - [AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and
+//! System Instructions][amd64_ref].
+//!
+//! [Wikipedia][wikipedia_bmi] provides a quick overview of the instructions
+//! available.
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf
+//! [wikipedia_bmi]:
+//! https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Counts the leading most significant zero bits.
+///
+/// When the operand is zero, it returns its size in bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_lzcnt_u32)
+#[inline]
+#[target_feature(enable = "lzcnt")]
+#[cfg_attr(test, assert_instr(lzcnt))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _lzcnt_u32(x: u32) -> u32 {
+ x.leading_zeros()
+}
+
+/// Counts the bits that are set.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_popcnt32)
+#[inline]
+#[target_feature(enable = "popcnt")]
+#[cfg_attr(test, assert_instr(popcnt))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _popcnt32(x: i32) -> i32 {
+ x.count_ones() as i32
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "lzcnt")]
+ unsafe fn test_lzcnt_u32() {
+ assert_eq!(_lzcnt_u32(0b0101_1010), 25);
+ }
+
+ #[simd_test(enable = "popcnt")]
+ unsafe fn test_popcnt32() {
+ assert_eq!(_popcnt32(0b0101_1010), 4);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/adx.rs b/library/stdarch/crates/core_arch/src/x86/adx.rs
new file mode 100644
index 000000000..15fcec8a5
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/adx.rs
@@ -0,0 +1,158 @@
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "unadjusted" {
+ #[link_name = "llvm.x86.addcarry.32"]
+ fn llvm_addcarry_u32(a: u8, b: u32, c: u32) -> (u8, u32);
+ #[link_name = "llvm.x86.addcarryx.u32"]
+ fn llvm_addcarryx_u32(a: u8, b: u32, c: u32, d: *mut u8) -> u8;
+ #[link_name = "llvm.x86.subborrow.32"]
+ fn llvm_subborrow_u32(a: u8, b: u32, c: u32) -> (u8, u32);
+}
+
+/// Adds unsigned 32-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`
+/// (carry flag), and store the unsigned 32-bit result in `out`, and the carry-out
+/// is returned (carry or overflow flag).
+#[inline]
+#[cfg_attr(test, assert_instr(adc))]
+#[stable(feature = "simd_x86_adx", since = "1.33.0")]
+pub unsafe fn _addcarry_u32(c_in: u8, a: u32, b: u32, out: &mut u32) -> u8 {
+ let (a, b) = llvm_addcarry_u32(c_in, a, b);
+ *out = b;
+ a
+}
+
+/// Adds unsigned 32-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`
+/// (carry or overflow flag), and store the unsigned 32-bit result in `out`, and
+/// the carry-out is returned (carry or overflow flag).
+#[inline]
+#[target_feature(enable = "adx")]
+#[cfg_attr(test, assert_instr(adc))]
+#[stable(feature = "simd_x86_adx", since = "1.33.0")]
+pub unsafe fn _addcarryx_u32(c_in: u8, a: u32, b: u32, out: &mut u32) -> u8 {
+ llvm_addcarryx_u32(c_in, a, b, out as *mut _ as *mut u8)
+}
+
+/// Adds unsigned 32-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`
+/// (carry or overflow flag), and store the unsigned 32-bit result in `out`, and
+/// the carry-out is returned (carry or overflow flag).
+#[inline]
+#[cfg_attr(test, assert_instr(sbb))]
+#[stable(feature = "simd_x86_adx", since = "1.33.0")]
+pub unsafe fn _subborrow_u32(c_in: u8, a: u32, b: u32, out: &mut u32) -> u8 {
+ let (a, b) = llvm_subborrow_u32(c_in, a, b);
+ *out = b;
+ a
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[test]
+ fn test_addcarry_u32() {
+ unsafe {
+ let a = u32::MAX;
+ let mut out = 0;
+
+ let r = _addcarry_u32(0, a, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 0);
+
+ let r = _addcarry_u32(0, a, 0, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, a);
+
+ let r = _addcarry_u32(1, a, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 1);
+
+ let r = _addcarry_u32(1, a, 0, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 0);
+
+ let r = _addcarry_u32(0, 3, 4, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 7);
+
+ let r = _addcarry_u32(1, 3, 4, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 8);
+ }
+ }
+
+ #[simd_test(enable = "adx")]
+ unsafe fn test_addcarryx_u32() {
+ let a = u32::MAX;
+ let mut out = 0;
+
+ let r = _addcarryx_u32(0, a, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 0);
+
+ let r = _addcarryx_u32(0, a, 0, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, a);
+
+ let r = _addcarryx_u32(1, a, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 1);
+
+ let r = _addcarryx_u32(1, a, 0, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 0);
+
+ let r = _addcarryx_u32(0, 3, 4, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 7);
+
+ let r = _addcarryx_u32(1, 3, 4, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 8);
+ }
+
+ #[simd_test(enable = "adx")]
+ unsafe fn test_addcarryx_u32_2() {
+ unsafe fn add_1_2_3() -> u32 {
+ let mut out = 0;
+ _addcarryx_u32(1, 2, 3, &mut out);
+ out
+ }
+ assert_eq!(6, add_1_2_3());
+ }
+
+ #[test]
+ fn test_subborrow_u32() {
+ unsafe {
+ let a = u32::MAX;
+ let mut out = 0;
+
+ let r = _subborrow_u32(0, 0, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, a);
+
+ let r = _subborrow_u32(0, 0, 0, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 0);
+
+ let r = _subborrow_u32(1, 0, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, a - 1);
+
+ let r = _subborrow_u32(1, 0, 0, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, a);
+
+ let r = _subborrow_u32(0, 7, 3, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 4);
+
+ let r = _subborrow_u32(1, 7, 3, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 3);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/aes.rs b/library/stdarch/crates/core_arch/src/x86/aes.rs
new file mode 100644
index 000000000..ffded1a0d
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/aes.rs
@@ -0,0 +1,171 @@
+//! AES New Instructions (AES-NI)
+//!
+//! The intrinsics here correspond to those in the `wmmintrin.h` C header.
+//!
+//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
+//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref].
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+
+use crate::core_arch::x86::__m128i;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.aesni.aesdec"]
+ fn aesdec(a: __m128i, round_key: __m128i) -> __m128i;
+ #[link_name = "llvm.x86.aesni.aesdeclast"]
+ fn aesdeclast(a: __m128i, round_key: __m128i) -> __m128i;
+ #[link_name = "llvm.x86.aesni.aesenc"]
+ fn aesenc(a: __m128i, round_key: __m128i) -> __m128i;
+ #[link_name = "llvm.x86.aesni.aesenclast"]
+ fn aesenclast(a: __m128i, round_key: __m128i) -> __m128i;
+ #[link_name = "llvm.x86.aesni.aesimc"]
+ fn aesimc(a: __m128i) -> __m128i;
+ #[link_name = "llvm.x86.aesni.aeskeygenassist"]
+ fn aeskeygenassist(a: __m128i, imm8: u8) -> __m128i;
+}
+
+/// Performs one round of an AES decryption flow on data (state) in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aesdec_si128)
+#[inline]
+#[target_feature(enable = "aes")]
+#[cfg_attr(test, assert_instr(aesdec))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_aesdec_si128(a: __m128i, round_key: __m128i) -> __m128i {
+ aesdec(a, round_key)
+}
+
+/// Performs the last round of an AES decryption flow on data (state) in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aesdeclast_si128)
+#[inline]
+#[target_feature(enable = "aes")]
+#[cfg_attr(test, assert_instr(aesdeclast))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_aesdeclast_si128(a: __m128i, round_key: __m128i) -> __m128i {
+ aesdeclast(a, round_key)
+}
+
+/// Performs one round of an AES encryption flow on data (state) in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aesenc_si128)
+#[inline]
+#[target_feature(enable = "aes")]
+#[cfg_attr(test, assert_instr(aesenc))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_aesenc_si128(a: __m128i, round_key: __m128i) -> __m128i {
+ aesenc(a, round_key)
+}
+
+/// Performs the last round of an AES encryption flow on data (state) in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aesenclast_si128)
+#[inline]
+#[target_feature(enable = "aes")]
+#[cfg_attr(test, assert_instr(aesenclast))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_aesenclast_si128(a: __m128i, round_key: __m128i) -> __m128i {
+ aesenclast(a, round_key)
+}
+
+/// Performs the `InvMixColumns` transformation on `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aesimc_si128)
+#[inline]
+#[target_feature(enable = "aes")]
+#[cfg_attr(test, assert_instr(aesimc))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_aesimc_si128(a: __m128i) -> __m128i {
+ aesimc(a)
+}
+
+/// Assist in expanding the AES cipher key.
+///
+/// Assist in expanding the AES cipher key by computing steps towards
+/// generating a round key for encryption cipher using data from `a` and an
+/// 8-bit round constant `IMM8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aeskeygenassist_si128)
+#[inline]
+#[target_feature(enable = "aes")]
+#[cfg_attr(test, assert_instr(aeskeygenassist, IMM8 = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_aeskeygenassist_si128<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ aeskeygenassist(a, IMM8 as u8)
+}
+
+#[cfg(test)]
+mod tests {
+ // The constants in the tests below are just bit patterns. They should not
+ // be interpreted as integers; signedness does not make sense for them, but
+ // __m128i happens to be defined in terms of signed integers.
+ #![allow(overflowing_literals)]
+
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "aes")]
+ unsafe fn test_mm_aesdec_si128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc664949.aspx.
+ let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff);
+ let k = _mm_set_epi64x(0x1133557799bbddff, 0x0022446688aaccee);
+ let e = _mm_set_epi64x(0x044e4f5176fec48f, 0xb57ecfa381da39ee);
+ let r = _mm_aesdec_si128(a, k);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "aes")]
+ unsafe fn test_mm_aesdeclast_si128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc714178.aspx.
+ let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff);
+ let k = _mm_set_epi64x(0x1133557799bbddff, 0x0022446688aaccee);
+ let e = _mm_set_epi64x(0x36cad57d9072bf9e, 0xf210dd981fa4a493);
+ let r = _mm_aesdeclast_si128(a, k);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "aes")]
+ unsafe fn test_mm_aesenc_si128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc664810.aspx.
+ let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff);
+ let k = _mm_set_epi64x(0x1133557799bbddff, 0x0022446688aaccee);
+ let e = _mm_set_epi64x(0x16ab0e57dfc442ed, 0x28e4ee1884504333);
+ let r = _mm_aesenc_si128(a, k);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "aes")]
+ unsafe fn test_mm_aesenclast_si128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc714136.aspx.
+ let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff);
+ let k = _mm_set_epi64x(0x1133557799bbddff, 0x0022446688aaccee);
+ let e = _mm_set_epi64x(0xb6dd7df25d7ab320, 0x4b04f98cf4c860f8);
+ let r = _mm_aesenclast_si128(a, k);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "aes")]
+ unsafe fn test_mm_aesimc_si128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc714195.aspx.
+ let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff);
+ let e = _mm_set_epi64x(0xc66c82284ee40aa0, 0x6633441122770055);
+ let r = _mm_aesimc_si128(a);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "aes")]
+ unsafe fn test_mm_aeskeygenassist_si128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc714138.aspx.
+ let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff);
+ let e = _mm_set_epi64x(0x857c266b7c266e85, 0xeac4eea9c4eeacea);
+ let r = _mm_aeskeygenassist_si128::<5>(a);
+ assert_eq_m128i(r, e);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx.rs b/library/stdarch/crates/core_arch/src/x86/avx.rs
new file mode 100644
index 000000000..ad9e68db6
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx.rs
@@ -0,0 +1,4862 @@
+//! Advanced Vector Extensions (AVX)
+//!
+//! The references are:
+//!
+//! - [Intel 64 and IA-32 Architectures Software Developer's Manual Volume 2:
+//! Instruction Set Reference, A-Z][intel64_ref]. - [AMD64 Architecture
+//! Programmer's Manual, Volume 3: General-Purpose and System
+//! Instructions][amd64_ref].
+//!
+//! [Wikipedia][wiki] provides a quick overview of the instructions available.
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf
+//! [wiki]: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions
+
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ intrinsics,
+ mem::{self, transmute},
+ ptr,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Adds packed double-precision (64-bit) floating-point elements
+/// in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_add_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vaddpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_add_pd(a: __m256d, b: __m256d) -> __m256d {
+ simd_add(a, b)
+}
+
+/// Adds packed single-precision (32-bit) floating-point elements in `a` and
+/// `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_add_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vaddps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_add_ps(a: __m256, b: __m256) -> __m256 {
+ simd_add(a, b)
+}
+
+/// Computes the bitwise AND of a packed double-precision (64-bit)
+/// floating-point elements in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_and_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// FIXME: Should be 'vandpd' instruction.
+// See https://github.com/rust-lang/stdarch/issues/71
+#[cfg_attr(test, assert_instr(vandps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_and_pd(a: __m256d, b: __m256d) -> __m256d {
+ let a: u64x4 = transmute(a);
+ let b: u64x4 = transmute(b);
+ transmute(simd_and(a, b))
+}
+
+/// Computes the bitwise AND of packed single-precision (32-bit) floating-point
+/// elements in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_and_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vandps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_and_ps(a: __m256, b: __m256) -> __m256 {
+ let a: u32x8 = transmute(a);
+ let b: u32x8 = transmute(b);
+ transmute(simd_and(a, b))
+}
+
+/// Computes the bitwise OR packed double-precision (64-bit) floating-point
+/// elements in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_or_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// FIXME: should be `vorpd` instruction.
+// See <https://github.com/rust-lang/stdarch/issues/71>.
+#[cfg_attr(test, assert_instr(vorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_or_pd(a: __m256d, b: __m256d) -> __m256d {
+ let a: u64x4 = transmute(a);
+ let b: u64x4 = transmute(b);
+ transmute(simd_or(a, b))
+}
+
+/// Computes the bitwise OR packed single-precision (32-bit) floating-point
+/// elements in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_or_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_or_ps(a: __m256, b: __m256) -> __m256 {
+ let a: u32x8 = transmute(a);
+ let b: u32x8 = transmute(b);
+ transmute(simd_or(a, b))
+}
+
+/// Shuffles double-precision (64-bit) floating-point elements within 128-bit
+/// lanes using the control in `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shuffle_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vshufpd, MASK = 3))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_shuffle_pd<const MASK: i32>(a: __m256d, b: __m256d) -> __m256d {
+ static_assert_imm8!(MASK);
+ simd_shuffle4!(
+ a,
+ b,
+ <const MASK: i32> [
+ MASK as u32 & 0b1,
+ ((MASK as u32 >> 1) & 0b1) + 4,
+ ((MASK as u32 >> 2) & 0b1) + 2,
+ ((MASK as u32 >> 3) & 0b1) + 6,
+ ],
+ )
+}
+
+/// Shuffles single-precision (32-bit) floating-point elements in `a` within
+/// 128-bit lanes using the control in `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shuffle_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vshufps, MASK = 3))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_shuffle_ps<const MASK: i32>(a: __m256, b: __m256) -> __m256 {
+ static_assert_imm8!(MASK);
+ simd_shuffle8!(
+ a,
+ b,
+ <const MASK: i32> [
+ MASK as u32 & 0b11,
+ (MASK as u32 >> 2) & 0b11,
+ ((MASK as u32 >> 4) & 0b11) + 8,
+ ((MASK as u32 >> 6) & 0b11) + 8,
+ (MASK as u32 & 0b11) + 4,
+ ((MASK as u32 >> 2) & 0b11) + 4,
+ ((MASK as u32 >> 4) & 0b11) + 12,
+ ((MASK as u32 >> 6) & 0b11) + 12,
+ ],
+ )
+}
+
+/// Computes the bitwise NOT of packed double-precision (64-bit) floating-point
+/// elements in `a`, and then AND with `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_andnot_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// FIXME: should be `vandnpd` instruction.
+#[cfg_attr(test, assert_instr(vandnps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_andnot_pd(a: __m256d, b: __m256d) -> __m256d {
+ let a: u64x4 = transmute(a);
+ let b: u64x4 = transmute(b);
+ transmute(simd_and(simd_xor(u64x4::splat(!(0_u64)), a), b))
+}
+
+/// Computes the bitwise NOT of packed single-precision (32-bit) floating-point
+/// elements in `a`
+/// and then AND with `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_andnot_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vandnps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_andnot_ps(a: __m256, b: __m256) -> __m256 {
+ let a: u32x8 = transmute(a);
+ let b: u32x8 = transmute(b);
+ transmute(simd_and(simd_xor(u32x8::splat(!(0_u32)), a), b))
+}
+
+/// Compares packed double-precision (64-bit) floating-point elements
+/// in `a` and `b`, and returns packed maximum values
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_max_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmaxpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_max_pd(a: __m256d, b: __m256d) -> __m256d {
+ vmaxpd(a, b)
+}
+
+/// Compares packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and returns packed maximum values
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_max_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmaxps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_max_ps(a: __m256, b: __m256) -> __m256 {
+ vmaxps(a, b)
+}
+
+/// Compares packed double-precision (64-bit) floating-point elements
+/// in `a` and `b`, and returns packed minimum values
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_min_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vminpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_min_pd(a: __m256d, b: __m256d) -> __m256d {
+ vminpd(a, b)
+}
+
+/// Compares packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and returns packed minimum values
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_min_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vminps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_min_ps(a: __m256, b: __m256) -> __m256 {
+ vminps(a, b)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements
+/// in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mul_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmulpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mul_pd(a: __m256d, b: __m256d) -> __m256d {
+ simd_mul(a, b)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a` and
+/// `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mul_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmulps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mul_ps(a: __m256, b: __m256) -> __m256 {
+ simd_mul(a, b)
+}
+
+/// Alternatively adds and subtracts packed double-precision (64-bit)
+/// floating-point elements in `a` to/from packed elements in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_addsub_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vaddsubpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_addsub_pd(a: __m256d, b: __m256d) -> __m256d {
+ addsubpd256(a, b)
+}
+
+/// Alternatively adds and subtracts packed single-precision (32-bit)
+/// floating-point elements in `a` to/from packed elements in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_addsub_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vaddsubps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_addsub_ps(a: __m256, b: __m256) -> __m256 {
+ addsubps256(a, b)
+}
+
+/// Subtracts packed double-precision (64-bit) floating-point elements in `b`
+/// from packed elements in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sub_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vsubpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sub_pd(a: __m256d, b: __m256d) -> __m256d {
+ simd_sub(a, b)
+}
+
+/// Subtracts packed single-precision (32-bit) floating-point elements in `b`
+/// from packed elements in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sub_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vsubps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sub_ps(a: __m256, b: __m256) -> __m256 {
+ simd_sub(a, b)
+}
+
+/// Computes the division of each of the 8 packed 32-bit floating-point elements
+/// in `a` by the corresponding packed elements in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_div_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vdivps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_div_ps(a: __m256, b: __m256) -> __m256 {
+ simd_div(a, b)
+}
+
+/// Computes the division of each of the 4 packed 64-bit floating-point elements
+/// in `a` by the corresponding packed elements in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_div_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vdivpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_div_pd(a: __m256d, b: __m256d) -> __m256d {
+ simd_div(a, b)
+}
+
+/// Rounds packed double-precision (64-bit) floating point elements in `a`
+/// according to the flag `ROUNDING`. The value of `ROUNDING` may be as follows:
+///
+/// - `0x00`: Round to the nearest whole number.
+/// - `0x01`: Round down, toward negative infinity.
+/// - `0x02`: Round up, toward positive infinity.
+/// - `0x03`: Truncate the values.
+///
+/// For a complete list of options, check [the LLVM docs][llvm_docs].
+///
+/// [llvm_docs]: https://github.com/llvm-mirror/clang/blob/dcd8d797b20291f1a6b3e0ddda085aa2bbb382a8/lib/Headers/avxintrin.h#L382
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_round_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vroundpd, ROUNDING = 0x3))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_round_pd<const ROUNDING: i32>(a: __m256d) -> __m256d {
+ static_assert_imm4!(ROUNDING);
+ roundpd256(a, ROUNDING)
+}
+
+/// Rounds packed double-precision (64-bit) floating point elements in `a`
+/// toward positive infinity.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_ceil_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vroundpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_ceil_pd(a: __m256d) -> __m256d {
+ simd_ceil(a)
+}
+
+/// Rounds packed double-precision (64-bit) floating point elements in `a`
+/// toward negative infinity.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_floor_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vroundpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_floor_pd(a: __m256d) -> __m256d {
+ simd_floor(a)
+}
+
+/// Rounds packed single-precision (32-bit) floating point elements in `a`
+/// according to the flag `ROUNDING`. The value of `ROUNDING` may be as follows:
+///
+/// - `0x00`: Round to the nearest whole number.
+/// - `0x01`: Round down, toward negative infinity.
+/// - `0x02`: Round up, toward positive infinity.
+/// - `0x03`: Truncate the values.
+///
+/// For a complete list of options, check [the LLVM docs][llvm_docs].
+///
+/// [llvm_docs]: https://github.com/llvm-mirror/clang/blob/dcd8d797b20291f1a6b3e0ddda085aa2bbb382a8/lib/Headers/avxintrin.h#L382
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_round_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vroundps, ROUNDING = 0x00))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_round_ps<const ROUNDING: i32>(a: __m256) -> __m256 {
+ static_assert_imm4!(ROUNDING);
+ roundps256(a, ROUNDING)
+}
+
+/// Rounds packed single-precision (32-bit) floating point elements in `a`
+/// toward positive infinity.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_ceil_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vroundps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_ceil_ps(a: __m256) -> __m256 {
+ simd_ceil(a)
+}
+
+/// Rounds packed single-precision (32-bit) floating point elements in `a`
+/// toward negative infinity.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_floor_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vroundps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_floor_ps(a: __m256) -> __m256 {
+ simd_floor(a)
+}
+
+/// Returns the square root of packed single-precision (32-bit) floating point
+/// elements in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sqrt_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vsqrtps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sqrt_ps(a: __m256) -> __m256 {
+ sqrtps256(a)
+}
+
+/// Returns the square root of packed double-precision (64-bit) floating point
+/// elements in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sqrt_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vsqrtpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sqrt_pd(a: __m256d) -> __m256d {
+ simd_fsqrt(a)
+}
+
+/// Blends packed double-precision (64-bit) floating-point elements from
+/// `a` and `b` using control mask `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_blend_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// Note: LLVM7 prefers single-precision blend instructions when
+// possible, see: https://bugs.llvm.org/show_bug.cgi?id=38194
+// #[cfg_attr(test, assert_instr(vblendpd, imm8 = 9))]
+#[cfg_attr(test, assert_instr(vblendps, IMM4 = 9))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_blend_pd<const IMM4: i32>(a: __m256d, b: __m256d) -> __m256d {
+ static_assert_imm4!(IMM4);
+ simd_shuffle4!(
+ a,
+ b,
+ <const IMM4: i32> [
+ ((IMM4 as u32 >> 0) & 1) * 4 + 0,
+ ((IMM4 as u32 >> 1) & 1) * 4 + 1,
+ ((IMM4 as u32 >> 2) & 1) * 4 + 2,
+ ((IMM4 as u32 >> 3) & 1) * 4 + 3,
+ ],
+ )
+}
+
+/// Blends packed single-precision (32-bit) floating-point elements from
+/// `a` and `b` using control mask `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_blend_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vblendps, IMM8 = 9))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_blend_ps<const IMM8: i32>(a: __m256, b: __m256) -> __m256 {
+ static_assert_imm8!(IMM8);
+ simd_shuffle8!(
+ a,
+ b,
+ <const IMM8: i32> [
+ ((IMM8 as u32 >> 0) & 1) * 8 + 0,
+ ((IMM8 as u32 >> 1) & 1) * 8 + 1,
+ ((IMM8 as u32 >> 2) & 1) * 8 + 2,
+ ((IMM8 as u32 >> 3) & 1) * 8 + 3,
+ ((IMM8 as u32 >> 4) & 1) * 8 + 4,
+ ((IMM8 as u32 >> 5) & 1) * 8 + 5,
+ ((IMM8 as u32 >> 6) & 1) * 8 + 6,
+ ((IMM8 as u32 >> 7) & 1) * 8 + 7,
+ ],
+ )
+}
+
+/// Blends packed double-precision (64-bit) floating-point elements from
+/// `a` and `b` using `c` as a mask.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_blendv_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vblendvpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_blendv_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ vblendvpd(a, b, c)
+}
+
+/// Blends packed single-precision (32-bit) floating-point elements from
+/// `a` and `b` using `c` as a mask.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_blendv_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vblendvps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_blendv_ps(a: __m256, b: __m256, c: __m256) -> __m256 {
+ vblendvps(a, b, c)
+}
+
+/// Conditionally multiplies the packed single-precision (32-bit) floating-point
+/// elements in `a` and `b` using the high 4 bits in `imm8`,
+/// sum the four products, and conditionally return the sum
+/// using the low 4 bits of `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_dp_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vdpps, IMM8 = 0x0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_dp_ps<const IMM8: i32>(a: __m256, b: __m256) -> __m256 {
+ static_assert_imm8!(IMM8);
+ vdpps(a, b, IMM8)
+}
+
+/// Horizontal addition of adjacent pairs in the two packed vectors
+/// of 4 64-bit floating points `a` and `b`.
+/// In the result, sums of elements from `a` are returned in even locations,
+/// while sums of elements from `b` are returned in odd locations.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hadd_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vhaddpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_hadd_pd(a: __m256d, b: __m256d) -> __m256d {
+ vhaddpd(a, b)
+}
+
+/// Horizontal addition of adjacent pairs in the two packed vectors
+/// of 8 32-bit floating points `a` and `b`.
+/// In the result, sums of elements from `a` are returned in locations of
+/// indices 0, 1, 4, 5; while sums of elements from `b` are locations
+/// 2, 3, 6, 7.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hadd_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vhaddps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_hadd_ps(a: __m256, b: __m256) -> __m256 {
+ vhaddps(a, b)
+}
+
+/// Horizontal subtraction of adjacent pairs in the two packed vectors
+/// of 4 64-bit floating points `a` and `b`.
+/// In the result, sums of elements from `a` are returned in even locations,
+/// while sums of elements from `b` are returned in odd locations.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hsub_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vhsubpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_hsub_pd(a: __m256d, b: __m256d) -> __m256d {
+ vhsubpd(a, b)
+}
+
+/// Horizontal subtraction of adjacent pairs in the two packed vectors
+/// of 8 32-bit floating points `a` and `b`.
+/// In the result, sums of elements from `a` are returned in locations of
+/// indices 0, 1, 4, 5; while sums of elements from `b` are locations
+/// 2, 3, 6, 7.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hsub_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vhsubps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_hsub_ps(a: __m256, b: __m256) -> __m256 {
+ vhsubps(a, b)
+}
+
+/// Computes the bitwise XOR of packed double-precision (64-bit) floating-point
+/// elements in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_xor_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// FIXME Should be 'vxorpd' instruction.
+#[cfg_attr(test, assert_instr(vxorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_xor_pd(a: __m256d, b: __m256d) -> __m256d {
+ let a: u64x4 = transmute(a);
+ let b: u64x4 = transmute(b);
+ transmute(simd_xor(a, b))
+}
+
+/// Computes the bitwise XOR of packed single-precision (32-bit) floating-point
+/// elements in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_xor_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vxorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_xor_ps(a: __m256, b: __m256) -> __m256 {
+ let a: u32x8 = transmute(a);
+ let b: u32x8 = transmute(b);
+ transmute(simd_xor(a, b))
+}
+
+/// Equal (ordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_EQ_OQ: i32 = 0x00;
+/// Less-than (ordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_LT_OS: i32 = 0x01;
+/// Less-than-or-equal (ordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_LE_OS: i32 = 0x02;
+/// Unordered (non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_UNORD_Q: i32 = 0x03;
+/// Not-equal (unordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NEQ_UQ: i32 = 0x04;
+/// Not-less-than (unordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NLT_US: i32 = 0x05;
+/// Not-less-than-or-equal (unordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NLE_US: i32 = 0x06;
+/// Ordered (non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_ORD_Q: i32 = 0x07;
+/// Equal (unordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_EQ_UQ: i32 = 0x08;
+/// Not-greater-than-or-equal (unordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NGE_US: i32 = 0x09;
+/// Not-greater-than (unordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NGT_US: i32 = 0x0a;
+/// False (ordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_FALSE_OQ: i32 = 0x0b;
+/// Not-equal (ordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NEQ_OQ: i32 = 0x0c;
+/// Greater-than-or-equal (ordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_GE_OS: i32 = 0x0d;
+/// Greater-than (ordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_GT_OS: i32 = 0x0e;
+/// True (unordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_TRUE_UQ: i32 = 0x0f;
+/// Equal (ordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_EQ_OS: i32 = 0x10;
+/// Less-than (ordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_LT_OQ: i32 = 0x11;
+/// Less-than-or-equal (ordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_LE_OQ: i32 = 0x12;
+/// Unordered (signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_UNORD_S: i32 = 0x13;
+/// Not-equal (unordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NEQ_US: i32 = 0x14;
+/// Not-less-than (unordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NLT_UQ: i32 = 0x15;
+/// Not-less-than-or-equal (unordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NLE_UQ: i32 = 0x16;
+/// Ordered (signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_ORD_S: i32 = 0x17;
+/// Equal (unordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_EQ_US: i32 = 0x18;
+/// Not-greater-than-or-equal (unordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NGE_UQ: i32 = 0x19;
+/// Not-greater-than (unordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NGT_UQ: i32 = 0x1a;
+/// False (ordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_FALSE_OS: i32 = 0x1b;
+/// Not-equal (ordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_NEQ_OS: i32 = 0x1c;
+/// Greater-than-or-equal (ordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_GE_OQ: i32 = 0x1d;
+/// Greater-than (ordered, non-signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_GT_OQ: i32 = 0x1e;
+/// True (unordered, signaling)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _CMP_TRUE_US: i32 = 0x1f;
+
+/// Compares packed double-precision (64-bit) floating-point
+/// elements in `a` and `b` based on the comparison operand
+/// specified by `IMM5`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_pd)
+#[inline]
+#[target_feature(enable = "avx,sse2")]
+#[cfg_attr(test, assert_instr(vcmpeqpd, IMM5 = 0))] // TODO Validate vcmppd
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmp_pd<const IMM5: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_imm5!(IMM5);
+ vcmppd(a, b, IMM5 as i8)
+}
+
+/// Compares packed double-precision (64-bit) floating-point
+/// elements in `a` and `b` based on the comparison operand
+/// specified by `IMM5`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vcmpeqpd, IMM5 = 0))] // TODO Validate vcmppd
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cmp_pd<const IMM5: i32>(a: __m256d, b: __m256d) -> __m256d {
+ static_assert_imm5!(IMM5);
+ vcmppd256(a, b, IMM5 as u8)
+}
+
+/// Compares packed single-precision (32-bit) floating-point
+/// elements in `a` and `b` based on the comparison operand
+/// specified by `IMM5`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_ps)
+#[inline]
+#[target_feature(enable = "avx,sse")]
+#[cfg_attr(test, assert_instr(vcmpeqps, IMM5 = 0))] // TODO Validate vcmpps
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmp_ps<const IMM5: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_imm5!(IMM5);
+ vcmpps(a, b, IMM5 as i8)
+}
+
+/// Compares packed single-precision (32-bit) floating-point
+/// elements in `a` and `b` based on the comparison operand
+/// specified by `IMM5`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vcmpeqps, IMM5 = 0))] // TODO Validate vcmpps
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cmp_ps<const IMM5: i32>(a: __m256, b: __m256) -> __m256 {
+ static_assert_imm5!(IMM5);
+ vcmpps256(a, b, IMM5 as u8)
+}
+
+/// Compares the lower double-precision (64-bit) floating-point element in
+/// `a` and `b` based on the comparison operand specified by `IMM5`,
+/// store the result in the lower element of returned vector,
+/// and copies the upper element from `a` to the upper element of returned
+/// vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_sd)
+#[inline]
+#[target_feature(enable = "avx,sse2")]
+#[cfg_attr(test, assert_instr(vcmpeqsd, IMM5 = 0))] // TODO Validate vcmpsd
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmp_sd<const IMM5: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_imm5!(IMM5);
+ vcmpsd(a, b, IMM5 as i8)
+}
+
+/// Compares the lower single-precision (32-bit) floating-point element in
+/// `a` and `b` based on the comparison operand specified by `IMM5`,
+/// store the result in the lower element of returned vector,
+/// and copies the upper 3 packed elements from `a` to the upper elements of
+/// returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_ss)
+#[inline]
+#[target_feature(enable = "avx,sse")]
+#[cfg_attr(test, assert_instr(vcmpeqss, IMM5 = 0))] // TODO Validate vcmpss
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmp_ss<const IMM5: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_imm5!(IMM5);
+ vcmpss(a, b, IMM5 as i8)
+}
+
+/// Converts packed 32-bit integers in `a` to packed double-precision (64-bit)
+/// floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi32_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vcvtdq2pd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepi32_pd(a: __m128i) -> __m256d {
+ simd_cast(a.as_i32x4())
+}
+
+/// Converts packed 32-bit integers in `a` to packed single-precision (32-bit)
+/// floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi32_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepi32_ps(a: __m256i) -> __m256 {
+ vcvtdq2ps(a.as_i32x8())
+}
+
+/// Converts packed double-precision (64-bit) floating-point elements in `a`
+/// to packed single-precision (32-bit) floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtpd_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtpd_ps(a: __m256d) -> __m128 {
+ vcvtpd2ps(a)
+}
+
+/// Converts packed single-precision (32-bit) floating-point elements in `a`
+/// to packed 32-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtps_epi32)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vcvtps2dq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtps_epi32(a: __m256) -> __m256i {
+ transmute(vcvtps2dq(a))
+}
+
+/// Converts packed single-precision (32-bit) floating-point elements in `a`
+/// to packed double-precision (64-bit) floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtps_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vcvtps2pd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtps_pd(a: __m128) -> __m256d {
+ simd_cast(a)
+}
+
+/// Converts packed double-precision (64-bit) floating-point elements in `a`
+/// to packed 32-bit integers with truncation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvttpd_epi32)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvttpd_epi32(a: __m256d) -> __m128i {
+ transmute(vcvttpd2dq(a))
+}
+
+/// Converts packed double-precision (64-bit) floating-point elements in `a`
+/// to packed 32-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtpd_epi32)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtpd_epi32(a: __m256d) -> __m128i {
+ transmute(vcvtpd2dq(a))
+}
+
+/// Converts packed single-precision (32-bit) floating-point elements in `a`
+/// to packed 32-bit integers with truncation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvttps_epi32)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vcvttps2dq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvttps_epi32(a: __m256) -> __m256i {
+ transmute(vcvttps2dq(a))
+}
+
+/// Extracts 128 bits (composed of 4 packed single-precision (32-bit)
+/// floating-point elements) from `a`, selected with `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extractf128_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf128, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_extractf128_ps<const IMM1: i32>(a: __m256) -> __m128 {
+ static_assert_imm1!(IMM1);
+ simd_shuffle4!(
+ a,
+ _mm256_undefined_ps(),
+ <const IMM1: i32> [[0, 1, 2, 3], [4, 5, 6, 7]][IMM1 as usize],
+ )
+}
+
+/// Extracts 128 bits (composed of 2 packed double-precision (64-bit)
+/// floating-point elements) from `a`, selected with `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extractf128_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf128, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_extractf128_pd<const IMM1: i32>(a: __m256d) -> __m128d {
+ static_assert_imm1!(IMM1);
+ simd_shuffle2!(a, _mm256_undefined_pd(), <const IMM1: i32> [[0, 1], [2, 3]][IMM1 as usize])
+}
+
+/// Extracts 128 bits (composed of integer data) from `a`, selected with `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extractf128_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf128, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_extractf128_si256<const IMM1: i32>(a: __m256i) -> __m128i {
+ static_assert_imm1!(IMM1);
+ let dst: i64x2 = simd_shuffle2!(
+ a.as_i64x4(),
+ _mm256_undefined_si256().as_i64x4(),
+ <const IMM1: i32> [[0, 1], [2, 3]][IMM1 as usize],
+ );
+ transmute(dst)
+}
+
+/// Zeroes the contents of all XMM or YMM registers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_zeroall)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vzeroall))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_zeroall() {
+ vzeroall()
+}
+
+/// Zeroes the upper 128 bits of all YMM registers;
+/// the lower 128-bits of the registers are unmodified.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_zeroupper)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vzeroupper))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_zeroupper() {
+ vzeroupper()
+}
+
+/// Shuffles single-precision (32-bit) floating-point elements in `a`
+/// within 128-bit lanes using the control in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutevar_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vpermilps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permutevar_ps(a: __m256, b: __m256i) -> __m256 {
+ vpermilps256(a, b.as_i32x8())
+}
+
+/// Shuffles single-precision (32-bit) floating-point elements in `a`
+/// using the control in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutevar_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vpermilps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_permutevar_ps(a: __m128, b: __m128i) -> __m128 {
+ vpermilps(a, b.as_i32x4())
+}
+
+/// Shuffles single-precision (32-bit) floating-point elements in `a`
+/// within 128-bit lanes using the control in `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permute_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vpermilps, IMM8 = 9))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permute_ps<const IMM8: i32>(a: __m256) -> __m256 {
+ static_assert_imm8!(IMM8);
+ simd_shuffle8!(
+ a,
+ _mm256_undefined_ps(),
+ <const IMM8: i32> [
+ (IMM8 as u32 >> 0) & 0b11,
+ (IMM8 as u32 >> 2) & 0b11,
+ (IMM8 as u32 >> 4) & 0b11,
+ (IMM8 as u32 >> 6) & 0b11,
+ ((IMM8 as u32 >> 0) & 0b11) + 4,
+ ((IMM8 as u32 >> 2) & 0b11) + 4,
+ ((IMM8 as u32 >> 4) & 0b11) + 4,
+ ((IMM8 as u32 >> 6) & 0b11) + 4,
+ ],
+ )
+}
+
+/// Shuffles single-precision (32-bit) floating-point elements in `a`
+/// using the control in `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permute_ps)
+#[inline]
+#[target_feature(enable = "avx,sse")]
+#[cfg_attr(test, assert_instr(vpermilps, IMM8 = 9))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_permute_ps<const IMM8: i32>(a: __m128) -> __m128 {
+ static_assert_imm8!(IMM8);
+ simd_shuffle4!(
+ a,
+ _mm_undefined_ps(),
+ <const IMM8: i32> [
+ (IMM8 as u32 >> 0) & 0b11,
+ (IMM8 as u32 >> 2) & 0b11,
+ (IMM8 as u32 >> 4) & 0b11,
+ (IMM8 as u32 >> 6) & 0b11,
+ ],
+ )
+}
+
+/// Shuffles double-precision (64-bit) floating-point elements in `a`
+/// within 256-bit lanes using the control in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutevar_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vpermilpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permutevar_pd(a: __m256d, b: __m256i) -> __m256d {
+ vpermilpd256(a, b.as_i64x4())
+}
+
+/// Shuffles double-precision (64-bit) floating-point elements in `a`
+/// using the control in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutevar_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vpermilpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_permutevar_pd(a: __m128d, b: __m128i) -> __m128d {
+ vpermilpd(a, b.as_i64x2())
+}
+
+/// Shuffles double-precision (64-bit) floating-point elements in `a`
+/// within 128-bit lanes using the control in `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permute_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vpermilpd, IMM4 = 0x1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permute_pd<const IMM4: i32>(a: __m256d) -> __m256d {
+ static_assert_imm4!(IMM4);
+ simd_shuffle4!(
+ a,
+ _mm256_undefined_pd(),
+ <const IMM4: i32> [
+ ((IMM4 as u32 >> 0) & 1),
+ ((IMM4 as u32 >> 1) & 1),
+ ((IMM4 as u32 >> 2) & 1) + 2,
+ ((IMM4 as u32 >> 3) & 1) + 2,
+ ],
+ )
+}
+
+/// Shuffles double-precision (64-bit) floating-point elements in `a`
+/// using the control in `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permute_pd)
+#[inline]
+#[target_feature(enable = "avx,sse2")]
+#[cfg_attr(test, assert_instr(vpermilpd, IMM2 = 0x1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_permute_pd<const IMM2: i32>(a: __m128d) -> __m128d {
+ static_assert_imm2!(IMM2);
+ simd_shuffle2!(
+ a,
+ _mm_undefined_pd(),
+ <const IMM2: i32> [(IMM2 as u32) & 1, (IMM2 as u32 >> 1) & 1],
+ )
+}
+
+/// Shuffles 256 bits (composed of 8 packed single-precision (32-bit)
+/// floating-point elements) selected by `imm8` from `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permute2f128_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vperm2f128, IMM8 = 0x5))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permute2f128_ps<const IMM8: i32>(a: __m256, b: __m256) -> __m256 {
+ static_assert_imm8!(IMM8);
+ vperm2f128ps256(a, b, IMM8 as i8)
+}
+
+/// Shuffles 256 bits (composed of 4 packed double-precision (64-bit)
+/// floating-point elements) selected by `imm8` from `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permute2f128_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vperm2f128, IMM8 = 0x31))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permute2f128_pd<const IMM8: i32>(a: __m256d, b: __m256d) -> __m256d {
+ static_assert_imm8!(IMM8);
+ vperm2f128pd256(a, b, IMM8 as i8)
+}
+
+/// Shuffles 128-bits (composed of integer data) selected by `imm8`
+/// from `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permute2f128_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vperm2f128, IMM8 = 0x31))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permute2f128_si256<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(vperm2f128si256(a.as_i32x8(), b.as_i32x8(), IMM8 as i8))
+}
+
+/// Broadcasts a single-precision (32-bit) floating-point element from memory
+/// to all elements of the returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcast_ss)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::trivially_copy_pass_by_ref)]
+pub unsafe fn _mm256_broadcast_ss(f: &f32) -> __m256 {
+ _mm256_set1_ps(*f)
+}
+
+/// Broadcasts a single-precision (32-bit) floating-point element from memory
+/// to all elements of the returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_broadcast_ss)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::trivially_copy_pass_by_ref)]
+pub unsafe fn _mm_broadcast_ss(f: &f32) -> __m128 {
+ _mm_set1_ps(*f)
+}
+
+/// Broadcasts a double-precision (64-bit) floating-point element from memory
+/// to all elements of the returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcast_sd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vbroadcastsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::trivially_copy_pass_by_ref)]
+pub unsafe fn _mm256_broadcast_sd(f: &f64) -> __m256d {
+ _mm256_set1_pd(*f)
+}
+
+/// Broadcasts 128 bits from memory (composed of 4 packed single-precision
+/// (32-bit) floating-point elements) to all elements of the returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcast_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vbroadcastf128))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_broadcast_ps(a: &__m128) -> __m256 {
+ vbroadcastf128ps256(a)
+}
+
+/// Broadcasts 128 bits from memory (composed of 2 packed double-precision
+/// (64-bit) floating-point elements) to all elements of the returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcast_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vbroadcastf128))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_broadcast_pd(a: &__m128d) -> __m256d {
+ vbroadcastf128pd256(a)
+}
+
+/// Copies `a` to result, then inserts 128 bits (composed of 4 packed
+/// single-precision (32-bit) floating-point elements) from `b` into result
+/// at the location specified by `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insertf128_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vinsertf128, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_insertf128_ps<const IMM1: i32>(a: __m256, b: __m128) -> __m256 {
+ static_assert_imm1!(IMM1);
+ simd_shuffle8!(
+ a,
+ _mm256_castps128_ps256(b),
+ <const IMM1: i32> [[8, 9, 10, 11, 4, 5, 6, 7], [0, 1, 2, 3, 8, 9, 10, 11]][IMM1 as usize],
+ )
+}
+
+/// Copies `a` to result, then inserts 128 bits (composed of 2 packed
+/// double-precision (64-bit) floating-point elements) from `b` into result
+/// at the location specified by `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insertf128_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vinsertf128, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_insertf128_pd<const IMM1: i32>(a: __m256d, b: __m128d) -> __m256d {
+ static_assert_imm1!(IMM1);
+ simd_shuffle4!(
+ a,
+ _mm256_castpd128_pd256(b),
+ <const IMM1: i32> [[4, 5, 2, 3], [0, 1, 4, 5]][IMM1 as usize],
+ )
+}
+
+/// Copies `a` to result, then inserts 128 bits from `b` into result
+/// at the location specified by `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insertf128_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vinsertf128, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_insertf128_si256<const IMM1: i32>(a: __m256i, b: __m128i) -> __m256i {
+ static_assert_imm1!(IMM1);
+ let dst: i64x4 = simd_shuffle4!(
+ a.as_i64x4(),
+ _mm256_castsi128_si256(b).as_i64x4(),
+ <const IMM1: i32> [[4, 5, 2, 3], [0, 1, 4, 5]][IMM1 as usize],
+ );
+ transmute(dst)
+}
+
+/// Copies `a` to result, and inserts the 8-bit integer `i` into result
+/// at the location specified by `index`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insert_epi8)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_insert_epi8<const INDEX: i32>(a: __m256i, i: i8) -> __m256i {
+ static_assert_imm5!(INDEX);
+ transmute(simd_insert(a.as_i8x32(), INDEX as u32, i))
+}
+
+/// Copies `a` to result, and inserts the 16-bit integer `i` into result
+/// at the location specified by `index`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insert_epi16)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_insert_epi16<const INDEX: i32>(a: __m256i, i: i16) -> __m256i {
+ static_assert_imm4!(INDEX);
+ transmute(simd_insert(a.as_i16x16(), INDEX as u32, i))
+}
+
+/// Copies `a` to result, and inserts the 32-bit integer `i` into result
+/// at the location specified by `index`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insert_epi32)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_insert_epi32<const INDEX: i32>(a: __m256i, i: i32) -> __m256i {
+ static_assert_imm3!(INDEX);
+ transmute(simd_insert(a.as_i32x8(), INDEX as u32, i))
+}
+
+/// Loads 256-bits (composed of 4 packed double-precision (64-bit)
+/// floating-point elements) from memory into result.
+/// `mem_addr` must be aligned on a 32-byte boundary or a
+/// general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_load_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovaps))] // FIXME vmovapd expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm256_load_pd(mem_addr: *const f64) -> __m256d {
+ *(mem_addr as *const __m256d)
+}
+
+/// Stores 256-bits (composed of 4 packed double-precision (64-bit)
+/// floating-point elements) from `a` into memory.
+/// `mem_addr` must be aligned on a 32-byte boundary or a
+/// general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_store_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovaps))] // FIXME vmovapd expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm256_store_pd(mem_addr: *mut f64, a: __m256d) {
+ *(mem_addr as *mut __m256d) = a;
+}
+
+/// Loads 256-bits (composed of 8 packed single-precision (32-bit)
+/// floating-point elements) from memory into result.
+/// `mem_addr` must be aligned on a 32-byte boundary or a
+/// general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_load_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm256_load_ps(mem_addr: *const f32) -> __m256 {
+ *(mem_addr as *const __m256)
+}
+
+/// Stores 256-bits (composed of 8 packed single-precision (32-bit)
+/// floating-point elements) from `a` into memory.
+/// `mem_addr` must be aligned on a 32-byte boundary or a
+/// general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_store_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm256_store_ps(mem_addr: *mut f32, a: __m256) {
+ *(mem_addr as *mut __m256) = a;
+}
+
+/// Loads 256-bits (composed of 4 packed double-precision (64-bit)
+/// floating-point elements) from memory into result.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_loadu_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovups))] // FIXME vmovupd expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_loadu_pd(mem_addr: *const f64) -> __m256d {
+ let mut dst = _mm256_undefined_pd();
+ ptr::copy_nonoverlapping(
+ mem_addr as *const u8,
+ &mut dst as *mut __m256d as *mut u8,
+ mem::size_of::<__m256d>(),
+ );
+ dst
+}
+
+/// Stores 256-bits (composed of 4 packed double-precision (64-bit)
+/// floating-point elements) from `a` into memory.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_storeu_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovups))] // FIXME vmovupd expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_storeu_pd(mem_addr: *mut f64, a: __m256d) {
+ storeupd256(mem_addr, a);
+}
+
+/// Loads 256-bits (composed of 8 packed single-precision (32-bit)
+/// floating-point elements) from memory into result.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_loadu_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovups))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_loadu_ps(mem_addr: *const f32) -> __m256 {
+ let mut dst = _mm256_undefined_ps();
+ ptr::copy_nonoverlapping(
+ mem_addr as *const u8,
+ &mut dst as *mut __m256 as *mut u8,
+ mem::size_of::<__m256>(),
+ );
+ dst
+}
+
+/// Stores 256-bits (composed of 8 packed single-precision (32-bit)
+/// floating-point elements) from `a` into memory.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_storeu_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovups))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_storeu_ps(mem_addr: *mut f32, a: __m256) {
+ storeups256(mem_addr, a);
+}
+
+/// Loads 256-bits of integer data from memory into result.
+/// `mem_addr` must be aligned on a 32-byte boundary or a
+/// general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_load_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovaps))] // FIXME vmovdqa expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_load_si256(mem_addr: *const __m256i) -> __m256i {
+ *mem_addr
+}
+
+/// Stores 256-bits of integer data from `a` into memory.
+/// `mem_addr` must be aligned on a 32-byte boundary or a
+/// general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_store_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovaps))] // FIXME vmovdqa expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_store_si256(mem_addr: *mut __m256i, a: __m256i) {
+ *mem_addr = a;
+}
+
+/// Loads 256-bits of integer data from memory into result.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_loadu_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovups))] // FIXME vmovdqu expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_loadu_si256(mem_addr: *const __m256i) -> __m256i {
+ let mut dst = _mm256_undefined_si256();
+ ptr::copy_nonoverlapping(
+ mem_addr as *const u8,
+ &mut dst as *mut __m256i as *mut u8,
+ mem::size_of::<__m256i>(),
+ );
+ dst
+}
+
+/// Stores 256-bits of integer data from `a` into memory.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_storeu_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovups))] // FIXME vmovdqu expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_storeu_si256(mem_addr: *mut __m256i, a: __m256i) {
+ storeudq256(mem_addr as *mut i8, a.as_i8x32());
+}
+
+/// Loads packed double-precision (64-bit) floating-point elements from memory
+/// into result using `mask` (elements are zeroed out when the high bit of the
+/// corresponding element is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskload_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmaskmovpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_maskload_pd(mem_addr: *const f64, mask: __m256i) -> __m256d {
+ maskloadpd256(mem_addr as *const i8, mask.as_i64x4())
+}
+
+/// Stores packed double-precision (64-bit) floating-point elements from `a`
+/// into memory using `mask`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskstore_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmaskmovpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_maskstore_pd(mem_addr: *mut f64, mask: __m256i, a: __m256d) {
+ maskstorepd256(mem_addr as *mut i8, mask.as_i64x4(), a);
+}
+
+/// Loads packed double-precision (64-bit) floating-point elements from memory
+/// into result using `mask` (elements are zeroed out when the high bit of the
+/// corresponding element is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskload_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmaskmovpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_maskload_pd(mem_addr: *const f64, mask: __m128i) -> __m128d {
+ maskloadpd(mem_addr as *const i8, mask.as_i64x2())
+}
+
+/// Stores packed double-precision (64-bit) floating-point elements from `a`
+/// into memory using `mask`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskstore_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmaskmovpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_maskstore_pd(mem_addr: *mut f64, mask: __m128i, a: __m128d) {
+ maskstorepd(mem_addr as *mut i8, mask.as_i64x2(), a);
+}
+
+/// Loads packed single-precision (32-bit) floating-point elements from memory
+/// into result using `mask` (elements are zeroed out when the high bit of the
+/// corresponding element is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskload_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmaskmovps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_maskload_ps(mem_addr: *const f32, mask: __m256i) -> __m256 {
+ maskloadps256(mem_addr as *const i8, mask.as_i32x8())
+}
+
+/// Stores packed single-precision (32-bit) floating-point elements from `a`
+/// into memory using `mask`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskstore_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmaskmovps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_maskstore_ps(mem_addr: *mut f32, mask: __m256i, a: __m256) {
+ maskstoreps256(mem_addr as *mut i8, mask.as_i32x8(), a);
+}
+
+/// Loads packed single-precision (32-bit) floating-point elements from memory
+/// into result using `mask` (elements are zeroed out when the high bit of the
+/// corresponding element is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskload_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmaskmovps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_maskload_ps(mem_addr: *const f32, mask: __m128i) -> __m128 {
+ maskloadps(mem_addr as *const i8, mask.as_i32x4())
+}
+
+/// Stores packed single-precision (32-bit) floating-point elements from `a`
+/// into memory using `mask`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskstore_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmaskmovps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_maskstore_ps(mem_addr: *mut f32, mask: __m128i, a: __m128) {
+ maskstoreps(mem_addr as *mut i8, mask.as_i32x4(), a);
+}
+
+/// Duplicate odd-indexed single-precision (32-bit) floating-point elements
+/// from `a`, and returns the results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_movehdup_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovshdup))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_movehdup_ps(a: __m256) -> __m256 {
+ simd_shuffle8!(a, a, [1, 1, 3, 3, 5, 5, 7, 7])
+}
+
+/// Duplicate even-indexed single-precision (32-bit) floating-point elements
+/// from `a`, and returns the results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_moveldup_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovsldup))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_moveldup_ps(a: __m256) -> __m256 {
+ simd_shuffle8!(a, a, [0, 0, 2, 2, 4, 4, 6, 6])
+}
+
+/// Duplicate even-indexed double-precision (64-bit) floating-point elements
+/// from `a`, and returns the results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_movedup_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovddup))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_movedup_pd(a: __m256d) -> __m256d {
+ simd_shuffle4!(a, a, [0, 0, 2, 2])
+}
+
+/// Loads 256-bits of integer data from unaligned memory into result.
+/// This intrinsic may perform better than `_mm256_loadu_si256` when the
+/// data crosses a cache line boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_lddqu_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vlddqu))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_lddqu_si256(mem_addr: *const __m256i) -> __m256i {
+ transmute(vlddqu(mem_addr as *const i8))
+}
+
+/// Moves integer data from a 256-bit integer vector to a 32-byte
+/// aligned memory location. To minimize caching, the data is flagged as
+/// non-temporal (unlikely to be used again soon)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_stream_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovntps))] // FIXME vmovntdq
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_stream_si256(mem_addr: *mut __m256i, a: __m256i) {
+ intrinsics::nontemporal_store(mem_addr, a);
+}
+
+/// Moves double-precision values from a 256-bit vector of `[4 x double]`
+/// to a 32-byte aligned memory location. To minimize caching, the data is
+/// flagged as non-temporal (unlikely to be used again soon).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_stream_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovntps))] // FIXME vmovntpd
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm256_stream_pd(mem_addr: *mut f64, a: __m256d) {
+ intrinsics::nontemporal_store(mem_addr as *mut __m256d, a);
+}
+
+/// Moves single-precision floating point values from a 256-bit vector
+/// of `[8 x float]` to a 32-byte aligned memory location. To minimize
+/// caching, the data is flagged as non-temporal (unlikely to be used again
+/// soon).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_stream_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovntps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm256_stream_ps(mem_addr: *mut f32, a: __m256) {
+ intrinsics::nontemporal_store(mem_addr as *mut __m256, a);
+}
+
+/// Computes the approximate reciprocal of packed single-precision (32-bit)
+/// floating-point elements in `a`, and returns the results. The maximum
+/// relative error for this approximation is less than 1.5*2^-12.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_rcp_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vrcpps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_rcp_ps(a: __m256) -> __m256 {
+ vrcpps(a)
+}
+
+/// Computes the approximate reciprocal square root of packed single-precision
+/// (32-bit) floating-point elements in `a`, and returns the results.
+/// The maximum relative error for this approximation is less than 1.5*2^-12.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_rsqrt_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vrsqrtps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_rsqrt_ps(a: __m256) -> __m256 {
+ vrsqrtps(a)
+}
+
+/// Unpacks and interleave double-precision (64-bit) floating-point elements
+/// from the high half of each 128-bit lane in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpackhi_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vunpckhpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpackhi_pd(a: __m256d, b: __m256d) -> __m256d {
+ simd_shuffle4!(a, b, [1, 5, 3, 7])
+}
+
+/// Unpacks and interleave single-precision (32-bit) floating-point elements
+/// from the high half of each 128-bit lane in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpackhi_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vunpckhps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpackhi_ps(a: __m256, b: __m256) -> __m256 {
+ simd_shuffle8!(a, b, [2, 10, 3, 11, 6, 14, 7, 15])
+}
+
+/// Unpacks and interleave double-precision (64-bit) floating-point elements
+/// from the low half of each 128-bit lane in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpacklo_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vunpcklpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpacklo_pd(a: __m256d, b: __m256d) -> __m256d {
+ simd_shuffle4!(a, b, [0, 4, 2, 6])
+}
+
+/// Unpacks and interleave single-precision (32-bit) floating-point elements
+/// from the low half of each 128-bit lane in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpacklo_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vunpcklps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpacklo_ps(a: __m256, b: __m256) -> __m256 {
+ simd_shuffle8!(a, b, [0, 8, 1, 9, 4, 12, 5, 13])
+}
+
+/// Computes the bitwise AND of 256 bits (representing integer data) in `a` and
+/// `b`, and set `ZF` to 1 if the result is zero, otherwise set `ZF` to 0.
+/// Computes the bitwise NOT of `a` and then AND with `b`, and set `CF` to 1 if
+/// the result is zero, otherwise set `CF` to 0. Return the `ZF` value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testz_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vptest))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_testz_si256(a: __m256i, b: __m256i) -> i32 {
+ ptestz256(a.as_i64x4(), b.as_i64x4())
+}
+
+/// Computes the bitwise AND of 256 bits (representing integer data) in `a` and
+/// `b`, and set `ZF` to 1 if the result is zero, otherwise set `ZF` to 0.
+/// Computes the bitwise NOT of `a` and then AND with `b`, and set `CF` to 1 if
+/// the result is zero, otherwise set `CF` to 0. Return the `CF` value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testc_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vptest))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_testc_si256(a: __m256i, b: __m256i) -> i32 {
+ ptestc256(a.as_i64x4(), b.as_i64x4())
+}
+
+/// Computes the bitwise AND of 256 bits (representing integer data) in `a` and
+/// `b`, and set `ZF` to 1 if the result is zero, otherwise set `ZF` to 0.
+/// Computes the bitwise NOT of `a` and then AND with `b`, and set `CF` to 1 if
+/// the result is zero, otherwise set `CF` to 0. Return 1 if both the `ZF` and
+/// `CF` values are zero, otherwise return 0.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testnzc_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vptest))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_testnzc_si256(a: __m256i, b: __m256i) -> i32 {
+ ptestnzc256(a.as_i64x4(), b.as_i64x4())
+}
+
+/// Computes the bitwise AND of 256 bits (representing double-precision (64-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 256-bit
+/// value, and set `ZF` to 1 if the sign bit of each 64-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 64-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return the `ZF` value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testz_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_testz_pd(a: __m256d, b: __m256d) -> i32 {
+ vtestzpd256(a, b)
+}
+
+/// Computes the bitwise AND of 256 bits (representing double-precision (64-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 256-bit
+/// value, and set `ZF` to 1 if the sign bit of each 64-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 64-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return the `CF` value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testc_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_testc_pd(a: __m256d, b: __m256d) -> i32 {
+ vtestcpd256(a, b)
+}
+
+/// Computes the bitwise AND of 256 bits (representing double-precision (64-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 256-bit
+/// value, and set `ZF` to 1 if the sign bit of each 64-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 64-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return 1 if both the `ZF` and `CF` values
+/// are zero, otherwise return 0.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testnzc_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_testnzc_pd(a: __m256d, b: __m256d) -> i32 {
+ vtestnzcpd256(a, b)
+}
+
+/// Computes the bitwise AND of 128 bits (representing double-precision (64-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 128-bit
+/// value, and set `ZF` to 1 if the sign bit of each 64-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 64-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return the `ZF` value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testz_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_testz_pd(a: __m128d, b: __m128d) -> i32 {
+ vtestzpd(a, b)
+}
+
+/// Computes the bitwise AND of 128 bits (representing double-precision (64-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 128-bit
+/// value, and set `ZF` to 1 if the sign bit of each 64-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 64-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return the `CF` value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testc_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_testc_pd(a: __m128d, b: __m128d) -> i32 {
+ vtestcpd(a, b)
+}
+
+/// Computes the bitwise AND of 128 bits (representing double-precision (64-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 128-bit
+/// value, and set `ZF` to 1 if the sign bit of each 64-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 64-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return 1 if both the `ZF` and `CF` values
+/// are zero, otherwise return 0.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testnzc_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_testnzc_pd(a: __m128d, b: __m128d) -> i32 {
+ vtestnzcpd(a, b)
+}
+
+/// Computes the bitwise AND of 256 bits (representing single-precision (32-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 256-bit
+/// value, and set `ZF` to 1 if the sign bit of each 32-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 32-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return the `ZF` value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testz_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_testz_ps(a: __m256, b: __m256) -> i32 {
+ vtestzps256(a, b)
+}
+
+/// Computes the bitwise AND of 256 bits (representing single-precision (32-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 256-bit
+/// value, and set `ZF` to 1 if the sign bit of each 32-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 32-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return the `CF` value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testc_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_testc_ps(a: __m256, b: __m256) -> i32 {
+ vtestcps256(a, b)
+}
+
+/// Computes the bitwise AND of 256 bits (representing single-precision (32-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 256-bit
+/// value, and set `ZF` to 1 if the sign bit of each 32-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 32-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return 1 if both the `ZF` and `CF` values
+/// are zero, otherwise return 0.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testnzc_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_testnzc_ps(a: __m256, b: __m256) -> i32 {
+ vtestnzcps256(a, b)
+}
+
+/// Computes the bitwise AND of 128 bits (representing single-precision (32-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 128-bit
+/// value, and set `ZF` to 1 if the sign bit of each 32-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 32-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return the `ZF` value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testz_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_testz_ps(a: __m128, b: __m128) -> i32 {
+ vtestzps(a, b)
+}
+
+/// Computes the bitwise AND of 128 bits (representing single-precision (32-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 128-bit
+/// value, and set `ZF` to 1 if the sign bit of each 32-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 32-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return the `CF` value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testc_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_testc_ps(a: __m128, b: __m128) -> i32 {
+ vtestcps(a, b)
+}
+
+/// Computes the bitwise AND of 128 bits (representing single-precision (32-bit)
+/// floating-point elements) in `a` and `b`, producing an intermediate 128-bit
+/// value, and set `ZF` to 1 if the sign bit of each 32-bit element in the
+/// intermediate value is zero, otherwise set `ZF` to 0. Compute the bitwise
+/// NOT of `a` and then AND with `b`, producing an intermediate value, and set
+/// `CF` to 1 if the sign bit of each 32-bit element in the intermediate value
+/// is zero, otherwise set `CF` to 0. Return 1 if both the `ZF` and `CF` values
+/// are zero, otherwise return 0.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testnzc_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vtestps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_testnzc_ps(a: __m128, b: __m128) -> i32 {
+ vtestnzcps(a, b)
+}
+
+/// Sets each bit of the returned mask based on the most significant bit of the
+/// corresponding packed double-precision (64-bit) floating-point element in
+/// `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_movemask_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovmskpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_movemask_pd(a: __m256d) -> i32 {
+ movmskpd256(a)
+}
+
+/// Sets each bit of the returned mask based on the most significant bit of the
+/// corresponding packed single-precision (32-bit) floating-point element in
+/// `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_movemask_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vmovmskps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_movemask_ps(a: __m256) -> i32 {
+ movmskps256(a)
+}
+
+/// Returns vector of type __m256d with all elements set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setzero_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vxorps))] // FIXME vxorpd expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setzero_pd() -> __m256d {
+ _mm256_set1_pd(0.0)
+}
+
+/// Returns vector of type __m256 with all elements set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setzero_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vxorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setzero_ps() -> __m256 {
+ _mm256_set1_ps(0.0)
+}
+
+/// Returns vector of type __m256i with all elements set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setzero_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vxor))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setzero_si256() -> __m256i {
+ _mm256_set1_epi8(0)
+}
+
+/// Sets packed double-precision (64-bit) floating-point elements in returned
+/// vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[cfg_attr(test, assert_instr(vinsertf128))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set_pd(a: f64, b: f64, c: f64, d: f64) -> __m256d {
+ _mm256_setr_pd(d, c, b, a)
+}
+
+/// Sets packed single-precision (32-bit) floating-point elements in returned
+/// vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set_ps(
+ a: f32,
+ b: f32,
+ c: f32,
+ d: f32,
+ e: f32,
+ f: f32,
+ g: f32,
+ h: f32,
+) -> __m256 {
+ _mm256_setr_ps(h, g, f, e, d, c, b, a)
+}
+
+/// Sets packed 8-bit integers in returned vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set_epi8)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set_epi8(
+ e00: i8,
+ e01: i8,
+ e02: i8,
+ e03: i8,
+ e04: i8,
+ e05: i8,
+ e06: i8,
+ e07: i8,
+ e08: i8,
+ e09: i8,
+ e10: i8,
+ e11: i8,
+ e12: i8,
+ e13: i8,
+ e14: i8,
+ e15: i8,
+ e16: i8,
+ e17: i8,
+ e18: i8,
+ e19: i8,
+ e20: i8,
+ e21: i8,
+ e22: i8,
+ e23: i8,
+ e24: i8,
+ e25: i8,
+ e26: i8,
+ e27: i8,
+ e28: i8,
+ e29: i8,
+ e30: i8,
+ e31: i8,
+) -> __m256i {
+ #[rustfmt::skip]
+ _mm256_setr_epi8(
+ e31, e30, e29, e28, e27, e26, e25, e24,
+ e23, e22, e21, e20, e19, e18, e17, e16,
+ e15, e14, e13, e12, e11, e10, e09, e08,
+ e07, e06, e05, e04, e03, e02, e01, e00,
+ )
+}
+
+/// Sets packed 16-bit integers in returned vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set_epi16)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set_epi16(
+ e00: i16,
+ e01: i16,
+ e02: i16,
+ e03: i16,
+ e04: i16,
+ e05: i16,
+ e06: i16,
+ e07: i16,
+ e08: i16,
+ e09: i16,
+ e10: i16,
+ e11: i16,
+ e12: i16,
+ e13: i16,
+ e14: i16,
+ e15: i16,
+) -> __m256i {
+ #[rustfmt::skip]
+ _mm256_setr_epi16(
+ e15, e14, e13, e12,
+ e11, e10, e09, e08,
+ e07, e06, e05, e04,
+ e03, e02, e01, e00,
+ )
+}
+
+/// Sets packed 32-bit integers in returned vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set_epi32)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set_epi32(
+ e0: i32,
+ e1: i32,
+ e2: i32,
+ e3: i32,
+ e4: i32,
+ e5: i32,
+ e6: i32,
+ e7: i32,
+) -> __m256i {
+ _mm256_setr_epi32(e7, e6, e5, e4, e3, e2, e1, e0)
+}
+
+/// Sets packed 64-bit integers in returned vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set_epi64x)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set_epi64x(a: i64, b: i64, c: i64, d: i64) -> __m256i {
+ _mm256_setr_epi64x(d, c, b, a)
+}
+
+/// Sets packed double-precision (64-bit) floating-point elements in returned
+/// vector with the supplied values in reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setr_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setr_pd(a: f64, b: f64, c: f64, d: f64) -> __m256d {
+ __m256d(a, b, c, d)
+}
+
+/// Sets packed single-precision (32-bit) floating-point elements in returned
+/// vector with the supplied values in reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setr_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setr_ps(
+ a: f32,
+ b: f32,
+ c: f32,
+ d: f32,
+ e: f32,
+ f: f32,
+ g: f32,
+ h: f32,
+) -> __m256 {
+ __m256(a, b, c, d, e, f, g, h)
+}
+
+/// Sets packed 8-bit integers in returned vector with the supplied values in
+/// reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setr_epi8)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setr_epi8(
+ e00: i8,
+ e01: i8,
+ e02: i8,
+ e03: i8,
+ e04: i8,
+ e05: i8,
+ e06: i8,
+ e07: i8,
+ e08: i8,
+ e09: i8,
+ e10: i8,
+ e11: i8,
+ e12: i8,
+ e13: i8,
+ e14: i8,
+ e15: i8,
+ e16: i8,
+ e17: i8,
+ e18: i8,
+ e19: i8,
+ e20: i8,
+ e21: i8,
+ e22: i8,
+ e23: i8,
+ e24: i8,
+ e25: i8,
+ e26: i8,
+ e27: i8,
+ e28: i8,
+ e29: i8,
+ e30: i8,
+ e31: i8,
+) -> __m256i {
+ #[rustfmt::skip]
+ transmute(i8x32::new(
+ e00, e01, e02, e03, e04, e05, e06, e07,
+ e08, e09, e10, e11, e12, e13, e14, e15,
+ e16, e17, e18, e19, e20, e21, e22, e23,
+ e24, e25, e26, e27, e28, e29, e30, e31,
+ ))
+}
+
+/// Sets packed 16-bit integers in returned vector with the supplied values in
+/// reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setr_epi16)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setr_epi16(
+ e00: i16,
+ e01: i16,
+ e02: i16,
+ e03: i16,
+ e04: i16,
+ e05: i16,
+ e06: i16,
+ e07: i16,
+ e08: i16,
+ e09: i16,
+ e10: i16,
+ e11: i16,
+ e12: i16,
+ e13: i16,
+ e14: i16,
+ e15: i16,
+) -> __m256i {
+ #[rustfmt::skip]
+ transmute(i16x16::new(
+ e00, e01, e02, e03,
+ e04, e05, e06, e07,
+ e08, e09, e10, e11,
+ e12, e13, e14, e15,
+ ))
+}
+
+/// Sets packed 32-bit integers in returned vector with the supplied values in
+/// reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setr_epi32)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setr_epi32(
+ e0: i32,
+ e1: i32,
+ e2: i32,
+ e3: i32,
+ e4: i32,
+ e5: i32,
+ e6: i32,
+ e7: i32,
+) -> __m256i {
+ transmute(i32x8::new(e0, e1, e2, e3, e4, e5, e6, e7))
+}
+
+/// Sets packed 64-bit integers in returned vector with the supplied values in
+/// reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setr_epi64x)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setr_epi64x(a: i64, b: i64, c: i64, d: i64) -> __m256i {
+ transmute(i64x4::new(a, b, c, d))
+}
+
+/// Broadcasts double-precision (64-bit) floating-point value `a` to all
+/// elements of returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set1_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set1_pd(a: f64) -> __m256d {
+ _mm256_setr_pd(a, a, a, a)
+}
+
+/// Broadcasts single-precision (32-bit) floating-point value `a` to all
+/// elements of returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set1_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set1_ps(a: f32) -> __m256 {
+ _mm256_setr_ps(a, a, a, a, a, a, a, a)
+}
+
+/// Broadcasts 8-bit integer `a` to all elements of returned vector.
+/// This intrinsic may generate the `vpbroadcastb`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set1_epi8)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vpshufb))]
+#[cfg_attr(test, assert_instr(vinsertf128))]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set1_epi8(a: i8) -> __m256i {
+ #[rustfmt::skip]
+ _mm256_setr_epi8(
+ a, a, a, a, a, a, a, a,
+ a, a, a, a, a, a, a, a,
+ a, a, a, a, a, a, a, a,
+ a, a, a, a, a, a, a, a,
+ )
+}
+
+/// Broadcasts 16-bit integer `a` to all all elements of returned vector.
+/// This intrinsic may generate the `vpbroadcastw`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set1_epi16)
+#[inline]
+#[target_feature(enable = "avx")]
+//#[cfg_attr(test, assert_instr(vpshufb))]
+#[cfg_attr(test, assert_instr(vinsertf128))]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set1_epi16(a: i16) -> __m256i {
+ _mm256_setr_epi16(a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a)
+}
+
+/// Broadcasts 32-bit integer `a` to all elements of returned vector.
+/// This intrinsic may generate the `vpbroadcastd`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set1_epi32)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set1_epi32(a: i32) -> __m256i {
+ _mm256_setr_epi32(a, a, a, a, a, a, a, a)
+}
+
+/// Broadcasts 64-bit integer `a` to all elements of returned vector.
+/// This intrinsic may generate the `vpbroadcastq`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set1_epi64x)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(all(test, target_arch = "x86_64"), assert_instr(vinsertf128))]
+#[cfg_attr(all(test, target_arch = "x86"), assert_instr(vbroadcastsd))]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set1_epi64x(a: i64) -> __m256i {
+ _mm256_setr_epi64x(a, a, a, a)
+}
+
+/// Cast vector of type __m256d to type __m256.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castpd_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castpd_ps(a: __m256d) -> __m256 {
+ transmute(a)
+}
+
+/// Cast vector of type __m256 to type __m256d.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castps_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castps_pd(a: __m256) -> __m256d {
+ transmute(a)
+}
+
+/// Casts vector of type __m256 to type __m256i.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castps_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castps_si256(a: __m256) -> __m256i {
+ transmute(a)
+}
+
+/// Casts vector of type __m256i to type __m256.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castsi256_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castsi256_ps(a: __m256i) -> __m256 {
+ transmute(a)
+}
+
+/// Casts vector of type __m256d to type __m256i.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castpd_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castpd_si256(a: __m256d) -> __m256i {
+ transmute(a)
+}
+
+/// Casts vector of type __m256i to type __m256d.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castsi256_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castsi256_pd(a: __m256i) -> __m256d {
+ transmute(a)
+}
+
+/// Casts vector of type __m256 to type __m128.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castps256_ps128)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castps256_ps128(a: __m256) -> __m128 {
+ simd_shuffle4!(a, a, [0, 1, 2, 3])
+}
+
+/// Casts vector of type __m256d to type __m128d.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castpd256_pd128)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castpd256_pd128(a: __m256d) -> __m128d {
+ simd_shuffle2!(a, a, [0, 1])
+}
+
+/// Casts vector of type __m256i to type __m128i.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castsi256_si128)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castsi256_si128(a: __m256i) -> __m128i {
+ let a = a.as_i64x4();
+ let dst: i64x2 = simd_shuffle2!(a, a, [0, 1]);
+ transmute(dst)
+}
+
+/// Casts vector of type __m128 to type __m256;
+/// the upper 128 bits of the result are undefined.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castps128_ps256)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castps128_ps256(a: __m128) -> __m256 {
+ // FIXME simd_shuffle8!(a, a, [0, 1, 2, 3, -1, -1, -1, -1])
+ simd_shuffle8!(a, a, [0, 1, 2, 3, 0, 0, 0, 0])
+}
+
+/// Casts vector of type __m128d to type __m256d;
+/// the upper 128 bits of the result are undefined.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castpd128_pd256)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castpd128_pd256(a: __m128d) -> __m256d {
+ // FIXME simd_shuffle4!(a, a, [0, 1, -1, -1])
+ simd_shuffle4!(a, a, [0, 1, 0, 0])
+}
+
+/// Casts vector of type __m128i to type __m256i;
+/// the upper 128 bits of the result are undefined.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castsi128_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_castsi128_si256(a: __m128i) -> __m256i {
+ let a = a.as_i64x2();
+ // FIXME simd_shuffle4!(a, a, [0, 1, -1, -1])
+ let dst: i64x4 = simd_shuffle4!(a, a, [0, 1, 0, 0]);
+ transmute(dst)
+}
+
+/// Constructs a 256-bit floating-point vector of `[8 x float]` from a
+/// 128-bit floating-point vector of `[4 x float]`. The lower 128 bits contain
+/// the value of the source vector. The upper 128 bits are set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_zextps128_ps256)
+#[inline]
+#[target_feature(enable = "avx,sse")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_zextps128_ps256(a: __m128) -> __m256 {
+ simd_shuffle8!(a, _mm_setzero_ps(), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Constructs a 256-bit integer vector from a 128-bit integer vector.
+/// The lower 128 bits contain the value of the source vector. The upper
+/// 128 bits are set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_zextsi128_si256)
+#[inline]
+#[target_feature(enable = "avx,sse2")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_zextsi128_si256(a: __m128i) -> __m256i {
+ let b = _mm_setzero_si128().as_i64x2();
+ let dst: i64x4 = simd_shuffle4!(a.as_i64x2(), b, [0, 1, 2, 3]);
+ transmute(dst)
+}
+
+/// Constructs a 256-bit floating-point vector of `[4 x double]` from a
+/// 128-bit floating-point vector of `[2 x double]`. The lower 128 bits
+/// contain the value of the source vector. The upper 128 bits are set
+/// to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_zextpd128_pd256)
+#[inline]
+#[target_feature(enable = "avx,sse2")]
+// This intrinsic is only used for compilation and does not generate any
+// instructions, thus it has zero latency.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_zextpd128_pd256(a: __m128d) -> __m256d {
+ simd_shuffle4!(a, _mm_setzero_pd(), [0, 1, 2, 3])
+}
+
+/// Returns vector of type `__m256` with undefined elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_undefined_ps)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_undefined_ps() -> __m256 {
+ _mm256_set1_ps(0.0)
+}
+
+/// Returns vector of type `__m256d` with undefined elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_undefined_pd)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_undefined_pd() -> __m256d {
+ _mm256_set1_pd(0.0)
+}
+
+/// Returns vector of type __m256i with undefined elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_undefined_si256)
+#[inline]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_undefined_si256() -> __m256i {
+ __m256i(0, 0, 0, 0)
+}
+
+/// Sets packed __m256 returned vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set_m128)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vinsertf128))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set_m128(hi: __m128, lo: __m128) -> __m256 {
+ simd_shuffle8!(lo, hi, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Sets packed __m256d returned vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set_m128d)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vinsertf128))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set_m128d(hi: __m128d, lo: __m128d) -> __m256d {
+ let hi: __m128 = transmute(hi);
+ let lo: __m128 = transmute(lo);
+ transmute(_mm256_set_m128(hi, lo))
+}
+
+/// Sets packed __m256i returned vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_set_m128i)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vinsertf128))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_set_m128i(hi: __m128i, lo: __m128i) -> __m256i {
+ let hi: __m128 = transmute(hi);
+ let lo: __m128 = transmute(lo);
+ transmute(_mm256_set_m128(hi, lo))
+}
+
+/// Sets packed __m256 returned vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setr_m128)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vinsertf128))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setr_m128(lo: __m128, hi: __m128) -> __m256 {
+ _mm256_set_m128(hi, lo)
+}
+
+/// Sets packed __m256d returned vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setr_m128d)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vinsertf128))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setr_m128d(lo: __m128d, hi: __m128d) -> __m256d {
+ _mm256_set_m128d(hi, lo)
+}
+
+/// Sets packed __m256i returned vector with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setr_m128i)
+#[inline]
+#[target_feature(enable = "avx")]
+#[cfg_attr(test, assert_instr(vinsertf128))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_setr_m128i(lo: __m128i, hi: __m128i) -> __m256i {
+ _mm256_set_m128i(hi, lo)
+}
+
+/// Loads two 128-bit values (composed of 4 packed single-precision (32-bit)
+/// floating-point elements) from memory, and combine them into a 256-bit
+/// value.
+/// `hiaddr` and `loaddr` do not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_loadu2_m128)
+#[inline]
+#[target_feature(enable = "avx,sse")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_loadu2_m128(hiaddr: *const f32, loaddr: *const f32) -> __m256 {
+ let a = _mm256_castps128_ps256(_mm_loadu_ps(loaddr));
+ _mm256_insertf128_ps::<1>(a, _mm_loadu_ps(hiaddr))
+}
+
+/// Loads two 128-bit values (composed of 2 packed double-precision (64-bit)
+/// floating-point elements) from memory, and combine them into a 256-bit
+/// value.
+/// `hiaddr` and `loaddr` do not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_loadu2_m128d)
+#[inline]
+#[target_feature(enable = "avx,sse2")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_loadu2_m128d(hiaddr: *const f64, loaddr: *const f64) -> __m256d {
+ let a = _mm256_castpd128_pd256(_mm_loadu_pd(loaddr));
+ _mm256_insertf128_pd::<1>(a, _mm_loadu_pd(hiaddr))
+}
+
+/// Loads two 128-bit values (composed of integer data) from memory, and combine
+/// them into a 256-bit value.
+/// `hiaddr` and `loaddr` do not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_loadu2_m128i)
+#[inline]
+#[target_feature(enable = "avx,sse2")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_loadu2_m128i(hiaddr: *const __m128i, loaddr: *const __m128i) -> __m256i {
+ let a = _mm256_castsi128_si256(_mm_loadu_si128(loaddr));
+ _mm256_insertf128_si256::<1>(a, _mm_loadu_si128(hiaddr))
+}
+
+/// Stores the high and low 128-bit halves (each composed of 4 packed
+/// single-precision (32-bit) floating-point elements) from `a` into memory two
+/// different 128-bit locations.
+/// `hiaddr` and `loaddr` do not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_storeu2_m128)
+#[inline]
+#[target_feature(enable = "avx,sse")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_storeu2_m128(hiaddr: *mut f32, loaddr: *mut f32, a: __m256) {
+ let lo = _mm256_castps256_ps128(a);
+ _mm_storeu_ps(loaddr, lo);
+ let hi = _mm256_extractf128_ps::<1>(a);
+ _mm_storeu_ps(hiaddr, hi);
+}
+
+/// Stores the high and low 128-bit halves (each composed of 2 packed
+/// double-precision (64-bit) floating-point elements) from `a` into memory two
+/// different 128-bit locations.
+/// `hiaddr` and `loaddr` do not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_storeu2_m128d)
+#[inline]
+#[target_feature(enable = "avx,sse2")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_storeu2_m128d(hiaddr: *mut f64, loaddr: *mut f64, a: __m256d) {
+ let lo = _mm256_castpd256_pd128(a);
+ _mm_storeu_pd(loaddr, lo);
+ let hi = _mm256_extractf128_pd::<1>(a);
+ _mm_storeu_pd(hiaddr, hi);
+}
+
+/// Stores the high and low 128-bit halves (each composed of integer data) from
+/// `a` into memory two different 128-bit locations.
+/// `hiaddr` and `loaddr` do not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_storeu2_m128i)
+#[inline]
+#[target_feature(enable = "avx,sse2")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_storeu2_m128i(hiaddr: *mut __m128i, loaddr: *mut __m128i, a: __m256i) {
+ let lo = _mm256_castsi256_si128(a);
+ _mm_storeu_si128(loaddr, lo);
+ let hi = _mm256_extractf128_si256::<1>(a);
+ _mm_storeu_si128(hiaddr, hi);
+}
+
+/// Returns the first element of the input vector of `[8 x float]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtss_f32)
+#[inline]
+#[target_feature(enable = "avx")]
+//#[cfg_attr(test, assert_instr(movss))] FIXME
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtss_f32(a: __m256) -> f32 {
+ simd_extract(a, 0)
+}
+
+// LLVM intrinsics used in the above functions
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.avx.addsub.pd.256"]
+ fn addsubpd256(a: __m256d, b: __m256d) -> __m256d;
+ #[link_name = "llvm.x86.avx.addsub.ps.256"]
+ fn addsubps256(a: __m256, b: __m256) -> __m256;
+ #[link_name = "llvm.x86.avx.round.pd.256"]
+ fn roundpd256(a: __m256d, b: i32) -> __m256d;
+ #[link_name = "llvm.x86.avx.round.ps.256"]
+ fn roundps256(a: __m256, b: i32) -> __m256;
+ #[link_name = "llvm.x86.avx.sqrt.ps.256"]
+ fn sqrtps256(a: __m256) -> __m256;
+ #[link_name = "llvm.x86.avx.blendv.pd.256"]
+ fn vblendvpd(a: __m256d, b: __m256d, c: __m256d) -> __m256d;
+ #[link_name = "llvm.x86.avx.blendv.ps.256"]
+ fn vblendvps(a: __m256, b: __m256, c: __m256) -> __m256;
+ #[link_name = "llvm.x86.avx.dp.ps.256"]
+ fn vdpps(a: __m256, b: __m256, imm8: i32) -> __m256;
+ #[link_name = "llvm.x86.avx.hadd.pd.256"]
+ fn vhaddpd(a: __m256d, b: __m256d) -> __m256d;
+ #[link_name = "llvm.x86.avx.hadd.ps.256"]
+ fn vhaddps(a: __m256, b: __m256) -> __m256;
+ #[link_name = "llvm.x86.avx.hsub.pd.256"]
+ fn vhsubpd(a: __m256d, b: __m256d) -> __m256d;
+ #[link_name = "llvm.x86.avx.hsub.ps.256"]
+ fn vhsubps(a: __m256, b: __m256) -> __m256;
+ #[link_name = "llvm.x86.sse2.cmp.pd"]
+ fn vcmppd(a: __m128d, b: __m128d, imm8: i8) -> __m128d;
+ #[link_name = "llvm.x86.avx.cmp.pd.256"]
+ fn vcmppd256(a: __m256d, b: __m256d, imm8: u8) -> __m256d;
+ #[link_name = "llvm.x86.sse.cmp.ps"]
+ fn vcmpps(a: __m128, b: __m128, imm8: i8) -> __m128;
+ #[link_name = "llvm.x86.avx.cmp.ps.256"]
+ fn vcmpps256(a: __m256, b: __m256, imm8: u8) -> __m256;
+ #[link_name = "llvm.x86.sse2.cmp.sd"]
+ fn vcmpsd(a: __m128d, b: __m128d, imm8: i8) -> __m128d;
+ #[link_name = "llvm.x86.sse.cmp.ss"]
+ fn vcmpss(a: __m128, b: __m128, imm8: i8) -> __m128;
+ #[link_name = "llvm.x86.avx.cvtdq2.ps.256"]
+ fn vcvtdq2ps(a: i32x8) -> __m256;
+ #[link_name = "llvm.x86.avx.cvt.pd2.ps.256"]
+ fn vcvtpd2ps(a: __m256d) -> __m128;
+ #[link_name = "llvm.x86.avx.cvt.ps2dq.256"]
+ fn vcvtps2dq(a: __m256) -> i32x8;
+ #[link_name = "llvm.x86.avx.cvtt.pd2dq.256"]
+ fn vcvttpd2dq(a: __m256d) -> i32x4;
+ #[link_name = "llvm.x86.avx.cvt.pd2dq.256"]
+ fn vcvtpd2dq(a: __m256d) -> i32x4;
+ #[link_name = "llvm.x86.avx.cvtt.ps2dq.256"]
+ fn vcvttps2dq(a: __m256) -> i32x8;
+ #[link_name = "llvm.x86.avx.vzeroall"]
+ fn vzeroall();
+ #[link_name = "llvm.x86.avx.vzeroupper"]
+ fn vzeroupper();
+ #[link_name = "llvm.x86.avx.vpermilvar.ps.256"]
+ fn vpermilps256(a: __m256, b: i32x8) -> __m256;
+ #[link_name = "llvm.x86.avx.vpermilvar.ps"]
+ fn vpermilps(a: __m128, b: i32x4) -> __m128;
+ #[link_name = "llvm.x86.avx.vpermilvar.pd.256"]
+ fn vpermilpd256(a: __m256d, b: i64x4) -> __m256d;
+ #[link_name = "llvm.x86.avx.vpermilvar.pd"]
+ fn vpermilpd(a: __m128d, b: i64x2) -> __m128d;
+ #[link_name = "llvm.x86.avx.vperm2f128.ps.256"]
+ fn vperm2f128ps256(a: __m256, b: __m256, imm8: i8) -> __m256;
+ #[link_name = "llvm.x86.avx.vperm2f128.pd.256"]
+ fn vperm2f128pd256(a: __m256d, b: __m256d, imm8: i8) -> __m256d;
+ #[link_name = "llvm.x86.avx.vperm2f128.si.256"]
+ fn vperm2f128si256(a: i32x8, b: i32x8, imm8: i8) -> i32x8;
+ #[link_name = "llvm.x86.avx.vbroadcastf128.ps.256"]
+ fn vbroadcastf128ps256(a: &__m128) -> __m256;
+ #[link_name = "llvm.x86.avx.vbroadcastf128.pd.256"]
+ fn vbroadcastf128pd256(a: &__m128d) -> __m256d;
+ #[link_name = "llvm.x86.avx.storeu.pd.256"]
+ fn storeupd256(mem_addr: *mut f64, a: __m256d);
+ #[link_name = "llvm.x86.avx.storeu.ps.256"]
+ fn storeups256(mem_addr: *mut f32, a: __m256);
+ #[link_name = "llvm.x86.avx.storeu.dq.256"]
+ fn storeudq256(mem_addr: *mut i8, a: i8x32);
+ #[link_name = "llvm.x86.avx.maskload.pd.256"]
+ fn maskloadpd256(mem_addr: *const i8, mask: i64x4) -> __m256d;
+ #[link_name = "llvm.x86.avx.maskstore.pd.256"]
+ fn maskstorepd256(mem_addr: *mut i8, mask: i64x4, a: __m256d);
+ #[link_name = "llvm.x86.avx.maskload.pd"]
+ fn maskloadpd(mem_addr: *const i8, mask: i64x2) -> __m128d;
+ #[link_name = "llvm.x86.avx.maskstore.pd"]
+ fn maskstorepd(mem_addr: *mut i8, mask: i64x2, a: __m128d);
+ #[link_name = "llvm.x86.avx.maskload.ps.256"]
+ fn maskloadps256(mem_addr: *const i8, mask: i32x8) -> __m256;
+ #[link_name = "llvm.x86.avx.maskstore.ps.256"]
+ fn maskstoreps256(mem_addr: *mut i8, mask: i32x8, a: __m256);
+ #[link_name = "llvm.x86.avx.maskload.ps"]
+ fn maskloadps(mem_addr: *const i8, mask: i32x4) -> __m128;
+ #[link_name = "llvm.x86.avx.maskstore.ps"]
+ fn maskstoreps(mem_addr: *mut i8, mask: i32x4, a: __m128);
+ #[link_name = "llvm.x86.avx.ldu.dq.256"]
+ fn vlddqu(mem_addr: *const i8) -> i8x32;
+ #[link_name = "llvm.x86.avx.rcp.ps.256"]
+ fn vrcpps(a: __m256) -> __m256;
+ #[link_name = "llvm.x86.avx.rsqrt.ps.256"]
+ fn vrsqrtps(a: __m256) -> __m256;
+ #[link_name = "llvm.x86.avx.ptestz.256"]
+ fn ptestz256(a: i64x4, b: i64x4) -> i32;
+ #[link_name = "llvm.x86.avx.ptestc.256"]
+ fn ptestc256(a: i64x4, b: i64x4) -> i32;
+ #[link_name = "llvm.x86.avx.ptestnzc.256"]
+ fn ptestnzc256(a: i64x4, b: i64x4) -> i32;
+ #[link_name = "llvm.x86.avx.vtestz.pd.256"]
+ fn vtestzpd256(a: __m256d, b: __m256d) -> i32;
+ #[link_name = "llvm.x86.avx.vtestc.pd.256"]
+ fn vtestcpd256(a: __m256d, b: __m256d) -> i32;
+ #[link_name = "llvm.x86.avx.vtestnzc.pd.256"]
+ fn vtestnzcpd256(a: __m256d, b: __m256d) -> i32;
+ #[link_name = "llvm.x86.avx.vtestz.pd"]
+ fn vtestzpd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.avx.vtestc.pd"]
+ fn vtestcpd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.avx.vtestnzc.pd"]
+ fn vtestnzcpd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.avx.vtestz.ps.256"]
+ fn vtestzps256(a: __m256, b: __m256) -> i32;
+ #[link_name = "llvm.x86.avx.vtestc.ps.256"]
+ fn vtestcps256(a: __m256, b: __m256) -> i32;
+ #[link_name = "llvm.x86.avx.vtestnzc.ps.256"]
+ fn vtestnzcps256(a: __m256, b: __m256) -> i32;
+ #[link_name = "llvm.x86.avx.vtestz.ps"]
+ fn vtestzps(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.avx.vtestc.ps"]
+ fn vtestcps(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.avx.vtestnzc.ps"]
+ fn vtestnzcps(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.avx.movmsk.pd.256"]
+ fn movmskpd256(a: __m256d) -> i32;
+ #[link_name = "llvm.x86.avx.movmsk.ps.256"]
+ fn movmskps256(a: __m256) -> i32;
+ #[link_name = "llvm.x86.avx.min.ps.256"]
+ fn vminps(a: __m256, b: __m256) -> __m256;
+ #[link_name = "llvm.x86.avx.max.ps.256"]
+ fn vmaxps(a: __m256, b: __m256) -> __m256;
+ #[link_name = "llvm.x86.avx.min.pd.256"]
+ fn vminpd(a: __m256d, b: __m256d) -> __m256d;
+ #[link_name = "llvm.x86.avx.max.pd.256"]
+ fn vmaxpd(a: __m256d, b: __m256d) -> __m256d;
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::hint::black_box;
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_add_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_add_pd(a, b);
+ let e = _mm256_setr_pd(6., 8., 10., 12.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_add_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_setr_ps(9., 10., 11., 12., 13., 14., 15., 16.);
+ let r = _mm256_add_ps(a, b);
+ let e = _mm256_setr_ps(10., 12., 14., 16., 18., 20., 22., 24.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_and_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set1_pd(0.6);
+ let r = _mm256_and_pd(a, b);
+ let e = _mm256_set1_pd(0.5);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_and_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set1_ps(0.6);
+ let r = _mm256_and_ps(a, b);
+ let e = _mm256_set1_ps(0.5);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_or_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set1_pd(0.6);
+ let r = _mm256_or_pd(a, b);
+ let e = _mm256_set1_pd(1.2);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_or_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set1_ps(0.6);
+ let r = _mm256_or_ps(a, b);
+ let e = _mm256_set1_ps(1.2);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_shuffle_pd() {
+ let a = _mm256_setr_pd(1., 4., 5., 8.);
+ let b = _mm256_setr_pd(2., 3., 6., 7.);
+ let r = _mm256_shuffle_pd::<0b11_11_11_11>(a, b);
+ let e = _mm256_setr_pd(4., 3., 8., 7.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_shuffle_ps() {
+ let a = _mm256_setr_ps(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm256_setr_ps(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm256_shuffle_ps::<0b00_00_11_11>(a, b);
+ let e = _mm256_setr_ps(8., 8., 2., 2., 16., 16., 10., 10.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_andnot_pd() {
+ let a = _mm256_set1_pd(0.);
+ let b = _mm256_set1_pd(0.6);
+ let r = _mm256_andnot_pd(a, b);
+ assert_eq_m256d(r, b);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_andnot_ps() {
+ let a = _mm256_set1_ps(0.);
+ let b = _mm256_set1_ps(0.6);
+ let r = _mm256_andnot_ps(a, b);
+ assert_eq_m256(r, b);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_max_pd() {
+ let a = _mm256_setr_pd(1., 4., 5., 8.);
+ let b = _mm256_setr_pd(2., 3., 6., 7.);
+ let r = _mm256_max_pd(a, b);
+ let e = _mm256_setr_pd(2., 4., 6., 8.);
+ assert_eq_m256d(r, e);
+ // > If the values being compared are both 0.0s (of either sign), the
+ // > value in the second operand (source operand) is returned.
+ let w = _mm256_max_pd(_mm256_set1_pd(0.0), _mm256_set1_pd(-0.0));
+ let x = _mm256_max_pd(_mm256_set1_pd(-0.0), _mm256_set1_pd(0.0));
+ let wu: [u64; 4] = transmute(w);
+ let xu: [u64; 4] = transmute(x);
+ assert_eq!(wu, [0x8000_0000_0000_0000u64; 4]);
+ assert_eq!(xu, [0u64; 4]);
+ // > If only one value is a NaN (SNaN or QNaN) for this instruction, the
+ // > second operand (source operand), either a NaN or a valid
+ // > floating-point value, is written to the result.
+ let y = _mm256_max_pd(_mm256_set1_pd(f64::NAN), _mm256_set1_pd(0.0));
+ let z = _mm256_max_pd(_mm256_set1_pd(0.0), _mm256_set1_pd(f64::NAN));
+ let yf: [f64; 4] = transmute(y);
+ let zf: [f64; 4] = transmute(z);
+ assert_eq!(yf, [0.0; 4]);
+ assert!(zf.iter().all(|f| f.is_nan()), "{:?}", zf);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_max_ps() {
+ let a = _mm256_setr_ps(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm256_setr_ps(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm256_max_ps(a, b);
+ let e = _mm256_setr_ps(2., 4., 6., 8., 10., 12., 14., 16.);
+ assert_eq_m256(r, e);
+ // > If the values being compared are both 0.0s (of either sign), the
+ // > value in the second operand (source operand) is returned.
+ let w = _mm256_max_ps(_mm256_set1_ps(0.0), _mm256_set1_ps(-0.0));
+ let x = _mm256_max_ps(_mm256_set1_ps(-0.0), _mm256_set1_ps(0.0));
+ let wu: [u32; 8] = transmute(w);
+ let xu: [u32; 8] = transmute(x);
+ assert_eq!(wu, [0x8000_0000u32; 8]);
+ assert_eq!(xu, [0u32; 8]);
+ // > If only one value is a NaN (SNaN or QNaN) for this instruction, the
+ // > second operand (source operand), either a NaN or a valid
+ // > floating-point value, is written to the result.
+ let y = _mm256_max_ps(_mm256_set1_ps(f32::NAN), _mm256_set1_ps(0.0));
+ let z = _mm256_max_ps(_mm256_set1_ps(0.0), _mm256_set1_ps(f32::NAN));
+ let yf: [f32; 8] = transmute(y);
+ let zf: [f32; 8] = transmute(z);
+ assert_eq!(yf, [0.0; 8]);
+ assert!(zf.iter().all(|f| f.is_nan()), "{:?}", zf);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_min_pd() {
+ let a = _mm256_setr_pd(1., 4., 5., 8.);
+ let b = _mm256_setr_pd(2., 3., 6., 7.);
+ let r = _mm256_min_pd(a, b);
+ let e = _mm256_setr_pd(1., 3., 5., 7.);
+ assert_eq_m256d(r, e);
+ // > If the values being compared are both 0.0s (of either sign), the
+ // > value in the second operand (source operand) is returned.
+ let w = _mm256_min_pd(_mm256_set1_pd(0.0), _mm256_set1_pd(-0.0));
+ let x = _mm256_min_pd(_mm256_set1_pd(-0.0), _mm256_set1_pd(0.0));
+ let wu: [u64; 4] = transmute(w);
+ let xu: [u64; 4] = transmute(x);
+ assert_eq!(wu, [0x8000_0000_0000_0000u64; 4]);
+ assert_eq!(xu, [0u64; 4]);
+ // > If only one value is a NaN (SNaN or QNaN) for this instruction, the
+ // > second operand (source operand), either a NaN or a valid
+ // > floating-point value, is written to the result.
+ let y = _mm256_min_pd(_mm256_set1_pd(f64::NAN), _mm256_set1_pd(0.0));
+ let z = _mm256_min_pd(_mm256_set1_pd(0.0), _mm256_set1_pd(f64::NAN));
+ let yf: [f64; 4] = transmute(y);
+ let zf: [f64; 4] = transmute(z);
+ assert_eq!(yf, [0.0; 4]);
+ assert!(zf.iter().all(|f| f.is_nan()), "{:?}", zf);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_min_ps() {
+ let a = _mm256_setr_ps(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm256_setr_ps(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm256_min_ps(a, b);
+ let e = _mm256_setr_ps(1., 3., 5., 7., 9., 11., 13., 15.);
+ assert_eq_m256(r, e);
+ // > If the values being compared are both 0.0s (of either sign), the
+ // > value in the second operand (source operand) is returned.
+ let w = _mm256_min_ps(_mm256_set1_ps(0.0), _mm256_set1_ps(-0.0));
+ let x = _mm256_min_ps(_mm256_set1_ps(-0.0), _mm256_set1_ps(0.0));
+ let wu: [u32; 8] = transmute(w);
+ let xu: [u32; 8] = transmute(x);
+ assert_eq!(wu, [0x8000_0000u32; 8]);
+ assert_eq!(xu, [0u32; 8]);
+ // > If only one value is a NaN (SNaN or QNaN) for this instruction, the
+ // > second operand (source operand), either a NaN or a valid
+ // > floating-point value, is written to the result.
+ let y = _mm256_min_ps(_mm256_set1_ps(f32::NAN), _mm256_set1_ps(0.0));
+ let z = _mm256_min_ps(_mm256_set1_ps(0.0), _mm256_set1_ps(f32::NAN));
+ let yf: [f32; 8] = transmute(y);
+ let zf: [f32; 8] = transmute(z);
+ assert_eq!(yf, [0.0; 8]);
+ assert!(zf.iter().all(|f| f.is_nan()), "{:?}", zf);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_mul_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_mul_pd(a, b);
+ let e = _mm256_setr_pd(5., 12., 21., 32.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_mul_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_setr_ps(9., 10., 11., 12., 13., 14., 15., 16.);
+ let r = _mm256_mul_ps(a, b);
+ let e = _mm256_setr_ps(9., 20., 33., 48., 65., 84., 105., 128.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_addsub_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_addsub_pd(a, b);
+ let e = _mm256_setr_pd(-4., 8., -4., 12.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_addsub_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 1., 2., 3., 4.);
+ let b = _mm256_setr_ps(5., 6., 7., 8., 5., 6., 7., 8.);
+ let r = _mm256_addsub_ps(a, b);
+ let e = _mm256_setr_ps(-4., 8., -4., 12., -4., 8., -4., 12.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_sub_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_sub_pd(a, b);
+ let e = _mm256_setr_pd(-4., -4., -4., -4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_sub_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., -1., -2., -3., -4.);
+ let b = _mm256_setr_ps(5., 6., 7., 8., 3., 2., 1., 0.);
+ let r = _mm256_sub_ps(a, b);
+ let e = _mm256_setr_ps(-4., -4., -4., -4., -4., -4., -4., -4.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_round_pd() {
+ let a = _mm256_setr_pd(1.55, 2.2, 3.99, -1.2);
+ let result_closest = _mm256_round_pd::<0b0000>(a);
+ let result_down = _mm256_round_pd::<0b0001>(a);
+ let result_up = _mm256_round_pd::<0b0010>(a);
+ let expected_closest = _mm256_setr_pd(2., 2., 4., -1.);
+ let expected_down = _mm256_setr_pd(1., 2., 3., -2.);
+ let expected_up = _mm256_setr_pd(2., 3., 4., -1.);
+ assert_eq_m256d(result_closest, expected_closest);
+ assert_eq_m256d(result_down, expected_down);
+ assert_eq_m256d(result_up, expected_up);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_floor_pd() {
+ let a = _mm256_setr_pd(1.55, 2.2, 3.99, -1.2);
+ let result_down = _mm256_floor_pd(a);
+ let expected_down = _mm256_setr_pd(1., 2., 3., -2.);
+ assert_eq_m256d(result_down, expected_down);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_ceil_pd() {
+ let a = _mm256_setr_pd(1.55, 2.2, 3.99, -1.2);
+ let result_up = _mm256_ceil_pd(a);
+ let expected_up = _mm256_setr_pd(2., 3., 4., -1.);
+ assert_eq_m256d(result_up, expected_up);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_round_ps() {
+ let a = _mm256_setr_ps(1.55, 2.2, 3.99, -1.2, 1.55, 2.2, 3.99, -1.2);
+ let result_closest = _mm256_round_ps::<0b0000>(a);
+ let result_down = _mm256_round_ps::<0b0001>(a);
+ let result_up = _mm256_round_ps::<0b0010>(a);
+ let expected_closest = _mm256_setr_ps(2., 2., 4., -1., 2., 2., 4., -1.);
+ let expected_down = _mm256_setr_ps(1., 2., 3., -2., 1., 2., 3., -2.);
+ let expected_up = _mm256_setr_ps(2., 3., 4., -1., 2., 3., 4., -1.);
+ assert_eq_m256(result_closest, expected_closest);
+ assert_eq_m256(result_down, expected_down);
+ assert_eq_m256(result_up, expected_up);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_floor_ps() {
+ let a = _mm256_setr_ps(1.55, 2.2, 3.99, -1.2, 1.55, 2.2, 3.99, -1.2);
+ let result_down = _mm256_floor_ps(a);
+ let expected_down = _mm256_setr_ps(1., 2., 3., -2., 1., 2., 3., -2.);
+ assert_eq_m256(result_down, expected_down);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_ceil_ps() {
+ let a = _mm256_setr_ps(1.55, 2.2, 3.99, -1.2, 1.55, 2.2, 3.99, -1.2);
+ let result_up = _mm256_ceil_ps(a);
+ let expected_up = _mm256_setr_ps(2., 3., 4., -1., 2., 3., 4., -1.);
+ assert_eq_m256(result_up, expected_up);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_sqrt_pd() {
+ let a = _mm256_setr_pd(4., 9., 16., 25.);
+ let r = _mm256_sqrt_pd(a);
+ let e = _mm256_setr_pd(2., 3., 4., 5.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_sqrt_ps() {
+ let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.);
+ let r = _mm256_sqrt_ps(a);
+ let e = _mm256_setr_ps(2., 3., 4., 5., 2., 3., 4., 5.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_div_ps() {
+ let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.);
+ let b = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ let r = _mm256_div_ps(a, b);
+ let e = _mm256_setr_ps(1., 3., 8., 5., 0.5, 1., 0.25, 0.5);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_div_pd() {
+ let a = _mm256_setr_pd(4., 9., 16., 25.);
+ let b = _mm256_setr_pd(4., 3., 2., 5.);
+ let r = _mm256_div_pd(a, b);
+ let e = _mm256_setr_pd(1., 3., 8., 5.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_blend_pd() {
+ let a = _mm256_setr_pd(4., 9., 16., 25.);
+ let b = _mm256_setr_pd(4., 3., 2., 5.);
+ let r = _mm256_blend_pd::<0x0>(a, b);
+ assert_eq_m256d(r, _mm256_setr_pd(4., 9., 16., 25.));
+ let r = _mm256_blend_pd::<0x3>(a, b);
+ assert_eq_m256d(r, _mm256_setr_pd(4., 3., 16., 25.));
+ let r = _mm256_blend_pd::<0xF>(a, b);
+ assert_eq_m256d(r, _mm256_setr_pd(4., 3., 2., 5.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_blend_ps() {
+ let a = _mm256_setr_ps(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm256_setr_ps(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm256_blend_ps::<0x0>(a, b);
+ assert_eq_m256(r, _mm256_setr_ps(1., 4., 5., 8., 9., 12., 13., 16.));
+ let r = _mm256_blend_ps::<0x3>(a, b);
+ assert_eq_m256(r, _mm256_setr_ps(2., 3., 5., 8., 9., 12., 13., 16.));
+ let r = _mm256_blend_ps::<0xF>(a, b);
+ assert_eq_m256(r, _mm256_setr_ps(2., 3., 6., 7., 9., 12., 13., 16.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_blendv_pd() {
+ let a = _mm256_setr_pd(4., 9., 16., 25.);
+ let b = _mm256_setr_pd(4., 3., 2., 5.);
+ let c = _mm256_setr_pd(0., 0., !0 as f64, !0 as f64);
+ let r = _mm256_blendv_pd(a, b, c);
+ let e = _mm256_setr_pd(4., 9., 2., 5.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_blendv_ps() {
+ let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.);
+ let b = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ #[rustfmt::skip]
+ let c = _mm256_setr_ps(
+ 0., 0., 0., 0., !0 as f32, !0 as f32, !0 as f32, !0 as f32,
+ );
+ let r = _mm256_blendv_ps(a, b, c);
+ let e = _mm256_setr_ps(4., 9., 16., 25., 8., 9., 64., 50.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_dp_ps() {
+ let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.);
+ let b = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ let r = _mm256_dp_ps::<0xFF>(a, b);
+ let e = _mm256_setr_ps(200., 200., 200., 200., 2387., 2387., 2387., 2387.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_hadd_pd() {
+ let a = _mm256_setr_pd(4., 9., 16., 25.);
+ let b = _mm256_setr_pd(4., 3., 2., 5.);
+ let r = _mm256_hadd_pd(a, b);
+ let e = _mm256_setr_pd(13., 7., 41., 7.);
+ assert_eq_m256d(r, e);
+
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_hadd_pd(a, b);
+ let e = _mm256_setr_pd(3., 11., 7., 15.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_hadd_ps() {
+ let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.);
+ let b = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ let r = _mm256_hadd_ps(a, b);
+ let e = _mm256_setr_ps(13., 41., 7., 7., 13., 41., 17., 114.);
+ assert_eq_m256(r, e);
+
+ let a = _mm256_setr_ps(1., 2., 3., 4., 1., 2., 3., 4.);
+ let b = _mm256_setr_ps(5., 6., 7., 8., 5., 6., 7., 8.);
+ let r = _mm256_hadd_ps(a, b);
+ let e = _mm256_setr_ps(3., 7., 11., 15., 3., 7., 11., 15.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_hsub_pd() {
+ let a = _mm256_setr_pd(4., 9., 16., 25.);
+ let b = _mm256_setr_pd(4., 3., 2., 5.);
+ let r = _mm256_hsub_pd(a, b);
+ let e = _mm256_setr_pd(-5., 1., -9., -3.);
+ assert_eq_m256d(r, e);
+
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_hsub_pd(a, b);
+ let e = _mm256_setr_pd(-1., -1., -1., -1.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_hsub_ps() {
+ let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.);
+ let b = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ let r = _mm256_hsub_ps(a, b);
+ let e = _mm256_setr_ps(-5., -9., 1., -3., -5., -9., -1., 14.);
+ assert_eq_m256(r, e);
+
+ let a = _mm256_setr_ps(1., 2., 3., 4., 1., 2., 3., 4.);
+ let b = _mm256_setr_ps(5., 6., 7., 8., 5., 6., 7., 8.);
+ let r = _mm256_hsub_ps(a, b);
+ let e = _mm256_setr_ps(-1., -1., -1., -1., -1., -1., -1., -1.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_xor_pd() {
+ let a = _mm256_setr_pd(4., 9., 16., 25.);
+ let b = _mm256_set1_pd(0.);
+ let r = _mm256_xor_pd(a, b);
+ assert_eq_m256d(r, a);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_xor_ps() {
+ let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.);
+ let b = _mm256_set1_ps(0.);
+ let r = _mm256_xor_ps(a, b);
+ assert_eq_m256(r, a);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_cmp_pd() {
+ let a = _mm_setr_pd(4., 9.);
+ let b = _mm_setr_pd(4., 3.);
+ let r = _mm_cmp_pd::<_CMP_GE_OS>(a, b);
+ assert!(get_m128d(r, 0).is_nan());
+ assert!(get_m128d(r, 1).is_nan());
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cmp_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_cmp_pd::<_CMP_GE_OS>(a, b);
+ let e = _mm256_set1_pd(0.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_cmp_ps() {
+ let a = _mm_setr_ps(4., 3., 2., 5.);
+ let b = _mm_setr_ps(4., 9., 16., 25.);
+ let r = _mm_cmp_ps::<_CMP_GE_OS>(a, b);
+ assert!(get_m128(r, 0).is_nan());
+ assert_eq!(get_m128(r, 1), 0.);
+ assert_eq!(get_m128(r, 2), 0.);
+ assert_eq!(get_m128(r, 3), 0.);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cmp_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 1., 2., 3., 4.);
+ let b = _mm256_setr_ps(5., 6., 7., 8., 5., 6., 7., 8.);
+ let r = _mm256_cmp_ps::<_CMP_GE_OS>(a, b);
+ let e = _mm256_set1_ps(0.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_cmp_sd() {
+ let a = _mm_setr_pd(4., 9.);
+ let b = _mm_setr_pd(4., 3.);
+ let r = _mm_cmp_sd::<_CMP_GE_OS>(a, b);
+ assert!(get_m128d(r, 0).is_nan());
+ assert_eq!(get_m128d(r, 1), 9.);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_cmp_ss() {
+ let a = _mm_setr_ps(4., 3., 2., 5.);
+ let b = _mm_setr_ps(4., 9., 16., 25.);
+ let r = _mm_cmp_ss::<_CMP_GE_OS>(a, b);
+ assert!(get_m128(r, 0).is_nan());
+ assert_eq!(get_m128(r, 1), 3.);
+ assert_eq!(get_m128(r, 2), 2.);
+ assert_eq!(get_m128(r, 3), 5.);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cvtepi32_pd() {
+ let a = _mm_setr_epi32(4, 9, 16, 25);
+ let r = _mm256_cvtepi32_pd(a);
+ let e = _mm256_setr_pd(4., 9., 16., 25.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cvtepi32_ps() {
+ let a = _mm256_setr_epi32(4, 9, 16, 25, 4, 9, 16, 25);
+ let r = _mm256_cvtepi32_ps(a);
+ let e = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cvtpd_ps() {
+ let a = _mm256_setr_pd(4., 9., 16., 25.);
+ let r = _mm256_cvtpd_ps(a);
+ let e = _mm_setr_ps(4., 9., 16., 25.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cvtps_epi32() {
+ let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.);
+ let r = _mm256_cvtps_epi32(a);
+ let e = _mm256_setr_epi32(4, 9, 16, 25, 4, 9, 16, 25);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cvtps_pd() {
+ let a = _mm_setr_ps(4., 9., 16., 25.);
+ let r = _mm256_cvtps_pd(a);
+ let e = _mm256_setr_pd(4., 9., 16., 25.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cvttpd_epi32() {
+ let a = _mm256_setr_pd(4., 9., 16., 25.);
+ let r = _mm256_cvttpd_epi32(a);
+ let e = _mm_setr_epi32(4, 9, 16, 25);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cvtpd_epi32() {
+ let a = _mm256_setr_pd(4., 9., 16., 25.);
+ let r = _mm256_cvtpd_epi32(a);
+ let e = _mm_setr_epi32(4, 9, 16, 25);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cvttps_epi32() {
+ let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.);
+ let r = _mm256_cvttps_epi32(a);
+ let e = _mm256_setr_epi32(4, 9, 16, 25, 4, 9, 16, 25);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_extractf128_ps() {
+ let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ let r = _mm256_extractf128_ps::<0>(a);
+ let e = _mm_setr_ps(4., 3., 2., 5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_extractf128_pd() {
+ let a = _mm256_setr_pd(4., 3., 2., 5.);
+ let r = _mm256_extractf128_pd::<0>(a);
+ let e = _mm_setr_pd(4., 3.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_extractf128_si256() {
+ let a = _mm256_setr_epi64x(4, 3, 2, 5);
+ let r = _mm256_extractf128_si256::<0>(a);
+ let e = _mm_setr_epi64x(4, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_zeroall() {
+ _mm256_zeroall();
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_zeroupper() {
+ _mm256_zeroupper();
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_permutevar_ps() {
+ let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ let b = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_permutevar_ps(a, b);
+ let e = _mm256_setr_ps(3., 2., 5., 4., 9., 64., 50., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_permutevar_ps() {
+ let a = _mm_setr_ps(4., 3., 2., 5.);
+ let b = _mm_setr_epi32(1, 2, 3, 4);
+ let r = _mm_permutevar_ps(a, b);
+ let e = _mm_setr_ps(3., 2., 5., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_permute_ps() {
+ let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ let r = _mm256_permute_ps::<0x1b>(a);
+ let e = _mm256_setr_ps(5., 2., 3., 4., 50., 64., 9., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_permute_ps() {
+ let a = _mm_setr_ps(4., 3., 2., 5.);
+ let r = _mm_permute_ps::<0x1b>(a);
+ let e = _mm_setr_ps(5., 2., 3., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_permutevar_pd() {
+ let a = _mm256_setr_pd(4., 3., 2., 5.);
+ let b = _mm256_setr_epi64x(1, 2, 3, 4);
+ let r = _mm256_permutevar_pd(a, b);
+ let e = _mm256_setr_pd(4., 3., 5., 2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_permutevar_pd() {
+ let a = _mm_setr_pd(4., 3.);
+ let b = _mm_setr_epi64x(3, 0);
+ let r = _mm_permutevar_pd(a, b);
+ let e = _mm_setr_pd(3., 4.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_permute_pd() {
+ let a = _mm256_setr_pd(4., 3., 2., 5.);
+ let r = _mm256_permute_pd::<5>(a);
+ let e = _mm256_setr_pd(3., 4., 5., 2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_permute_pd() {
+ let a = _mm_setr_pd(4., 3.);
+ let r = _mm_permute_pd::<1>(a);
+ let e = _mm_setr_pd(3., 4.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_permute2f128_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 1., 2., 3., 4.);
+ let b = _mm256_setr_ps(5., 6., 7., 8., 5., 6., 7., 8.);
+ let r = _mm256_permute2f128_ps::<0x13>(a, b);
+ let e = _mm256_setr_ps(5., 6., 7., 8., 1., 2., 3., 4.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_permute2f128_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_permute2f128_pd::<0x31>(a, b);
+ let e = _mm256_setr_pd(3., 4., 7., 8.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_permute2f128_si256() {
+ let a = _mm256_setr_epi32(1, 2, 3, 4, 1, 2, 3, 4);
+ let b = _mm256_setr_epi32(5, 6, 7, 8, 5, 6, 7, 8);
+ let r = _mm256_permute2f128_si256::<0x20>(a, b);
+ let e = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_broadcast_ss() {
+ let r = _mm256_broadcast_ss(&3.);
+ let e = _mm256_set1_ps(3.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_broadcast_ss() {
+ let r = _mm_broadcast_ss(&3.);
+ let e = _mm_set1_ps(3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_broadcast_sd() {
+ let r = _mm256_broadcast_sd(&3.);
+ let e = _mm256_set1_pd(3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_broadcast_ps() {
+ let a = _mm_setr_ps(4., 3., 2., 5.);
+ let r = _mm256_broadcast_ps(&a);
+ let e = _mm256_setr_ps(4., 3., 2., 5., 4., 3., 2., 5.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_broadcast_pd() {
+ let a = _mm_setr_pd(4., 3.);
+ let r = _mm256_broadcast_pd(&a);
+ let e = _mm256_setr_pd(4., 3., 4., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_insertf128_ps() {
+ let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ let b = _mm_setr_ps(4., 9., 16., 25.);
+ let r = _mm256_insertf128_ps::<0>(a, b);
+ let e = _mm256_setr_ps(4., 9., 16., 25., 8., 9., 64., 50.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_insertf128_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm_setr_pd(5., 6.);
+ let r = _mm256_insertf128_pd::<0>(a, b);
+ let e = _mm256_setr_pd(5., 6., 3., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_insertf128_si256() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let b = _mm_setr_epi64x(5, 6);
+ let r = _mm256_insertf128_si256::<0>(a, b);
+ let e = _mm256_setr_epi64x(5, 6, 3, 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_insert_epi8() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_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,
+ );
+ let r = _mm256_insert_epi8::<31>(a, 0);
+ #[rustfmt::skip]
+ let e = _mm256_setr_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, 0,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_insert_epi16() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ let r = _mm256_insert_epi16::<15>(a, 0);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 0,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_insert_epi32() {
+ let a = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_insert_epi32::<7>(a, 0);
+ let e = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_load_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let p = &a as *const _ as *const f64;
+ let r = _mm256_load_pd(p);
+ let e = _mm256_setr_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_store_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let mut r = _mm256_undefined_pd();
+ _mm256_store_pd(&mut r as *mut _ as *mut f64, a);
+ assert_eq_m256d(r, a);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_load_ps() {
+ let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ let p = &a as *const _ as *const f32;
+ let r = _mm256_load_ps(p);
+ let e = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_store_ps() {
+ let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ let mut r = _mm256_undefined_ps();
+ _mm256_store_ps(&mut r as *mut _ as *mut f32, a);
+ assert_eq_m256(r, a);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_loadu_pd() {
+ let a = &[1.0f64, 2., 3., 4.];
+ let p = a.as_ptr();
+ let r = _mm256_loadu_pd(black_box(p));
+ let e = _mm256_setr_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_storeu_pd() {
+ let a = _mm256_set1_pd(9.);
+ let mut r = _mm256_undefined_pd();
+ _mm256_storeu_pd(&mut r as *mut _ as *mut f64, a);
+ assert_eq_m256d(r, a);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_loadu_ps() {
+ let a = &[4., 3., 2., 5., 8., 9., 64., 50.];
+ let p = a.as_ptr();
+ let r = _mm256_loadu_ps(black_box(p));
+ let e = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_storeu_ps() {
+ let a = _mm256_set1_ps(9.);
+ let mut r = _mm256_undefined_ps();
+ _mm256_storeu_ps(&mut r as *mut _ as *mut f32, a);
+ assert_eq_m256(r, a);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_load_si256() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let p = &a as *const _;
+ let r = _mm256_load_si256(p);
+ let e = _mm256_setr_epi64x(1, 2, 3, 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_store_si256() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let mut r = _mm256_undefined_si256();
+ _mm256_store_si256(&mut r as *mut _, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_loadu_si256() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let p = &a as *const _;
+ let r = _mm256_loadu_si256(black_box(p));
+ let e = _mm256_setr_epi64x(1, 2, 3, 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_storeu_si256() {
+ let a = _mm256_set1_epi8(9);
+ let mut r = _mm256_undefined_si256();
+ _mm256_storeu_si256(&mut r as *mut _, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_maskload_pd() {
+ let a = &[1.0f64, 2., 3., 4.];
+ let p = a.as_ptr();
+ let mask = _mm256_setr_epi64x(0, !0, 0, !0);
+ let r = _mm256_maskload_pd(black_box(p), mask);
+ let e = _mm256_setr_pd(0., 2., 0., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_maskstore_pd() {
+ let mut r = _mm256_set1_pd(0.);
+ let mask = _mm256_setr_epi64x(0, !0, 0, !0);
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ _mm256_maskstore_pd(&mut r as *mut _ as *mut f64, mask, a);
+ let e = _mm256_setr_pd(0., 2., 0., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_maskload_pd() {
+ let a = &[1.0f64, 2.];
+ let p = a.as_ptr();
+ let mask = _mm_setr_epi64x(0, !0);
+ let r = _mm_maskload_pd(black_box(p), mask);
+ let e = _mm_setr_pd(0., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_maskstore_pd() {
+ let mut r = _mm_set1_pd(0.);
+ let mask = _mm_setr_epi64x(0, !0);
+ let a = _mm_setr_pd(1., 2.);
+ _mm_maskstore_pd(&mut r as *mut _ as *mut f64, mask, a);
+ let e = _mm_setr_pd(0., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_maskload_ps() {
+ let a = &[1.0f32, 2., 3., 4., 5., 6., 7., 8.];
+ let p = a.as_ptr();
+ let mask = _mm256_setr_epi32(0, !0, 0, !0, 0, !0, 0, !0);
+ let r = _mm256_maskload_ps(black_box(p), mask);
+ let e = _mm256_setr_ps(0., 2., 0., 4., 0., 6., 0., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_maskstore_ps() {
+ let mut r = _mm256_set1_ps(0.);
+ let mask = _mm256_setr_epi32(0, !0, 0, !0, 0, !0, 0, !0);
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ _mm256_maskstore_ps(&mut r as *mut _ as *mut f32, mask, a);
+ let e = _mm256_setr_ps(0., 2., 0., 4., 0., 6., 0., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_maskload_ps() {
+ let a = &[1.0f32, 2., 3., 4.];
+ let p = a.as_ptr();
+ let mask = _mm_setr_epi32(0, !0, 0, !0);
+ let r = _mm_maskload_ps(black_box(p), mask);
+ let e = _mm_setr_ps(0., 2., 0., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_maskstore_ps() {
+ let mut r = _mm_set1_ps(0.);
+ let mask = _mm_setr_epi32(0, !0, 0, !0);
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ _mm_maskstore_ps(&mut r as *mut _ as *mut f32, mask, a);
+ let e = _mm_setr_ps(0., 2., 0., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_movehdup_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_movehdup_ps(a);
+ let e = _mm256_setr_ps(2., 2., 4., 4., 6., 6., 8., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_moveldup_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_moveldup_ps(a);
+ let e = _mm256_setr_ps(1., 1., 3., 3., 5., 5., 7., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_movedup_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let r = _mm256_movedup_pd(a);
+ let e = _mm256_setr_pd(1., 1., 3., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_lddqu_si256() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_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,
+ );
+ let p = &a as *const _;
+ let r = _mm256_lddqu_si256(black_box(p));
+ #[rustfmt::skip]
+ let e = _mm256_setr_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,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_stream_si256() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let mut r = _mm256_undefined_si256();
+ _mm256_stream_si256(&mut r as *mut _, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_stream_pd() {
+ #[repr(align(32))]
+ struct Memory {
+ pub data: [f64; 4],
+ }
+ let a = _mm256_set1_pd(7.0);
+ let mut mem = Memory { data: [-1.0; 4] };
+
+ _mm256_stream_pd(&mut mem.data[0] as *mut f64, a);
+ for i in 0..4 {
+ assert_eq!(mem.data[i], get_m256d(a, i));
+ }
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_stream_ps() {
+ #[repr(align(32))]
+ struct Memory {
+ pub data: [f32; 8],
+ }
+ let a = _mm256_set1_ps(7.0);
+ let mut mem = Memory { data: [-1.0; 8] };
+
+ _mm256_stream_ps(&mut mem.data[0] as *mut f32, a);
+ for i in 0..8 {
+ assert_eq!(mem.data[i], get_m256(a, i));
+ }
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_rcp_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_rcp_ps(a);
+ #[rustfmt::skip]
+ let e = _mm256_setr_ps(
+ 0.99975586, 0.49987793, 0.33325195, 0.24993896,
+ 0.19995117, 0.16662598, 0.14282227, 0.12496948,
+ );
+ let rel_err = 0.00048828125;
+ for i in 0..8 {
+ assert_approx_eq!(get_m256(r, i), get_m256(e, i), 2. * rel_err);
+ }
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_rsqrt_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_rsqrt_ps(a);
+ #[rustfmt::skip]
+ let e = _mm256_setr_ps(
+ 0.99975586, 0.7069092, 0.5772705, 0.49987793,
+ 0.44714355, 0.40820313, 0.3779297, 0.3534546,
+ );
+ let rel_err = 0.00048828125;
+ for i in 0..8 {
+ assert_approx_eq!(get_m256(r, i), get_m256(e, i), 2. * rel_err);
+ }
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_unpackhi_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_unpackhi_pd(a, b);
+ let e = _mm256_setr_pd(2., 6., 4., 8.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_unpackhi_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_setr_ps(9., 10., 11., 12., 13., 14., 15., 16.);
+ let r = _mm256_unpackhi_ps(a, b);
+ let e = _mm256_setr_ps(3., 11., 4., 12., 7., 15., 8., 16.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_unpacklo_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_unpacklo_pd(a, b);
+ let e = _mm256_setr_pd(1., 5., 3., 7.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_unpacklo_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_setr_ps(9., 10., 11., 12., 13., 14., 15., 16.);
+ let r = _mm256_unpacklo_ps(a, b);
+ let e = _mm256_setr_ps(1., 9., 2., 10., 5., 13., 6., 14.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_testz_si256() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let b = _mm256_setr_epi64x(5, 6, 7, 8);
+ let r = _mm256_testz_si256(a, b);
+ assert_eq!(r, 0);
+ let b = _mm256_set1_epi64x(0);
+ let r = _mm256_testz_si256(a, b);
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_testc_si256() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let b = _mm256_setr_epi64x(5, 6, 7, 8);
+ let r = _mm256_testc_si256(a, b);
+ assert_eq!(r, 0);
+ let b = _mm256_set1_epi64x(0);
+ let r = _mm256_testc_si256(a, b);
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_testnzc_si256() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let b = _mm256_setr_epi64x(5, 6, 7, 8);
+ let r = _mm256_testnzc_si256(a, b);
+ assert_eq!(r, 1);
+ let a = _mm256_setr_epi64x(0, 0, 0, 0);
+ let b = _mm256_setr_epi64x(0, 0, 0, 0);
+ let r = _mm256_testnzc_si256(a, b);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_testz_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_testz_pd(a, b);
+ assert_eq!(r, 1);
+ let a = _mm256_set1_pd(-1.);
+ let r = _mm256_testz_pd(a, a);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_testc_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_testc_pd(a, b);
+ assert_eq!(r, 1);
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set1_pd(-1.);
+ let r = _mm256_testc_pd(a, b);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_testnzc_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 6., 7., 8.);
+ let r = _mm256_testnzc_pd(a, b);
+ assert_eq!(r, 0);
+ let a = _mm256_setr_pd(1., -1., -1., -1.);
+ let b = _mm256_setr_pd(-1., -1., 1., 1.);
+ let r = _mm256_testnzc_pd(a, b);
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_testz_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 6.);
+ let r = _mm_testz_pd(a, b);
+ assert_eq!(r, 1);
+ let a = _mm_set1_pd(-1.);
+ let r = _mm_testz_pd(a, a);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_testc_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 6.);
+ let r = _mm_testc_pd(a, b);
+ assert_eq!(r, 1);
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(-1.);
+ let r = _mm_testc_pd(a, b);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_testnzc_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 6.);
+ let r = _mm_testnzc_pd(a, b);
+ assert_eq!(r, 0);
+ let a = _mm_setr_pd(1., -1.);
+ let b = _mm_setr_pd(-1., -1.);
+ let r = _mm_testnzc_pd(a, b);
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_testz_ps() {
+ let a = _mm256_set1_ps(1.);
+ let r = _mm256_testz_ps(a, a);
+ assert_eq!(r, 1);
+ let a = _mm256_set1_ps(-1.);
+ let r = _mm256_testz_ps(a, a);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_testc_ps() {
+ let a = _mm256_set1_ps(1.);
+ let r = _mm256_testc_ps(a, a);
+ assert_eq!(r, 1);
+ let b = _mm256_set1_ps(-1.);
+ let r = _mm256_testc_ps(a, b);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_testnzc_ps() {
+ let a = _mm256_set1_ps(1.);
+ let r = _mm256_testnzc_ps(a, a);
+ assert_eq!(r, 0);
+ let a = _mm256_setr_ps(1., -1., -1., -1., -1., -1., -1., -1.);
+ let b = _mm256_setr_ps(-1., -1., 1., 1., 1., 1., 1., 1.);
+ let r = _mm256_testnzc_ps(a, b);
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_testz_ps() {
+ let a = _mm_set1_ps(1.);
+ let r = _mm_testz_ps(a, a);
+ assert_eq!(r, 1);
+ let a = _mm_set1_ps(-1.);
+ let r = _mm_testz_ps(a, a);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_testc_ps() {
+ let a = _mm_set1_ps(1.);
+ let r = _mm_testc_ps(a, a);
+ assert_eq!(r, 1);
+ let b = _mm_set1_ps(-1.);
+ let r = _mm_testc_ps(a, b);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm_testnzc_ps() {
+ let a = _mm_set1_ps(1.);
+ let r = _mm_testnzc_ps(a, a);
+ assert_eq!(r, 0);
+ let a = _mm_setr_ps(1., -1., -1., -1.);
+ let b = _mm_setr_ps(-1., -1., 1., 1.);
+ let r = _mm_testnzc_ps(a, b);
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_movemask_pd() {
+ let a = _mm256_setr_pd(1., -2., 3., -4.);
+ let r = _mm256_movemask_pd(a);
+ assert_eq!(r, 0xA);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_movemask_ps() {
+ let a = _mm256_setr_ps(1., -2., 3., -4., 1., -2., 3., -4.);
+ let r = _mm256_movemask_ps(a);
+ assert_eq!(r, 0xAA);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setzero_pd() {
+ let r = _mm256_setzero_pd();
+ assert_eq_m256d(r, _mm256_set1_pd(0.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setzero_ps() {
+ let r = _mm256_setzero_ps();
+ assert_eq_m256(r, _mm256_set1_ps(0.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setzero_si256() {
+ let r = _mm256_setzero_si256();
+ assert_eq_m256i(r, _mm256_set1_epi8(0));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set_pd() {
+ let r = _mm256_set_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, _mm256_setr_pd(4., 3., 2., 1.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set_ps() {
+ let r = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, _mm256_setr_ps(8., 7., 6., 5., 4., 3., 2., 1.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set_epi8() {
+ #[rustfmt::skip]
+ let r = _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 e = _mm256_setr_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 = "avx")]
+ unsafe fn test_mm256_set_epi16() {
+ #[rustfmt::skip]
+ let r = _mm256_set_epi16(
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ #[rustfmt::skip]
+ let e = _mm256_setr_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 = "avx")]
+ unsafe fn test_mm256_set_epi32() {
+ let r = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ assert_eq_m256i(r, _mm256_setr_epi32(8, 7, 6, 5, 4, 3, 2, 1));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set_epi64x() {
+ let r = _mm256_set_epi64x(1, 2, 3, 4);
+ assert_eq_m256i(r, _mm256_setr_epi64x(4, 3, 2, 1));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setr_pd() {
+ let r = _mm256_setr_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, _mm256_setr_pd(1., 2., 3., 4.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setr_ps() {
+ let r = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setr_epi8() {
+ #[rustfmt::skip]
+ let r = _mm256_setr_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 e = _mm256_setr_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
+ );
+
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setr_epi16() {
+ #[rustfmt::skip]
+ let r = _mm256_setr_epi16(
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi16(
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setr_epi32() {
+ let r = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ assert_eq_m256i(r, _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setr_epi64x() {
+ let r = _mm256_setr_epi64x(1, 2, 3, 4);
+ assert_eq_m256i(r, _mm256_setr_epi64x(1, 2, 3, 4));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set1_pd() {
+ let r = _mm256_set1_pd(1.);
+ assert_eq_m256d(r, _mm256_set1_pd(1.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set1_ps() {
+ let r = _mm256_set1_ps(1.);
+ assert_eq_m256(r, _mm256_set1_ps(1.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set1_epi8() {
+ let r = _mm256_set1_epi8(1);
+ assert_eq_m256i(r, _mm256_set1_epi8(1));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set1_epi16() {
+ let r = _mm256_set1_epi16(1);
+ assert_eq_m256i(r, _mm256_set1_epi16(1));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set1_epi32() {
+ let r = _mm256_set1_epi32(1);
+ assert_eq_m256i(r, _mm256_set1_epi32(1));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set1_epi64x() {
+ let r = _mm256_set1_epi64x(1);
+ assert_eq_m256i(r, _mm256_set1_epi64x(1));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_castpd_ps() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let r = _mm256_castpd_ps(a);
+ let e = _mm256_setr_ps(0., 1.875, 0., 2., 0., 2.125, 0., 2.25);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_castps_pd() {
+ let a = _mm256_setr_ps(0., 1.875, 0., 2., 0., 2.125, 0., 2.25);
+ let r = _mm256_castps_pd(a);
+ let e = _mm256_setr_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_castps_si256() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_castps_si256(a);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi8(
+ 0, 0, -128, 63, 0, 0, 0, 64,
+ 0, 0, 64, 64, 0, 0, -128, 64,
+ 0, 0, -96, 64, 0, 0, -64, 64,
+ 0, 0, -32, 64, 0, 0, 0, 65,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_castsi256_ps() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi8(
+ 0, 0, -128, 63, 0, 0, 0, 64,
+ 0, 0, 64, 64, 0, 0, -128, 64,
+ 0, 0, -96, 64, 0, 0, -64, 64,
+ 0, 0, -32, 64, 0, 0, 0, 65,
+ );
+ let r = _mm256_castsi256_ps(a);
+ let e = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_castpd_si256() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let r = _mm256_castpd_si256(a);
+ assert_eq_m256d(transmute(r), a);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_castsi256_pd() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let r = _mm256_castsi256_pd(a);
+ assert_eq_m256d(r, transmute(a));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_castps256_ps128() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_castps256_ps128(a);
+ assert_eq_m128(r, _mm_setr_ps(1., 2., 3., 4.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_castpd256_pd128() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let r = _mm256_castpd256_pd128(a);
+ assert_eq_m128d(r, _mm_setr_pd(1., 2.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_castsi256_si128() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let r = _mm256_castsi256_si128(a);
+ assert_eq_m128i(r, _mm_setr_epi64x(1, 2));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_zextps128_ps256() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let r = _mm256_zextps128_ps256(a);
+ let e = _mm256_setr_ps(1., 2., 3., 4., 0., 0., 0., 0.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_zextsi128_si256() {
+ let a = _mm_setr_epi64x(1, 2);
+ let r = _mm256_zextsi128_si256(a);
+ let e = _mm256_setr_epi64x(1, 2, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_zextpd128_pd256() {
+ let a = _mm_setr_pd(1., 2.);
+ let r = _mm256_zextpd128_pd256(a);
+ let e = _mm256_setr_pd(1., 2., 0., 0.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set_m128() {
+ let hi = _mm_setr_ps(5., 6., 7., 8.);
+ let lo = _mm_setr_ps(1., 2., 3., 4.);
+ let r = _mm256_set_m128(hi, lo);
+ let e = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set_m128d() {
+ let hi = _mm_setr_pd(3., 4.);
+ let lo = _mm_setr_pd(1., 2.);
+ let r = _mm256_set_m128d(hi, lo);
+ let e = _mm256_setr_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_set_m128i() {
+ #[rustfmt::skip]
+ let hi = _mm_setr_epi8(
+ 17, 18, 19, 20,
+ 21, 22, 23, 24,
+ 25, 26, 27, 28,
+ 29, 30, 31, 32,
+ );
+ #[rustfmt::skip]
+ let lo = _mm_setr_epi8(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16,
+ );
+ let r = _mm256_set_m128i(hi, lo);
+ #[rustfmt::skip]
+ let e = _mm256_setr_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,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setr_m128() {
+ let lo = _mm_setr_ps(1., 2., 3., 4.);
+ let hi = _mm_setr_ps(5., 6., 7., 8.);
+ let r = _mm256_setr_m128(lo, hi);
+ let e = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setr_m128d() {
+ let lo = _mm_setr_pd(1., 2.);
+ let hi = _mm_setr_pd(3., 4.);
+ let r = _mm256_setr_m128d(lo, hi);
+ let e = _mm256_setr_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_setr_m128i() {
+ #[rustfmt::skip]
+ let lo = _mm_setr_epi8(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16,
+ );
+ #[rustfmt::skip]
+ let hi = _mm_setr_epi8(
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32,
+ );
+ let r = _mm256_setr_m128i(lo, hi);
+ #[rustfmt::skip]
+ let e = _mm256_setr_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,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_loadu2_m128() {
+ let hi = &[5., 6., 7., 8.];
+ let hiaddr = hi.as_ptr();
+ let lo = &[1., 2., 3., 4.];
+ let loaddr = lo.as_ptr();
+ let r = _mm256_loadu2_m128(hiaddr, loaddr);
+ let e = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_loadu2_m128d() {
+ let hi = &[3., 4.];
+ let hiaddr = hi.as_ptr();
+ let lo = &[1., 2.];
+ let loaddr = lo.as_ptr();
+ let r = _mm256_loadu2_m128d(hiaddr, loaddr);
+ let e = _mm256_setr_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_loadu2_m128i() {
+ #[rustfmt::skip]
+ let hi = _mm_setr_epi8(
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32,
+ );
+ #[rustfmt::skip]
+ let lo = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ let r = _mm256_loadu2_m128i(&hi as *const _ as *const _, &lo as *const _ as *const _);
+ #[rustfmt::skip]
+ let e = _mm256_setr_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,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_storeu2_m128() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let mut hi = _mm_undefined_ps();
+ let mut lo = _mm_undefined_ps();
+ _mm256_storeu2_m128(
+ &mut hi as *mut _ as *mut f32,
+ &mut lo as *mut _ as *mut f32,
+ a,
+ );
+ assert_eq_m128(hi, _mm_setr_ps(5., 6., 7., 8.));
+ assert_eq_m128(lo, _mm_setr_ps(1., 2., 3., 4.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_storeu2_m128d() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let mut hi = _mm_undefined_pd();
+ let mut lo = _mm_undefined_pd();
+ _mm256_storeu2_m128d(
+ &mut hi as *mut _ as *mut f64,
+ &mut lo as *mut _ as *mut f64,
+ a,
+ );
+ assert_eq_m128d(hi, _mm_setr_pd(3., 4.));
+ assert_eq_m128d(lo, _mm_setr_pd(1., 2.));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_storeu2_m128i() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_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,
+ );
+ let mut hi = _mm_undefined_si128();
+ let mut lo = _mm_undefined_si128();
+ _mm256_storeu2_m128i(&mut hi as *mut _, &mut lo as *mut _, a);
+ #[rustfmt::skip]
+ let e_hi = _mm_setr_epi8(
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32
+ );
+ #[rustfmt::skip]
+ let e_lo = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16
+ );
+
+ assert_eq_m128i(hi, e_hi);
+ assert_eq_m128i(lo, e_lo);
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_cvtss_f32() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_cvtss_f32(a);
+ assert_eq!(r, 1.);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx2.rs b/library/stdarch/crates/core_arch/src/x86/avx2.rs
new file mode 100644
index 000000000..081609ece
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx2.rs
@@ -0,0 +1,5908 @@
+//! Advanced Vector Extensions 2 (AVX)
+//!
+//! AVX2 expands most AVX commands to 256-bit wide vector registers and
+//! adds [FMA](https://en.wikipedia.org/wiki/Fused_multiply-accumulate).
+//!
+//! The references are:
+//!
+//! - [Intel 64 and IA-32 Architectures Software Developer's Manual Volume 2:
+//! Instruction Set Reference, A-Z][intel64_ref].
+//! - [AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and
+//! System Instructions][amd64_ref].
+//!
+//! Wikipedia's [AVX][wiki_avx] and [FMA][wiki_fma] pages provide a quick
+//! overview of the instructions available.
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf
+//! [wiki_avx]: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions
+//! [wiki_fma]: https://en.wikipedia.org/wiki/Fused_multiply-accumulate
+
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Computes the absolute values of packed 32-bit integers in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_abs_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpabsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_abs_epi32(a: __m256i) -> __m256i {
+ transmute(pabsd(a.as_i32x8()))
+}
+
+/// Computes the absolute values of packed 16-bit integers in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_abs_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpabsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_abs_epi16(a: __m256i) -> __m256i {
+ transmute(pabsw(a.as_i16x16()))
+}
+
+/// Computes the absolute values of packed 8-bit integers in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_abs_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpabsb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_abs_epi8(a: __m256i) -> __m256i {
+ transmute(pabsb(a.as_i8x32()))
+}
+
+/// Adds packed 64-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_add_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpaddq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_add_epi64(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_add(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Adds packed 32-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_add_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpaddd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_add_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_add(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Adds packed 16-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_add_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpaddw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_add_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_add(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Adds packed 8-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_add_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpaddb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_add_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_add(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// Adds packed 8-bit integers in `a` and `b` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_adds_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpaddsb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_adds_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_saturating_add(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// Adds packed 16-bit integers in `a` and `b` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_adds_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpaddsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_adds_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_saturating_add(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Adds packed unsigned 8-bit integers in `a` and `b` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_adds_epu8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpaddusb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_adds_epu8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_saturating_add(a.as_u8x32(), b.as_u8x32()))
+}
+
+/// Adds packed unsigned 16-bit integers in `a` and `b` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_adds_epu16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpaddusw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_adds_epu16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_saturating_add(a.as_u16x16(), b.as_u16x16()))
+}
+
+/// Concatenates pairs of 16-byte blocks in `a` and `b` into a 32-byte temporary
+/// result, shifts the result right by `n` bytes, and returns the low 16 bytes.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_alignr_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 7))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_alignr_epi8<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ // If palignr is shifting the pair of vectors more than the size of two
+ // lanes, emit zero.
+ if IMM8 > 32 {
+ return _mm256_set1_epi8(0);
+ }
+ // If palignr is shifting the pair of input vectors more than one lane,
+ // but less than two lanes, convert to shifting in zeroes.
+ let (a, b) = if IMM8 > 16 {
+ (_mm256_set1_epi8(0), a)
+ } else {
+ (a, b)
+ };
+
+ let a = a.as_i8x32();
+ let b = b.as_i8x32();
+
+ let r: i8x32 = match IMM8 % 16 {
+ 0 => simd_shuffle32!(
+ 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,
+ ],
+ ),
+ 1 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 48,
+ ],
+ ),
+ 2 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 33, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 48, 49,
+ ],
+ ),
+ 3 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 33, 34, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 48, 49, 50,
+ ],
+ ),
+ 4 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 33, 34, 35, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 48, 49, 50, 51,
+ ],
+ ),
+ 5 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 33, 34, 35, 36, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 48, 49, 50, 51, 52,
+ ],
+ ),
+ 6 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 33, 34, 35, 36, 37, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 48, 49, 50, 51, 52, 53,
+ ],
+ ),
+ 7 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 33, 34, 35, 36, 37, 38, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 48, 49, 50, 51, 52, 53, 54,
+ ],
+ ),
+ 8 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 8, 9, 10, 11, 12, 13, 14, 15, 32, 33, 34, 35, 36, 37, 38, 39, 24, 25, 26, 27, 28,
+ 29, 30, 31, 48, 49, 50, 51, 52, 53, 54, 55,
+ ],
+ ),
+ 9 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 9, 10, 11, 12, 13, 14, 15, 32, 33, 34, 35, 36, 37, 38, 39, 40, 25, 26, 27, 28, 29,
+ 30, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ ],
+ ),
+ 10 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 10, 11, 12, 13, 14, 15, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 26, 27, 28, 29, 30,
+ 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ ],
+ ),
+ 11 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 11, 12, 13, 14, 15, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 27, 28, 29, 30, 31,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ ],
+ ),
+ 12 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 12, 13, 14, 15, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 28, 29, 30, 31, 48,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ ],
+ ),
+ 13 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 13, 14, 15, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 29, 30, 31, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ ],
+ ),
+ 14 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 14, 15, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 30, 31, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ ],
+ ),
+ 15 => simd_shuffle32!(
+ b,
+ a,
+ [
+ 15, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 31, 48, 49, 50, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+ ],
+ ),
+ _ => b,
+ };
+ transmute(r)
+}
+
+/// Computes the bitwise AND of 256 bits (representing integer data)
+/// in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_and_si256)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vandps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_and_si256(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_and(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Computes the bitwise NOT of 256 bits (representing integer data)
+/// in `a` and then AND with `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_andnot_si256)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vandnps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_andnot_si256(a: __m256i, b: __m256i) -> __m256i {
+ let all_ones = _mm256_set1_epi8(-1);
+ transmute(simd_and(
+ simd_xor(a.as_i64x4(), all_ones.as_i64x4()),
+ b.as_i64x4(),
+ ))
+}
+
+/// Averages packed unsigned 16-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_avg_epu16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpavgw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_avg_epu16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pavgw(a.as_u16x16(), b.as_u16x16()))
+}
+
+/// Averages packed unsigned 8-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_avg_epu8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpavgb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_avg_epu8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pavgb(a.as_u8x32(), b.as_u8x32()))
+}
+
+/// Blends packed 32-bit integers from `a` and `b` using control mask `IMM4`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_blend_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vblendps, IMM4 = 9))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_blend_epi32<const IMM4: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm4!(IMM4);
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ let r: i32x4 = simd_shuffle4!(
+ a,
+ b,
+ <const IMM4: i32> [
+ [0, 4, 0, 4][IMM4 as usize & 0b11],
+ [1, 1, 5, 5][IMM4 as usize & 0b11],
+ [2, 6, 2, 6][(IMM4 as usize >> 2) & 0b11],
+ [3, 3, 7, 7][(IMM4 as usize >> 2) & 0b11],
+ ],
+ );
+ transmute(r)
+}
+
+/// Blends packed 32-bit integers from `a` and `b` using control mask `IMM8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_blend_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vblendps, IMM8 = 9))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_blend_epi32<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x8();
+ let b = b.as_i32x8();
+ let r: i32x8 = simd_shuffle8!(
+ a,
+ b,
+ <const IMM8: i32> [
+ [0, 8, 0, 8][IMM8 as usize & 0b11],
+ [1, 1, 9, 9][IMM8 as usize & 0b11],
+ [2, 10, 2, 10][(IMM8 as usize >> 2) & 0b11],
+ [3, 3, 11, 11][(IMM8 as usize >> 2) & 0b11],
+ [4, 12, 4, 12][(IMM8 as usize >> 4) & 0b11],
+ [5, 5, 13, 13][(IMM8 as usize >> 4) & 0b11],
+ [6, 14, 6, 14][(IMM8 as usize >> 6) & 0b11],
+ [7, 7, 15, 15][(IMM8 as usize >> 6) & 0b11],
+ ],
+ );
+ transmute(r)
+}
+
+/// Blends packed 16-bit integers from `a` and `b` using control mask `IMM8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_blend_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpblendw, IMM8 = 9))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_blend_epi16<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i16x16();
+ let b = b.as_i16x16();
+
+ let r: i16x16 = simd_shuffle16!(
+ a,
+ b,
+ <const IMM8: i32> [
+ [0, 16, 0, 16][IMM8 as usize & 0b11],
+ [1, 1, 17, 17][IMM8 as usize & 0b11],
+ [2, 18, 2, 18][(IMM8 as usize >> 2) & 0b11],
+ [3, 3, 19, 19][(IMM8 as usize >> 2) & 0b11],
+ [4, 20, 4, 20][(IMM8 as usize >> 4) & 0b11],
+ [5, 5, 21, 21][(IMM8 as usize >> 4) & 0b11],
+ [6, 22, 6, 22][(IMM8 as usize >> 6) & 0b11],
+ [7, 7, 23, 23][(IMM8 as usize >> 6) & 0b11],
+ [8, 24, 8, 24][IMM8 as usize & 0b11],
+ [9, 9, 25, 25][IMM8 as usize & 0b11],
+ [10, 26, 10, 26][(IMM8 as usize >> 2) & 0b11],
+ [11, 11, 27, 27][(IMM8 as usize >> 2) & 0b11],
+ [12, 28, 12, 28][(IMM8 as usize >> 4) & 0b11],
+ [13, 13, 29, 29][(IMM8 as usize >> 4) & 0b11],
+ [14, 30, 14, 30][(IMM8 as usize >> 6) & 0b11],
+ [15, 15, 31, 31][(IMM8 as usize >> 6) & 0b11],
+ ],
+ );
+ transmute(r)
+}
+
+/// Blends packed 8-bit integers from `a` and `b` using `mask`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_blendv_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpblendvb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_blendv_epi8(a: __m256i, b: __m256i, mask: __m256i) -> __m256i {
+ transmute(pblendvb(a.as_i8x32(), b.as_i8x32(), mask.as_i8x32()))
+}
+
+/// Broadcasts the low packed 8-bit integer from `a` to all elements of
+/// the 128-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_broadcastb_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpbroadcastb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_broadcastb_epi8(a: __m128i) -> __m128i {
+ let zero = _mm_setzero_si128();
+ let ret = simd_shuffle16!(a.as_i8x16(), zero.as_i8x16(), [0_u32; 16]);
+ transmute::<i8x16, _>(ret)
+}
+
+/// Broadcasts the low packed 8-bit integer from `a` to all elements of
+/// the 256-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcastb_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpbroadcastb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_broadcastb_epi8(a: __m128i) -> __m256i {
+ let zero = _mm_setzero_si128();
+ let ret = simd_shuffle32!(a.as_i8x16(), zero.as_i8x16(), [0_u32; 32]);
+ transmute::<i8x32, _>(ret)
+}
+
+// N.B., `simd_shuffle4` with integer data types for `a` and `b` is
+// often compiled to `vbroadcastss`.
+/// Broadcasts the low packed 32-bit integer from `a` to all elements of
+/// the 128-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_broadcastd_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_broadcastd_epi32(a: __m128i) -> __m128i {
+ let zero = _mm_setzero_si128();
+ let ret = simd_shuffle4!(a.as_i32x4(), zero.as_i32x4(), [0_u32; 4]);
+ transmute::<i32x4, _>(ret)
+}
+
+// N.B., `simd_shuffle4`` with integer data types for `a` and `b` is
+// often compiled to `vbroadcastss`.
+/// Broadcasts the low packed 32-bit integer from `a` to all elements of
+/// the 256-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcastd_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_broadcastd_epi32(a: __m128i) -> __m256i {
+ let zero = _mm_setzero_si128();
+ let ret = simd_shuffle8!(a.as_i32x4(), zero.as_i32x4(), [0_u32; 8]);
+ transmute::<i32x8, _>(ret)
+}
+
+/// Broadcasts the low packed 64-bit integer from `a` to all elements of
+/// the 128-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_broadcastq_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+// FIXME: https://github.com/rust-lang/stdarch/issues/791
+#[cfg_attr(test, assert_instr(vmovddup))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_broadcastq_epi64(a: __m128i) -> __m128i {
+ let ret = simd_shuffle2!(a.as_i64x2(), a.as_i64x2(), [0_u32; 2]);
+ transmute::<i64x2, _>(ret)
+}
+
+/// Broadcasts the low packed 64-bit integer from `a` to all elements of
+/// the 256-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcastq_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vbroadcastsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_broadcastq_epi64(a: __m128i) -> __m256i {
+ let ret = simd_shuffle4!(a.as_i64x2(), a.as_i64x2(), [0_u32; 4]);
+ transmute::<i64x4, _>(ret)
+}
+
+/// Broadcasts the low double-precision (64-bit) floating-point element
+/// from `a` to all elements of the 128-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_broadcastsd_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vmovddup))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_broadcastsd_pd(a: __m128d) -> __m128d {
+ simd_shuffle2!(a, _mm_setzero_pd(), [0_u32; 2])
+}
+
+/// Broadcasts the low double-precision (64-bit) floating-point element
+/// from `a` to all elements of the 256-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcastsd_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vbroadcastsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_broadcastsd_pd(a: __m128d) -> __m256d {
+ simd_shuffle4!(a, _mm_setzero_pd(), [0_u32; 4])
+}
+
+// N.B., `broadcastsi128_si256` is often compiled to `vinsertf128` or
+// `vbroadcastf128`.
+/// Broadcasts 128 bits of integer data from a to all 128-bit lanes in
+/// the 256-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcastsi128_si256)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_broadcastsi128_si256(a: __m128i) -> __m256i {
+ let zero = _mm_setzero_si128();
+ let ret = simd_shuffle4!(a.as_i64x2(), zero.as_i64x2(), [0, 1, 0, 1]);
+ transmute::<i64x4, _>(ret)
+}
+
+/// Broadcasts the low single-precision (32-bit) floating-point element
+/// from `a` to all elements of the 128-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_broadcastss_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_broadcastss_ps(a: __m128) -> __m128 {
+ simd_shuffle4!(a, _mm_setzero_ps(), [0_u32; 4])
+}
+
+/// Broadcasts the low single-precision (32-bit) floating-point element
+/// from `a` to all elements of the 256-bit returned value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcastss_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_broadcastss_ps(a: __m128) -> __m256 {
+ simd_shuffle8!(a, _mm_setzero_ps(), [0_u32; 8])
+}
+
+/// Broadcasts the low packed 16-bit integer from a to all elements of
+/// the 128-bit returned value
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_broadcastw_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpbroadcastw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_broadcastw_epi16(a: __m128i) -> __m128i {
+ let zero = _mm_setzero_si128();
+ let ret = simd_shuffle8!(a.as_i16x8(), zero.as_i16x8(), [0_u32; 8]);
+ transmute::<i16x8, _>(ret)
+}
+
+/// Broadcasts the low packed 16-bit integer from a to all elements of
+/// the 256-bit returned value
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcastw_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpbroadcastw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_broadcastw_epi16(a: __m128i) -> __m256i {
+ let zero = _mm_setzero_si128();
+ let ret = simd_shuffle16!(a.as_i16x8(), zero.as_i16x8(), [0_u32; 16]);
+ transmute::<i16x16, _>(ret)
+}
+
+/// Compares packed 64-bit integers in `a` and `b` for equality.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpcmpeqq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cmpeq_epi64(a: __m256i, b: __m256i) -> __m256i {
+ transmute::<i64x4, _>(simd_eq(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compares packed 32-bit integers in `a` and `b` for equality.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpcmpeqd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cmpeq_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute::<i32x8, _>(simd_eq(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compares packed 16-bit integers in `a` and `b` for equality.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpcmpeqw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cmpeq_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute::<i16x16, _>(simd_eq(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Compares packed 8-bit integers in `a` and `b` for equality.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpcmpeqb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cmpeq_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute::<i8x32, _>(simd_eq(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// Compares packed 64-bit integers in `a` and `b` for greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpcmpgtq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cmpgt_epi64(a: __m256i, b: __m256i) -> __m256i {
+ transmute::<i64x4, _>(simd_gt(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compares packed 32-bit integers in `a` and `b` for greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpcmpgtd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cmpgt_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute::<i32x8, _>(simd_gt(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compares packed 16-bit integers in `a` and `b` for greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpcmpgtw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cmpgt_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute::<i16x16, _>(simd_gt(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Compares packed 8-bit integers in `a` and `b` for greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpcmpgtb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cmpgt_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute::<i8x32, _>(simd_gt(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// Sign-extend 16-bit integers to 32-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi16_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovsxwd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepi16_epi32(a: __m128i) -> __m256i {
+ transmute::<i32x8, _>(simd_cast(a.as_i16x8()))
+}
+
+/// Sign-extend 16-bit integers to 64-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi16_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovsxwq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepi16_epi64(a: __m128i) -> __m256i {
+ let a = a.as_i16x8();
+ let v64: i16x4 = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ transmute::<i64x4, _>(simd_cast(v64))
+}
+
+/// Sign-extend 32-bit integers to 64-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi32_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovsxdq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepi32_epi64(a: __m128i) -> __m256i {
+ transmute::<i64x4, _>(simd_cast(a.as_i32x4()))
+}
+
+/// Sign-extend 8-bit integers to 16-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi8_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovsxbw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepi8_epi16(a: __m128i) -> __m256i {
+ transmute::<i16x16, _>(simd_cast(a.as_i8x16()))
+}
+
+/// Sign-extend 8-bit integers to 32-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi8_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovsxbd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepi8_epi32(a: __m128i) -> __m256i {
+ let a = a.as_i8x16();
+ let v64: i8x8 = simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]);
+ transmute::<i32x8, _>(simd_cast(v64))
+}
+
+/// Sign-extend 8-bit integers to 64-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi8_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovsxbq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepi8_epi64(a: __m128i) -> __m256i {
+ let a = a.as_i8x16();
+ let v32: i8x4 = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ transmute::<i64x4, _>(simd_cast(v32))
+}
+
+/// Zeroes extend packed unsigned 16-bit integers in `a` to packed 32-bit
+/// integers, and stores the results in `dst`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepu16_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovzxwd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepu16_epi32(a: __m128i) -> __m256i {
+ transmute::<i32x8, _>(simd_cast(a.as_u16x8()))
+}
+
+/// Zero-extend the lower four unsigned 16-bit integers in `a` to 64-bit
+/// integers. The upper four elements of `a` are unused.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepu16_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovzxwq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepu16_epi64(a: __m128i) -> __m256i {
+ let a = a.as_u16x8();
+ let v64: u16x4 = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ transmute::<i64x4, _>(simd_cast(v64))
+}
+
+/// Zero-extend unsigned 32-bit integers in `a` to 64-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepu32_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovzxdq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepu32_epi64(a: __m128i) -> __m256i {
+ transmute::<i64x4, _>(simd_cast(a.as_u32x4()))
+}
+
+/// Zero-extend unsigned 8-bit integers in `a` to 16-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepu8_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovzxbw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepu8_epi16(a: __m128i) -> __m256i {
+ transmute::<i16x16, _>(simd_cast(a.as_u8x16()))
+}
+
+/// Zero-extend the lower eight unsigned 8-bit integers in `a` to 32-bit
+/// integers. The upper eight elements of `a` are unused.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepu8_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovzxbd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepu8_epi32(a: __m128i) -> __m256i {
+ let a = a.as_u8x16();
+ let v64: u8x8 = simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]);
+ transmute::<i32x8, _>(simd_cast(v64))
+}
+
+/// Zero-extend the lower four unsigned 8-bit integers in `a` to 64-bit
+/// integers. The upper twelve elements of `a` are unused.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepu8_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovzxbq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtepu8_epi64(a: __m128i) -> __m256i {
+ let a = a.as_u8x16();
+ let v32: u8x4 = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ transmute::<i64x4, _>(simd_cast(v32))
+}
+
+/// Extracts 128 bits (of integer data) from `a` selected with `IMM1`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extracti128_si256)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf128, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_extracti128_si256<const IMM1: i32>(a: __m256i) -> __m128i {
+ static_assert_imm1!(IMM1);
+ let a = a.as_i64x4();
+ let b = _mm256_undefined_si256().as_i64x4();
+ let dst: i64x2 = simd_shuffle2!(a, b, <const IMM1: i32> [[0, 1], [2, 3]][IMM1 as usize]);
+ transmute(dst)
+}
+
+/// Horizontally adds adjacent pairs of 16-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hadd_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vphaddw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_hadd_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(phaddw(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Horizontally adds adjacent pairs of 32-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hadd_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vphaddd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_hadd_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(phaddd(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Horizontally adds adjacent pairs of 16-bit integers in `a` and `b`
+/// using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hadds_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vphaddsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_hadds_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(phaddsw(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Horizontally subtract adjacent pairs of 16-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hsub_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vphsubw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_hsub_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(phsubw(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Horizontally subtract adjacent pairs of 32-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hsub_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vphsubd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_hsub_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(phsubd(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Horizontally subtract adjacent pairs of 16-bit integers in `a` and `b`
+/// using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hsubs_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vphsubsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_hsubs_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(phsubsw(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_i32gather_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherdd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_i32gather_epi32<const SCALE: i32>(
+ slice: *const i32,
+ offsets: __m128i,
+) -> __m128i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm_setzero_si128().as_i32x4();
+ let neg_one = _mm_set1_epi32(-1).as_i32x4();
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ let r = pgatherdd(zero, slice, offsets, neg_one, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i32gather_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherdd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mask_i32gather_epi32<const SCALE: i32>(
+ src: __m128i,
+ slice: *const i32,
+ offsets: __m128i,
+ mask: __m128i,
+) -> __m128i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i32x4();
+ let mask = mask.as_i32x4();
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ let r = pgatherdd(src, slice, offsets, mask, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_i32gather_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherdd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_i32gather_epi32<const SCALE: i32>(
+ slice: *const i32,
+ offsets: __m256i,
+) -> __m256i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ let neg_one = _mm256_set1_epi32(-1).as_i32x8();
+ let offsets = offsets.as_i32x8();
+ let slice = slice as *const i8;
+ let r = vpgatherdd(zero, slice, offsets, neg_one, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i32gather_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherdd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mask_i32gather_epi32<const SCALE: i32>(
+ src: __m256i,
+ slice: *const i32,
+ offsets: __m256i,
+ mask: __m256i,
+) -> __m256i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i32x8();
+ let mask = mask.as_i32x8();
+ let offsets = offsets.as_i32x8();
+ let slice = slice as *const i8;
+ let r = vpgatherdd(src, slice, offsets, mask, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_i32gather_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherdps, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_i32gather_ps<const SCALE: i32>(slice: *const f32, offsets: __m128i) -> __m128 {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm_setzero_ps();
+ let neg_one = _mm_set1_ps(-1.0);
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ pgatherdps(zero, slice, offsets, neg_one, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i32gather_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherdps, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mask_i32gather_ps<const SCALE: i32>(
+ src: __m128,
+ slice: *const f32,
+ offsets: __m128i,
+ mask: __m128,
+) -> __m128 {
+ static_assert_imm8_scale!(SCALE);
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ pgatherdps(src, slice, offsets, mask, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_i32gather_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherdps, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_i32gather_ps<const SCALE: i32>(slice: *const f32, offsets: __m256i) -> __m256 {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm256_setzero_ps();
+ let neg_one = _mm256_set1_ps(-1.0);
+ let offsets = offsets.as_i32x8();
+ let slice = slice as *const i8;
+ vpgatherdps(zero, slice, offsets, neg_one, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i32gather_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherdps, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mask_i32gather_ps<const SCALE: i32>(
+ src: __m256,
+ slice: *const f32,
+ offsets: __m256i,
+ mask: __m256,
+) -> __m256 {
+ static_assert_imm8_scale!(SCALE);
+ let offsets = offsets.as_i32x8();
+ let slice = slice as *const i8;
+ vpgatherdps(src, slice, offsets, mask, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_i32gather_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherdq, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_i32gather_epi64<const SCALE: i32>(
+ slice: *const i64,
+ offsets: __m128i,
+) -> __m128i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm_setzero_si128().as_i64x2();
+ let neg_one = _mm_set1_epi64x(-1).as_i64x2();
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ let r = pgatherdq(zero, slice, offsets, neg_one, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i32gather_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherdq, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mask_i32gather_epi64<const SCALE: i32>(
+ src: __m128i,
+ slice: *const i64,
+ offsets: __m128i,
+ mask: __m128i,
+) -> __m128i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i64x2();
+ let mask = mask.as_i64x2();
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ let r = pgatherdq(src, slice, offsets, mask, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 and 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_i32gather_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherdq, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_i32gather_epi64<const SCALE: i32>(
+ slice: *const i64,
+ offsets: __m128i,
+) -> __m256i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ let neg_one = _mm256_set1_epi64x(-1).as_i64x4();
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ let r = vpgatherdq(zero, slice, offsets, neg_one, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i32gather_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherdq, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mask_i32gather_epi64<const SCALE: i32>(
+ src: __m256i,
+ slice: *const i64,
+ offsets: __m128i,
+ mask: __m256i,
+) -> __m256i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i64x4();
+ let mask = mask.as_i64x4();
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ let r = vpgatherdq(src, slice, offsets, mask, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_i32gather_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherdpd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_i32gather_pd<const SCALE: i32>(slice: *const f64, offsets: __m128i) -> __m128d {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm_setzero_pd();
+ let neg_one = _mm_set1_pd(-1.0);
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ pgatherdpd(zero, slice, offsets, neg_one, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i32gather_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherdpd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mask_i32gather_pd<const SCALE: i32>(
+ src: __m128d,
+ slice: *const f64,
+ offsets: __m128i,
+ mask: __m128d,
+) -> __m128d {
+ static_assert_imm8_scale!(SCALE);
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ pgatherdpd(src, slice, offsets, mask, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_i32gather_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherdpd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_i32gather_pd<const SCALE: i32>(
+ slice: *const f64,
+ offsets: __m128i,
+) -> __m256d {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm256_setzero_pd();
+ let neg_one = _mm256_set1_pd(-1.0);
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ vpgatherdpd(zero, slice, offsets, neg_one, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i32gather_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherdpd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mask_i32gather_pd<const SCALE: i32>(
+ src: __m256d,
+ slice: *const f64,
+ offsets: __m128i,
+ mask: __m256d,
+) -> __m256d {
+ static_assert_imm8_scale!(SCALE);
+ let offsets = offsets.as_i32x4();
+ let slice = slice as *const i8;
+ vpgatherdpd(src, slice, offsets, mask, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_i64gather_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherqd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_i64gather_epi32<const SCALE: i32>(
+ slice: *const i32,
+ offsets: __m128i,
+) -> __m128i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm_setzero_si128().as_i32x4();
+ let neg_one = _mm_set1_epi64x(-1).as_i32x4();
+ let offsets = offsets.as_i64x2();
+ let slice = slice as *const i8;
+ let r = pgatherqd(zero, slice, offsets, neg_one, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i64gather_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherqd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mask_i64gather_epi32<const SCALE: i32>(
+ src: __m128i,
+ slice: *const i32,
+ offsets: __m128i,
+ mask: __m128i,
+) -> __m128i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i32x4();
+ let mask = mask.as_i32x4();
+ let offsets = offsets.as_i64x2();
+ let slice = slice as *const i8;
+ let r = pgatherqd(src, slice, offsets, mask, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_i64gather_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherqd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_i64gather_epi32<const SCALE: i32>(
+ slice: *const i32,
+ offsets: __m256i,
+) -> __m128i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm_setzero_si128().as_i32x4();
+ let neg_one = _mm_set1_epi64x(-1).as_i32x4();
+ let offsets = offsets.as_i64x4();
+ let slice = slice as *const i8;
+ let r = vpgatherqd(zero, slice, offsets, neg_one, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i64gather_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherqd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mask_i64gather_epi32<const SCALE: i32>(
+ src: __m128i,
+ slice: *const i32,
+ offsets: __m256i,
+ mask: __m128i,
+) -> __m128i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i32x4();
+ let mask = mask.as_i32x4();
+ let offsets = offsets.as_i64x4();
+ let slice = slice as *const i8;
+ let r = vpgatherqd(src, slice, offsets, mask, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_i64gather_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherqps, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_i64gather_ps<const SCALE: i32>(slice: *const f32, offsets: __m128i) -> __m128 {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm_setzero_ps();
+ let neg_one = _mm_set1_ps(-1.0);
+ let offsets = offsets.as_i64x2();
+ let slice = slice as *const i8;
+ pgatherqps(zero, slice, offsets, neg_one, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i64gather_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherqps, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mask_i64gather_ps<const SCALE: i32>(
+ src: __m128,
+ slice: *const f32,
+ offsets: __m128i,
+ mask: __m128,
+) -> __m128 {
+ static_assert_imm8_scale!(SCALE);
+ let offsets = offsets.as_i64x2();
+ let slice = slice as *const i8;
+ pgatherqps(src, slice, offsets, mask, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_i64gather_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherqps, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_i64gather_ps<const SCALE: i32>(slice: *const f32, offsets: __m256i) -> __m128 {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm_setzero_ps();
+ let neg_one = _mm_set1_ps(-1.0);
+ let offsets = offsets.as_i64x4();
+ let slice = slice as *const i8;
+ vpgatherqps(zero, slice, offsets, neg_one, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i64gather_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherqps, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mask_i64gather_ps<const SCALE: i32>(
+ src: __m128,
+ slice: *const f32,
+ offsets: __m256i,
+ mask: __m128,
+) -> __m128 {
+ static_assert_imm8_scale!(SCALE);
+ let offsets = offsets.as_i64x4();
+ let slice = slice as *const i8;
+ vpgatherqps(src, slice, offsets, mask, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_i64gather_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherqq, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_i64gather_epi64<const SCALE: i32>(
+ slice: *const i64,
+ offsets: __m128i,
+) -> __m128i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm_setzero_si128().as_i64x2();
+ let neg_one = _mm_set1_epi64x(-1).as_i64x2();
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x2();
+ let r = pgatherqq(zero, slice, offsets, neg_one, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i64gather_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherqq, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mask_i64gather_epi64<const SCALE: i32>(
+ src: __m128i,
+ slice: *const i64,
+ offsets: __m128i,
+ mask: __m128i,
+) -> __m128i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i64x2();
+ let mask = mask.as_i64x2();
+ let offsets = offsets.as_i64x2();
+ let slice = slice as *const i8;
+ let r = pgatherqq(src, slice, offsets, mask, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_i64gather_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherqq, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_i64gather_epi64<const SCALE: i32>(
+ slice: *const i64,
+ offsets: __m256i,
+) -> __m256i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ let neg_one = _mm256_set1_epi64x(-1).as_i64x4();
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x4();
+ let r = vpgatherqq(zero, slice, offsets, neg_one, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i64gather_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpgatherqq, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mask_i64gather_epi64<const SCALE: i32>(
+ src: __m256i,
+ slice: *const i64,
+ offsets: __m256i,
+ mask: __m256i,
+) -> __m256i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i64x4();
+ let mask = mask.as_i64x4();
+ let offsets = offsets.as_i64x4();
+ let slice = slice as *const i8;
+ let r = vpgatherqq(src, slice, offsets, mask, SCALE as i8);
+ transmute(r)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_i64gather_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherqpd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_i64gather_pd<const SCALE: i32>(slice: *const f64, offsets: __m128i) -> __m128d {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm_setzero_pd();
+ let neg_one = _mm_set1_pd(-1.0);
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x2();
+ pgatherqpd(zero, slice, offsets, neg_one, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i64gather_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherqpd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mask_i64gather_pd<const SCALE: i32>(
+ src: __m128d,
+ slice: *const f64,
+ offsets: __m128i,
+ mask: __m128d,
+) -> __m128d {
+ static_assert_imm8_scale!(SCALE);
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x2();
+ pgatherqpd(src, slice, offsets, mask, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_i64gather_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherqpd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_i64gather_pd<const SCALE: i32>(
+ slice: *const f64,
+ offsets: __m256i,
+) -> __m256d {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm256_setzero_pd();
+ let neg_one = _mm256_set1_pd(-1.0);
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x4();
+ vpgatherqpd(zero, slice, offsets, neg_one, SCALE as i8)
+}
+
+/// Returns values from `slice` at offsets determined by `offsets * scale`,
+/// where
+/// `scale` should be 1, 2, 4 or 8. If mask is set, load the value from `src` in
+/// that position instead.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i64gather_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vgatherqpd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mask_i64gather_pd<const SCALE: i32>(
+ src: __m256d,
+ slice: *const f64,
+ offsets: __m256i,
+ mask: __m256d,
+) -> __m256d {
+ static_assert_imm8_scale!(SCALE);
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x4();
+ vpgatherqpd(src, slice, offsets, mask, SCALE as i8)
+}
+
+/// Copies `a` to `dst`, then insert 128 bits (of integer data) from `b` at the
+/// location specified by `IMM1`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_inserti128_si256)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vinsertf128, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_inserti128_si256<const IMM1: i32>(a: __m256i, b: __m128i) -> __m256i {
+ static_assert_imm1!(IMM1);
+ let a = a.as_i64x4();
+ let b = _mm256_castsi128_si256(b).as_i64x4();
+ let dst: i64x4 =
+ simd_shuffle4!(a, b, <const IMM1: i32> [[4, 5, 2, 3], [0, 1, 4, 5]][IMM1 as usize]);
+ transmute(dst)
+}
+
+/// Multiplies packed signed 16-bit integers in `a` and `b`, producing
+/// intermediate signed 32-bit integers. Horizontally add adjacent pairs
+/// of intermediate 32-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_madd_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaddwd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_madd_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmaddwd(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Vertically multiplies each unsigned 8-bit integer from `a` with the
+/// corresponding signed 8-bit integer from `b`, producing intermediate
+/// signed 16-bit integers. Horizontally add adjacent pairs of intermediate
+/// signed 16-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maddubs_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaddubsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_maddubs_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmaddubsw(a.as_u8x32(), b.as_u8x32()))
+}
+
+/// Loads packed 32-bit integers from memory pointed by `mem_addr` using `mask`
+/// (elements are zeroed out when the highest bit is not set in the
+/// corresponding element).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskload_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaskmovd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_maskload_epi32(mem_addr: *const i32, mask: __m128i) -> __m128i {
+ transmute(maskloadd(mem_addr as *const i8, mask.as_i32x4()))
+}
+
+/// Loads packed 32-bit integers from memory pointed by `mem_addr` using `mask`
+/// (elements are zeroed out when the highest bit is not set in the
+/// corresponding element).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskload_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaskmovd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_maskload_epi32(mem_addr: *const i32, mask: __m256i) -> __m256i {
+ transmute(maskloadd256(mem_addr as *const i8, mask.as_i32x8()))
+}
+
+/// Loads packed 64-bit integers from memory pointed by `mem_addr` using `mask`
+/// (elements are zeroed out when the highest bit is not set in the
+/// corresponding element).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskload_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaskmovq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_maskload_epi64(mem_addr: *const i64, mask: __m128i) -> __m128i {
+ transmute(maskloadq(mem_addr as *const i8, mask.as_i64x2()))
+}
+
+/// Loads packed 64-bit integers from memory pointed by `mem_addr` using `mask`
+/// (elements are zeroed out when the highest bit is not set in the
+/// corresponding element).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskload_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaskmovq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_maskload_epi64(mem_addr: *const i64, mask: __m256i) -> __m256i {
+ transmute(maskloadq256(mem_addr as *const i8, mask.as_i64x4()))
+}
+
+/// Stores packed 32-bit integers from `a` into memory pointed by `mem_addr`
+/// using `mask` (elements are not stored when the highest bit is not set
+/// in the corresponding element).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskstore_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaskmovd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_maskstore_epi32(mem_addr: *mut i32, mask: __m128i, a: __m128i) {
+ maskstored(mem_addr as *mut i8, mask.as_i32x4(), a.as_i32x4())
+}
+
+/// Stores packed 32-bit integers from `a` into memory pointed by `mem_addr`
+/// using `mask` (elements are not stored when the highest bit is not set
+/// in the corresponding element).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskstore_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaskmovd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_maskstore_epi32(mem_addr: *mut i32, mask: __m256i, a: __m256i) {
+ maskstored256(mem_addr as *mut i8, mask.as_i32x8(), a.as_i32x8())
+}
+
+/// Stores packed 64-bit integers from `a` into memory pointed by `mem_addr`
+/// using `mask` (elements are not stored when the highest bit is not set
+/// in the corresponding element).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskstore_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaskmovq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_maskstore_epi64(mem_addr: *mut i64, mask: __m128i, a: __m128i) {
+ maskstoreq(mem_addr as *mut i8, mask.as_i64x2(), a.as_i64x2())
+}
+
+/// Stores packed 64-bit integers from `a` into memory pointed by `mem_addr`
+/// using `mask` (elements are not stored when the highest bit is not set
+/// in the corresponding element).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskstore_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaskmovq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_maskstore_epi64(mem_addr: *mut i64, mask: __m256i, a: __m256i) {
+ maskstoreq256(mem_addr as *mut i8, mask.as_i64x4(), a.as_i64x4())
+}
+
+/// Compares packed 16-bit integers in `a` and `b`, and returns the packed
+/// maximum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_max_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaxsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_max_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmaxsw(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Compares packed 32-bit integers in `a` and `b`, and returns the packed
+/// maximum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_max_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaxsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_max_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmaxsd(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compares packed 8-bit integers in `a` and `b`, and returns the packed
+/// maximum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_max_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaxsb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_max_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmaxsb(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// Compares packed unsigned 16-bit integers in `a` and `b`, and returns
+/// the packed maximum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_max_epu16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaxuw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_max_epu16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmaxuw(a.as_u16x16(), b.as_u16x16()))
+}
+
+/// Compares packed unsigned 32-bit integers in `a` and `b`, and returns
+/// the packed maximum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_max_epu32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaxud))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_max_epu32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmaxud(a.as_u32x8(), b.as_u32x8()))
+}
+
+/// Compares packed unsigned 8-bit integers in `a` and `b`, and returns
+/// the packed maximum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_max_epu8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmaxub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_max_epu8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmaxub(a.as_u8x32(), b.as_u8x32()))
+}
+
+/// Compares packed 16-bit integers in `a` and `b`, and returns the packed
+/// minimum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_min_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpminsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_min_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pminsw(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Compares packed 32-bit integers in `a` and `b`, and returns the packed
+/// minimum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_min_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpminsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_min_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pminsd(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compares packed 8-bit integers in `a` and `b`, and returns the packed
+/// minimum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_min_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpminsb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_min_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pminsb(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// Compares packed unsigned 16-bit integers in `a` and `b`, and returns
+/// the packed minimum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_min_epu16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpminuw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_min_epu16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pminuw(a.as_u16x16(), b.as_u16x16()))
+}
+
+/// Compares packed unsigned 32-bit integers in `a` and `b`, and returns
+/// the packed minimum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_min_epu32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpminud))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_min_epu32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pminud(a.as_u32x8(), b.as_u32x8()))
+}
+
+/// Compares packed unsigned 8-bit integers in `a` and `b`, and returns
+/// the packed minimum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_min_epu8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpminub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_min_epu8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pminub(a.as_u8x32(), b.as_u8x32()))
+}
+
+/// Creates mask from the most significant bit of each 8-bit element in `a`,
+/// return the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_movemask_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmovmskb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_movemask_epi8(a: __m256i) -> i32 {
+ pmovmskb(a.as_i8x32())
+}
+
+/// Computes the sum of absolute differences (SADs) of quadruplets of unsigned
+/// 8-bit integers in `a` compared to those in `b`, and stores the 16-bit
+/// results in dst. Eight SADs are performed for each 128-bit lane using one
+/// quadruplet from `b` and eight quadruplets from `a`. One quadruplet is
+/// selected from `b` starting at on the offset specified in `imm8`. Eight
+/// quadruplets are formed from sequential 8-bit integers selected from `a`
+/// starting at the offset specified in `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mpsadbw_epu8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vmpsadbw, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mpsadbw_epu8<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(mpsadbw(a.as_u8x32(), b.as_u8x32(), IMM8))
+}
+
+/// Multiplies the low 32-bit integers from each packed 64-bit element in
+/// `a` and `b`
+///
+/// Returns the 64-bit results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mul_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmuldq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mul_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmuldq(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Multiplies the low unsigned 32-bit integers from each packed 64-bit
+/// element in `a` and `b`
+///
+/// Returns the unsigned 64-bit results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mul_epu32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmuludq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mul_epu32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmuludq(a.as_u32x8(), b.as_u32x8()))
+}
+
+/// Multiplies the packed 16-bit integers in `a` and `b`, producing
+/// intermediate 32-bit integers and returning the high 16 bits of the
+/// intermediate integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mulhi_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmulhw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mulhi_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmulhw(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Multiplies the packed unsigned 16-bit integers in `a` and `b`, producing
+/// intermediate 32-bit integers and returning the high 16 bits of the
+/// intermediate integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mulhi_epu16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmulhuw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mulhi_epu16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmulhuw(a.as_u16x16(), b.as_u16x16()))
+}
+
+/// Multiplies the packed 16-bit integers in `a` and `b`, producing
+/// intermediate 32-bit integers, and returns the low 16 bits of the
+/// intermediate integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mullo_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmullw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mullo_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_mul(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Multiplies the packed 32-bit integers in `a` and `b`, producing
+/// intermediate 64-bit integers, and returns the low 32 bits of the
+/// intermediate integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mullo_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmulld))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mullo_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_mul(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Multiplies packed 16-bit integers in `a` and `b`, producing
+/// intermediate signed 32-bit integers. Truncate each intermediate
+/// integer to the 18 most significant bits, round by adding 1, and
+/// return bits `[16:1]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mulhrs_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpmulhrsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_mulhrs_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pmulhrsw(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Computes the bitwise OR of 256 bits (representing integer data) in `a`
+/// and `b`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_or_si256)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_or_si256(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_or(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Converts packed 16-bit integers from `a` and `b` to packed 8-bit integers
+/// using signed saturation
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_packs_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpacksswb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_packs_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(packsswb(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Converts packed 32-bit integers from `a` and `b` to packed 16-bit integers
+/// using signed saturation
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_packs_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpackssdw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_packs_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(packssdw(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Converts packed 16-bit integers from `a` and `b` to packed 8-bit integers
+/// using unsigned saturation
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_packus_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpackuswb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_packus_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(packuswb(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Converts packed 32-bit integers from `a` and `b` to packed 16-bit integers
+/// using unsigned saturation
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_packus_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpackusdw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_packus_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(packusdw(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Permutes packed 32-bit integers from `a` according to the content of `b`.
+///
+/// The last 3 bits of each integer of `b` are used as addresses into the 8
+/// integers of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutevar8x32_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpermps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permutevar8x32_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(permd(a.as_u32x8(), b.as_u32x8()))
+}
+
+/// Permutes 64-bit integers from `a` using control mask `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permute4x64_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpermpd, IMM8 = 9))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permute4x64_epi64<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ let r: i64x4 = simd_shuffle4!(
+ a.as_i64x4(),
+ zero,
+ <const IMM8: i32> [
+ IMM8 as u32 & 0b11,
+ (IMM8 as u32 >> 2) & 0b11,
+ (IMM8 as u32 >> 4) & 0b11,
+ (IMM8 as u32 >> 6) & 0b11,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffles 128-bits of integer data selected by `imm8` from `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permute2x128_si256)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vperm2f128, IMM8 = 9))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permute2x128_si256<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(vperm2i128(a.as_i64x4(), b.as_i64x4(), IMM8 as i8))
+}
+
+/// Shuffles 64-bit floating-point elements in `a` across lanes using the
+/// control in `imm8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permute4x64_pd)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpermpd, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permute4x64_pd<const IMM8: i32>(a: __m256d) -> __m256d {
+ static_assert_imm8!(IMM8);
+ simd_shuffle4!(
+ a,
+ _mm256_undefined_pd(),
+ <const IMM8: i32> [
+ IMM8 as u32 & 0b11,
+ (IMM8 as u32 >> 2) & 0b11,
+ (IMM8 as u32 >> 4) & 0b11,
+ (IMM8 as u32 >> 6) & 0b11,
+ ],
+ )
+}
+
+/// Shuffles eight 32-bit foating-point elements in `a` across lanes using
+/// the corresponding 32-bit integer index in `idx`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutevar8x32_ps)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpermps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_permutevar8x32_ps(a: __m256, idx: __m256i) -> __m256 {
+ permps(a, idx.as_i32x8())
+}
+
+/// Computes the absolute differences of packed unsigned 8-bit integers in `a`
+/// and `b`, then horizontally sum each consecutive 8 differences to
+/// produce four unsigned 16-bit integers, and pack these unsigned 16-bit
+/// integers in the low 16 bits of the 64-bit return value
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sad_epu8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsadbw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sad_epu8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(psadbw(a.as_u8x32(), b.as_u8x32()))
+}
+
+/// Shuffles bytes from `a` according to the content of `b`.
+///
+/// For each of the 128-bit low and high halves of the vectors, the last
+/// 4 bits of each byte of `b` are used as addresses into the respective
+/// low or high 16 bytes of `a`. That is, the halves are shuffled separately.
+///
+/// In addition, if the highest significant bit of a byte of `b` is set, the
+/// respective destination byte is set to 0.
+///
+/// Picturing `a` and `b` as `[u8; 32]`, `_mm256_shuffle_epi8` is logically
+/// equivalent to:
+///
+/// ```
+/// fn mm256_shuffle_epi8(a: [u8; 32], b: [u8; 32]) -> [u8; 32] {
+/// let mut r = [0; 32];
+/// for i in 0..16 {
+/// // if the most significant bit of b is set,
+/// // then the destination byte is set to 0.
+/// if b[i] & 0x80 == 0u8 {
+/// r[i] = a[(b[i] % 16) as usize];
+/// }
+/// if b[i + 16] & 0x80 == 0u8 {
+/// r[i + 16] = a[(b[i + 16] % 16 + 16) as usize];
+/// }
+/// }
+/// r
+/// }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shuffle_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpshufb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_shuffle_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(pshufb(a.as_u8x32(), b.as_u8x32()))
+}
+
+/// Shuffles 32-bit integers in 128-bit lanes of `a` using the control in
+/// `imm8`.
+///
+/// ```rust
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("avx2") {
+/// # #[target_feature(enable = "avx2")]
+/// # unsafe fn worker() {
+/// let a = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+///
+/// let c1 = _mm256_shuffle_epi32(a, 0b00_11_10_01);
+/// let c2 = _mm256_shuffle_epi32(a, 0b01_00_10_11);
+///
+/// let expected1 = _mm256_setr_epi32(1, 2, 3, 0, 5, 6, 7, 4);
+/// let expected2 = _mm256_setr_epi32(3, 2, 0, 1, 7, 6, 4, 5);
+///
+/// assert_eq!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(c1, expected1)), !0);
+/// assert_eq!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(c2, expected2)), !0);
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shuffle_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpermilps, MASK = 9))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_shuffle_epi32<const MASK: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(MASK);
+ let r: i32x8 = simd_shuffle8!(
+ a.as_i32x8(),
+ a.as_i32x8(),
+ <const MASK: i32> [
+ MASK as u32 & 0b11,
+ (MASK as u32 >> 2) & 0b11,
+ (MASK as u32 >> 4) & 0b11,
+ (MASK as u32 >> 6) & 0b11,
+ (MASK as u32 & 0b11) + 4,
+ ((MASK as u32 >> 2) & 0b11) + 4,
+ ((MASK as u32 >> 4) & 0b11) + 4,
+ ((MASK as u32 >> 6) & 0b11) + 4,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffles 16-bit integers in the high 64 bits of 128-bit lanes of `a` using
+/// the control in `imm8`. The low 64 bits of 128-bit lanes of `a` are copied
+/// to the output.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shufflehi_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 9))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_shufflehi_epi16<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i16x16();
+ let r: i16x16 = simd_shuffle16!(
+ a,
+ a,
+ <const IMM8: i32> [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4 + (IMM8 as u32 & 0b11),
+ 4 + ((IMM8 as u32 >> 2) & 0b11),
+ 4 + ((IMM8 as u32 >> 4) & 0b11),
+ 4 + ((IMM8 as u32 >> 6) & 0b11),
+ 8,
+ 9,
+ 10,
+ 11,
+ 12 + (IMM8 as u32 & 0b11),
+ 12 + ((IMM8 as u32 >> 2) & 0b11),
+ 12 + ((IMM8 as u32 >> 4) & 0b11),
+ 12 + ((IMM8 as u32 >> 6) & 0b11),
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffles 16-bit integers in the low 64 bits of 128-bit lanes of `a` using
+/// the control in `imm8`. The high 64 bits of 128-bit lanes of `a` are copied
+/// to the output.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shufflelo_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 9))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_shufflelo_epi16<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i16x16();
+ let r: i16x16 = simd_shuffle16!(
+ a,
+ a,
+ <const IMM8: i32> [
+ 0 + (IMM8 as u32 & 0b11),
+ 0 + ((IMM8 as u32 >> 2) & 0b11),
+ 0 + ((IMM8 as u32 >> 4) & 0b11),
+ 0 + ((IMM8 as u32 >> 6) & 0b11),
+ 4,
+ 5,
+ 6,
+ 7,
+ 8 + (IMM8 as u32 & 0b11),
+ 8 + ((IMM8 as u32 >> 2) & 0b11),
+ 8 + ((IMM8 as u32 >> 4) & 0b11),
+ 8 + ((IMM8 as u32 >> 6) & 0b11),
+ 12,
+ 13,
+ 14,
+ 15,
+ ],
+ );
+ transmute(r)
+}
+
+/// Negates packed 16-bit integers in `a` when the corresponding signed
+/// 16-bit integer in `b` is negative, and returns the results.
+/// Results are zeroed out when the corresponding element in `b` is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sign_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsignw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sign_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(psignw(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Negates packed 32-bit integers in `a` when the corresponding signed
+/// 32-bit integer in `b` is negative, and returns the results.
+/// Results are zeroed out when the corresponding element in `b` is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sign_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsignd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sign_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(psignd(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Negates packed 8-bit integers in `a` when the corresponding signed
+/// 8-bit integer in `b` is negative, and returns the results.
+/// Results are zeroed out when the corresponding element in `b` is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sign_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsignb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sign_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(psignb(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// Shifts packed 16-bit integers in `a` left by `count` while
+/// shifting in zeros, and returns the result
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sll_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsllw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sll_epi16(a: __m256i, count: __m128i) -> __m256i {
+ transmute(psllw(a.as_i16x16(), count.as_i16x8()))
+}
+
+/// Shifts packed 32-bit integers in `a` left by `count` while
+/// shifting in zeros, and returns the result
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sll_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpslld))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sll_epi32(a: __m256i, count: __m128i) -> __m256i {
+ transmute(pslld(a.as_i32x8(), count.as_i32x4()))
+}
+
+/// Shifts packed 64-bit integers in `a` left by `count` while
+/// shifting in zeros, and returns the result
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sll_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsllq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sll_epi64(a: __m256i, count: __m128i) -> __m256i {
+ transmute(psllq(a.as_i64x4(), count.as_i64x2()))
+}
+
+/// Shifts packed 16-bit integers in `a` left by `IMM8` while
+/// shifting in zeros, return the results;
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_slli_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsllw, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_slli_epi16<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(pslliw(a.as_i16x16(), IMM8))
+}
+
+/// Shifts packed 32-bit integers in `a` left by `IMM8` while
+/// shifting in zeros, return the results;
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_slli_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpslld, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_slli_epi32<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(psllid(a.as_i32x8(), IMM8))
+}
+
+/// Shifts packed 64-bit integers in `a` left by `IMM8` while
+/// shifting in zeros, return the results;
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_slli_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsllq, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_slli_epi64<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(pslliq(a.as_i64x4(), IMM8))
+}
+
+/// Shifts 128-bit lanes in `a` left by `imm8` bytes while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_slli_si256)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpslldq, IMM8 = 3))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_slli_si256<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ _mm256_bslli_epi128::<IMM8>(a)
+}
+
+/// Shifts 128-bit lanes in `a` left by `imm8` bytes while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_bslli_epi128)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpslldq, IMM8 = 3))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_bslli_epi128<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ const fn mask(shift: i32, i: u32) -> u32 {
+ let shift = shift as u32 & 0xff;
+ if shift > 15 || i % 16 < shift {
+ 0
+ } else {
+ 32 + (i - shift)
+ }
+ }
+ let a = a.as_i8x32();
+ let zero = _mm256_setzero_si256().as_i8x32();
+ let r: i8x32 = simd_shuffle32!(
+ zero,
+ a,
+ <const IMM8: i32> [
+ 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),
+ ],
+ );
+ transmute(r)
+}
+
+/// Shifts packed 32-bit integers in `a` left by the amount
+/// specified by the corresponding element in `count` while
+/// shifting in zeros, and returns the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sllv_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsllvd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sllv_epi32(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psllvd(a.as_i32x4(), count.as_i32x4()))
+}
+
+/// Shifts packed 32-bit integers in `a` left by the amount
+/// specified by the corresponding element in `count` while
+/// shifting in zeros, and returns the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sllv_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsllvd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sllv_epi32(a: __m256i, count: __m256i) -> __m256i {
+ transmute(psllvd256(a.as_i32x8(), count.as_i32x8()))
+}
+
+/// Shifts packed 64-bit integers in `a` left by the amount
+/// specified by the corresponding element in `count` while
+/// shifting in zeros, and returns the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sllv_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsllvq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sllv_epi64(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psllvq(a.as_i64x2(), count.as_i64x2()))
+}
+
+/// Shifts packed 64-bit integers in `a` left by the amount
+/// specified by the corresponding element in `count` while
+/// shifting in zeros, and returns the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sllv_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsllvq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sllv_epi64(a: __m256i, count: __m256i) -> __m256i {
+ transmute(psllvq256(a.as_i64x4(), count.as_i64x4()))
+}
+
+/// Shifts packed 16-bit integers in `a` right by `count` while
+/// shifting in sign bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sra_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsraw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sra_epi16(a: __m256i, count: __m128i) -> __m256i {
+ transmute(psraw(a.as_i16x16(), count.as_i16x8()))
+}
+
+/// Shifts packed 32-bit integers in `a` right by `count` while
+/// shifting in sign bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sra_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrad))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sra_epi32(a: __m256i, count: __m128i) -> __m256i {
+ transmute(psrad(a.as_i32x8(), count.as_i32x4()))
+}
+
+/// Shifts packed 16-bit integers in `a` right by `IMM8` while
+/// shifting in sign bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srai_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsraw, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srai_epi16<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(psraiw(a.as_i16x16(), IMM8))
+}
+
+/// Shifts packed 32-bit integers in `a` right by `IMM8` while
+/// shifting in sign bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srai_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrad, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srai_epi32<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(psraid(a.as_i32x8(), IMM8))
+}
+
+/// Shifts packed 32-bit integers in `a` right by the amount specified by the
+/// corresponding element in `count` while shifting in sign bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srav_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsravd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srav_epi32(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psravd(a.as_i32x4(), count.as_i32x4()))
+}
+
+/// Shifts packed 32-bit integers in `a` right by the amount specified by the
+/// corresponding element in `count` while shifting in sign bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srav_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsravd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srav_epi32(a: __m256i, count: __m256i) -> __m256i {
+ transmute(psravd256(a.as_i32x8(), count.as_i32x8()))
+}
+
+/// Shifts 128-bit lanes in `a` right by `imm8` bytes while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srli_si256)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrldq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srli_si256<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ _mm256_bsrli_epi128::<IMM8>(a)
+}
+
+/// Shifts 128-bit lanes in `a` right by `imm8` bytes while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_bsrli_epi128)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrldq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_bsrli_epi128<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i8x32();
+ let zero = _mm256_setzero_si256().as_i8x32();
+ let r: i8x32 = match IMM8 % 16 {
+ 0 => simd_shuffle32!(
+ 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,
+ ],
+ ),
+ 1 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ ],
+ ),
+ 2 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 32, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 32,
+ ],
+ ),
+ 3 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 32, 32, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 32, 32,
+ ],
+ ),
+ 4 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 32, 32, 32, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 32, 32, 32,
+ ],
+ ),
+ 5 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 32, 32, 32, 32, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 32, 32, 32, 32,
+ ],
+ ),
+ 6 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 32, 32, 32, 32, 32, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 32, 32, 32, 32, 32,
+ ],
+ ),
+ 7 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 32, 32, 32, 32, 32, 32, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 32, 32, 32, 32, 32, 32,
+ ],
+ ),
+ 8 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 8, 9, 10, 11, 12, 13, 14, 15, 32, 32, 32, 32, 32, 32, 32, 32, 24, 25, 26, 27, 28,
+ 29, 30, 31, 32, 32, 32, 32, 32, 32, 32, 32,
+ ],
+ ),
+ 9 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 9, 10, 11, 12, 13, 14, 15, 32, 32, 32, 32, 32, 32, 32, 32, 32, 25, 26, 27, 28, 29,
+ 30, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ ],
+ ),
+ 10 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 10, 11, 12, 13, 14, 15, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 26, 27, 28, 29, 30,
+ 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ ],
+ ),
+ 11 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 11, 12, 13, 14, 15, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 27, 28, 29, 30, 31,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ ],
+ ),
+ 12 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 12, 13, 14, 15, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 28, 29, 30, 31, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ ],
+ ),
+ 13 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 13, 14, 15, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 29, 30, 31, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ ],
+ ),
+ 14 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 14, 15, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 30, 31, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ ],
+ ),
+ 15 => simd_shuffle32!(
+ a,
+ zero,
+ [
+ 14, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 31, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ ],
+ ),
+ _ => zero,
+ };
+ transmute(r)
+}
+
+/// Shifts packed 16-bit integers in `a` right by `count` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srl_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrlw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srl_epi16(a: __m256i, count: __m128i) -> __m256i {
+ transmute(psrlw(a.as_i16x16(), count.as_i16x8()))
+}
+
+/// Shifts packed 32-bit integers in `a` right by `count` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srl_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrld))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srl_epi32(a: __m256i, count: __m128i) -> __m256i {
+ transmute(psrld(a.as_i32x8(), count.as_i32x4()))
+}
+
+/// Shifts packed 64-bit integers in `a` right by `count` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srl_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrlq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srl_epi64(a: __m256i, count: __m128i) -> __m256i {
+ transmute(psrlq(a.as_i64x4(), count.as_i64x2()))
+}
+
+/// Shifts packed 16-bit integers in `a` right by `IMM8` while shifting in
+/// zeros
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srli_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srli_epi16<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(psrliw(a.as_i16x16(), IMM8))
+}
+
+/// Shifts packed 32-bit integers in `a` right by `IMM8` while shifting in
+/// zeros
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srli_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrld, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srli_epi32<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(psrlid(a.as_i32x8(), IMM8))
+}
+
+/// Shifts packed 64-bit integers in `a` right by `IMM8` while shifting in
+/// zeros
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srli_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srli_epi64<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(psrliq(a.as_i64x4(), IMM8))
+}
+
+/// Shifts packed 32-bit integers in `a` right by the amount specified by
+/// the corresponding element in `count` while shifting in zeros,
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srlv_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrlvd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srlv_epi32(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psrlvd(a.as_i32x4(), count.as_i32x4()))
+}
+
+/// Shifts packed 32-bit integers in `a` right by the amount specified by
+/// the corresponding element in `count` while shifting in zeros,
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srlv_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrlvd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srlv_epi32(a: __m256i, count: __m256i) -> __m256i {
+ transmute(psrlvd256(a.as_i32x8(), count.as_i32x8()))
+}
+
+/// Shifts packed 64-bit integers in `a` right by the amount specified by
+/// the corresponding element in `count` while shifting in zeros,
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srlv_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrlvq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srlv_epi64(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psrlvq(a.as_i64x2(), count.as_i64x2()))
+}
+
+/// Shifts packed 64-bit integers in `a` right by the amount specified by
+/// the corresponding element in `count` while shifting in zeros,
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srlv_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsrlvq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_srlv_epi64(a: __m256i, count: __m256i) -> __m256i {
+ transmute(psrlvq256(a.as_i64x4(), count.as_i64x4()))
+}
+
+// TODO _mm256_stream_load_si256 (__m256i const* mem_addr)
+
+/// Subtract packed 16-bit integers in `b` from packed 16-bit integers in `a`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sub_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsubw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sub_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_sub(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Subtract packed 32-bit integers in `b` from packed 32-bit integers in `a`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sub_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsubd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sub_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_sub(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Subtract packed 64-bit integers in `b` from packed 64-bit integers in `a`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sub_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsubq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sub_epi64(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_sub(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Subtract packed 8-bit integers in `b` from packed 8-bit integers in `a`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sub_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsubb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_sub_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_sub(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// Subtract packed 16-bit integers in `b` from packed 16-bit integers in
+/// `a` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_subs_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsubsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_subs_epi16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_saturating_sub(a.as_i16x16(), b.as_i16x16()))
+}
+
+/// Subtract packed 8-bit integers in `b` from packed 8-bit integers in
+/// `a` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_subs_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsubsb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_subs_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_saturating_sub(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// Subtract packed unsigned 16-bit integers in `b` from packed 16-bit
+/// integers in `a` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_subs_epu16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsubusw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_subs_epu16(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_saturating_sub(a.as_u16x16(), b.as_u16x16()))
+}
+
+/// Subtract packed unsigned 8-bit integers in `b` from packed 8-bit
+/// integers in `a` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_subs_epu8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpsubusb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_subs_epu8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_saturating_sub(a.as_u8x32(), b.as_u8x32()))
+}
+
+/// Unpacks and interleave 8-bit integers from the high half of each
+/// 128-bit lane in `a` and `b`.
+///
+/// ```rust
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("avx2") {
+/// # #[target_feature(enable = "avx2")]
+/// # unsafe fn worker() {
+/// let a = _mm256_setr_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_setr_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 c = _mm256_unpackhi_epi8(a, b);
+///
+/// let expected = _mm256_setr_epi8(
+/// 8, -8, 9, -9, 10, -10, 11, -11, 12, -12, 13, -13, 14, -14, 15, -15,
+/// 24, -24, 25, -25, 26, -26, 27, -27, 28, -28, 29, -29, 30, -30, 31,
+/// -31,
+/// );
+/// assert_eq!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(c, expected)), !0);
+///
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpackhi_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpunpckhbw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpackhi_epi8(a: __m256i, b: __m256i) -> __m256i {
+ #[rustfmt::skip]
+ let r: i8x32 = simd_shuffle32!(a.as_i8x32(), b.as_i8x32(), [
+ 8, 40, 9, 41, 10, 42, 11, 43,
+ 12, 44, 13, 45, 14, 46, 15, 47,
+ 24, 56, 25, 57, 26, 58, 27, 59,
+ 28, 60, 29, 61, 30, 62, 31, 63,
+ ]);
+ transmute(r)
+}
+
+/// Unpacks and interleave 8-bit integers from the low half of each
+/// 128-bit lane of `a` and `b`.
+///
+/// ```rust
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("avx2") {
+/// # #[target_feature(enable = "avx2")]
+/// # unsafe fn worker() {
+/// let a = _mm256_setr_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_setr_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 c = _mm256_unpacklo_epi8(a, b);
+///
+/// let expected = _mm256_setr_epi8(
+/// 0, 0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, -6, 7, -7, 16, -16, 17,
+/// -17, 18, -18, 19, -19, 20, -20, 21, -21, 22, -22, 23, -23,
+/// );
+/// assert_eq!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(c, expected)), !0);
+///
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpacklo_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpunpcklbw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpacklo_epi8(a: __m256i, b: __m256i) -> __m256i {
+ #[rustfmt::skip]
+ let r: i8x32 = simd_shuffle32!(a.as_i8x32(), b.as_i8x32(), [
+ 0, 32, 1, 33, 2, 34, 3, 35,
+ 4, 36, 5, 37, 6, 38, 7, 39,
+ 16, 48, 17, 49, 18, 50, 19, 51,
+ 20, 52, 21, 53, 22, 54, 23, 55,
+ ]);
+ transmute(r)
+}
+
+/// Unpacks and interleave 16-bit integers from the high half of each
+/// 128-bit lane of `a` and `b`.
+///
+/// ```rust
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("avx2") {
+/// # #[target_feature(enable = "avx2")]
+/// # unsafe fn worker() {
+/// let a = _mm256_setr_epi16(
+/// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+/// );
+/// let b = _mm256_setr_epi16(
+/// 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15,
+/// );
+///
+/// let c = _mm256_unpackhi_epi16(a, b);
+///
+/// let expected = _mm256_setr_epi16(
+/// 4, -4, 5, -5, 6, -6, 7, -7, 12, -12, 13, -13, 14, -14, 15, -15,
+/// );
+/// assert_eq!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(c, expected)), !0);
+///
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpackhi_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpunpckhwd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpackhi_epi16(a: __m256i, b: __m256i) -> __m256i {
+ let r: i16x16 = simd_shuffle16!(
+ a.as_i16x16(),
+ b.as_i16x16(),
+ [4, 20, 5, 21, 6, 22, 7, 23, 12, 28, 13, 29, 14, 30, 15, 31],
+ );
+ transmute(r)
+}
+
+/// Unpacks and interleave 16-bit integers from the low half of each
+/// 128-bit lane of `a` and `b`.
+///
+/// ```rust
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("avx2") {
+/// # #[target_feature(enable = "avx2")]
+/// # unsafe fn worker() {
+///
+/// let a = _mm256_setr_epi16(
+/// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+/// );
+/// let b = _mm256_setr_epi16(
+/// 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15,
+/// );
+///
+/// let c = _mm256_unpacklo_epi16(a, b);
+///
+/// let expected = _mm256_setr_epi16(
+/// 0, 0, 1, -1, 2, -2, 3, -3, 8, -8, 9, -9, 10, -10, 11, -11,
+/// );
+/// assert_eq!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(c, expected)), !0);
+///
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpacklo_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vpunpcklwd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpacklo_epi16(a: __m256i, b: __m256i) -> __m256i {
+ let r: i16x16 = simd_shuffle16!(
+ a.as_i16x16(),
+ b.as_i16x16(),
+ [0, 16, 1, 17, 2, 18, 3, 19, 8, 24, 9, 25, 10, 26, 11, 27],
+ );
+ transmute(r)
+}
+
+/// Unpacks and interleave 32-bit integers from the high half of each
+/// 128-bit lane of `a` and `b`.
+///
+/// ```rust
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("avx2") {
+/// # #[target_feature(enable = "avx2")]
+/// # unsafe fn worker() {
+/// let a = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+/// let b = _mm256_setr_epi32(0, -1, -2, -3, -4, -5, -6, -7);
+///
+/// let c = _mm256_unpackhi_epi32(a, b);
+///
+/// let expected = _mm256_setr_epi32(2, -2, 3, -3, 6, -6, 7, -7);
+/// assert_eq!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(c, expected)), !0);
+///
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpackhi_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vunpckhps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpackhi_epi32(a: __m256i, b: __m256i) -> __m256i {
+ let r: i32x8 = simd_shuffle8!(a.as_i32x8(), b.as_i32x8(), [2, 10, 3, 11, 6, 14, 7, 15]);
+ transmute(r)
+}
+
+/// Unpacks and interleave 32-bit integers from the low half of each
+/// 128-bit lane of `a` and `b`.
+///
+/// ```rust
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("avx2") {
+/// # #[target_feature(enable = "avx2")]
+/// # unsafe fn worker() {
+/// let a = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+/// let b = _mm256_setr_epi32(0, -1, -2, -3, -4, -5, -6, -7);
+///
+/// let c = _mm256_unpacklo_epi32(a, b);
+///
+/// let expected = _mm256_setr_epi32(0, 0, 1, -1, 4, -4, 5, -5);
+/// assert_eq!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(c, expected)), !0);
+///
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpacklo_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vunpcklps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpacklo_epi32(a: __m256i, b: __m256i) -> __m256i {
+ let r: i32x8 = simd_shuffle8!(a.as_i32x8(), b.as_i32x8(), [0, 8, 1, 9, 4, 12, 5, 13]);
+ transmute(r)
+}
+
+/// Unpacks and interleave 64-bit integers from the high half of each
+/// 128-bit lane of `a` and `b`.
+///
+/// ```rust
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("avx2") {
+/// # #[target_feature(enable = "avx2")]
+/// # unsafe fn worker() {
+/// let a = _mm256_setr_epi64x(0, 1, 2, 3);
+/// let b = _mm256_setr_epi64x(0, -1, -2, -3);
+///
+/// let c = _mm256_unpackhi_epi64(a, b);
+///
+/// let expected = _mm256_setr_epi64x(1, -1, 3, -3);
+/// assert_eq!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(c, expected)), !0);
+///
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpackhi_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vunpckhpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpackhi_epi64(a: __m256i, b: __m256i) -> __m256i {
+ let r: i64x4 = simd_shuffle4!(a.as_i64x4(), b.as_i64x4(), [1, 5, 3, 7]);
+ transmute(r)
+}
+
+/// Unpacks and interleave 64-bit integers from the low half of each
+/// 128-bit lane of `a` and `b`.
+///
+/// ```rust
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("avx2") {
+/// # #[target_feature(enable = "avx2")]
+/// # unsafe fn worker() {
+/// let a = _mm256_setr_epi64x(0, 1, 2, 3);
+/// let b = _mm256_setr_epi64x(0, -1, -2, -3);
+///
+/// let c = _mm256_unpacklo_epi64(a, b);
+///
+/// let expected = _mm256_setr_epi64x(0, 0, 2, -2);
+/// assert_eq!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(c, expected)), !0);
+///
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_unpacklo_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vunpcklpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_unpacklo_epi64(a: __m256i, b: __m256i) -> __m256i {
+ let r: i64x4 = simd_shuffle4!(a.as_i64x4(), b.as_i64x4(), [0, 4, 2, 6]);
+ transmute(r)
+}
+
+/// Computes the bitwise XOR of 256 bits (representing integer data)
+/// in `a` and `b`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_xor_si256)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[cfg_attr(test, assert_instr(vxorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_xor_si256(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_xor(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Extracts an 8-bit integer from `a`, selected with `INDEX`. Returns a 32-bit
+/// integer containing the zero-extended integer data.
+///
+/// See [LLVM commit D20468](https://reviews.llvm.org/D20468).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extract_epi8)
+#[inline]
+#[target_feature(enable = "avx2")]
+// This intrinsic has no corresponding instruction.
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_extract_epi8<const INDEX: i32>(a: __m256i) -> i32 {
+ static_assert_imm5!(INDEX);
+ simd_extract::<_, u8>(a.as_u8x32(), INDEX as u32) as i32
+}
+
+/// Extracts a 16-bit integer from `a`, selected with `INDEX`. Returns a 32-bit
+/// integer containing the zero-extended integer data.
+///
+/// See [LLVM commit D20468](https://reviews.llvm.org/D20468).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extract_epi16)
+#[inline]
+#[target_feature(enable = "avx2")]
+// This intrinsic has no corresponding instruction.
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_extract_epi16<const INDEX: i32>(a: __m256i) -> i32 {
+ static_assert_imm4!(INDEX);
+ simd_extract::<_, u16>(a.as_u16x16(), INDEX as u32) as i32
+}
+
+/// Extracts a 32-bit integer from `a`, selected with `INDEX`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extract_epi32)
+#[inline]
+#[target_feature(enable = "avx2")]
+// This intrinsic has no corresponding instruction.
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_extract_epi32<const INDEX: i32>(a: __m256i) -> i32 {
+ static_assert_imm3!(INDEX);
+ simd_extract(a.as_i32x8(), INDEX as u32)
+}
+
+/// Returns the first element of the input vector of `[4 x double]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtsd_f64)
+#[inline]
+#[target_feature(enable = "avx2")]
+//#[cfg_attr(test, assert_instr(movsd))] FIXME
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtsd_f64(a: __m256d) -> f64 {
+ simd_extract(a, 0)
+}
+
+/// Returns the first element of the input vector of `[8 x i32]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtsi256_si32)
+#[inline]
+#[target_feature(enable = "avx2")]
+//#[cfg_attr(test, assert_instr(movd))] FIXME
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_cvtsi256_si32(a: __m256i) -> i32 {
+ simd_extract(a.as_i32x8(), 0)
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.avx2.pabs.b"]
+ fn pabsb(a: i8x32) -> u8x32;
+ #[link_name = "llvm.x86.avx2.pabs.w"]
+ fn pabsw(a: i16x16) -> u16x16;
+ #[link_name = "llvm.x86.avx2.pabs.d"]
+ fn pabsd(a: i32x8) -> u32x8;
+ #[link_name = "llvm.x86.avx2.pavg.b"]
+ fn pavgb(a: u8x32, b: u8x32) -> u8x32;
+ #[link_name = "llvm.x86.avx2.pavg.w"]
+ fn pavgw(a: u16x16, b: u16x16) -> u16x16;
+ #[link_name = "llvm.x86.avx2.pblendvb"]
+ fn pblendvb(a: i8x32, b: i8x32, mask: i8x32) -> i8x32;
+ #[link_name = "llvm.x86.avx2.phadd.w"]
+ fn phaddw(a: i16x16, b: i16x16) -> i16x16;
+ #[link_name = "llvm.x86.avx2.phadd.d"]
+ fn phaddd(a: i32x8, b: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx2.phadd.sw"]
+ fn phaddsw(a: i16x16, b: i16x16) -> i16x16;
+ #[link_name = "llvm.x86.avx2.phsub.w"]
+ fn phsubw(a: i16x16, b: i16x16) -> i16x16;
+ #[link_name = "llvm.x86.avx2.phsub.d"]
+ fn phsubd(a: i32x8, b: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx2.phsub.sw"]
+ fn phsubsw(a: i16x16, b: i16x16) -> i16x16;
+ #[link_name = "llvm.x86.avx2.pmadd.wd"]
+ fn pmaddwd(a: i16x16, b: i16x16) -> i32x8;
+ #[link_name = "llvm.x86.avx2.pmadd.ub.sw"]
+ fn pmaddubsw(a: u8x32, b: u8x32) -> i16x16;
+ #[link_name = "llvm.x86.avx2.maskload.d"]
+ fn maskloadd(mem_addr: *const i8, mask: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.avx2.maskload.d.256"]
+ fn maskloadd256(mem_addr: *const i8, mask: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx2.maskload.q"]
+ fn maskloadq(mem_addr: *const i8, mask: i64x2) -> i64x2;
+ #[link_name = "llvm.x86.avx2.maskload.q.256"]
+ fn maskloadq256(mem_addr: *const i8, mask: i64x4) -> i64x4;
+ #[link_name = "llvm.x86.avx2.maskstore.d"]
+ fn maskstored(mem_addr: *mut i8, mask: i32x4, a: i32x4);
+ #[link_name = "llvm.x86.avx2.maskstore.d.256"]
+ fn maskstored256(mem_addr: *mut i8, mask: i32x8, a: i32x8);
+ #[link_name = "llvm.x86.avx2.maskstore.q"]
+ fn maskstoreq(mem_addr: *mut i8, mask: i64x2, a: i64x2);
+ #[link_name = "llvm.x86.avx2.maskstore.q.256"]
+ fn maskstoreq256(mem_addr: *mut i8, mask: i64x4, a: i64x4);
+ #[link_name = "llvm.x86.avx2.pmaxs.w"]
+ fn pmaxsw(a: i16x16, b: i16x16) -> i16x16;
+ #[link_name = "llvm.x86.avx2.pmaxs.d"]
+ fn pmaxsd(a: i32x8, b: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx2.pmaxs.b"]
+ fn pmaxsb(a: i8x32, b: i8x32) -> i8x32;
+ #[link_name = "llvm.x86.avx2.pmaxu.w"]
+ fn pmaxuw(a: u16x16, b: u16x16) -> u16x16;
+ #[link_name = "llvm.x86.avx2.pmaxu.d"]
+ fn pmaxud(a: u32x8, b: u32x8) -> u32x8;
+ #[link_name = "llvm.x86.avx2.pmaxu.b"]
+ fn pmaxub(a: u8x32, b: u8x32) -> u8x32;
+ #[link_name = "llvm.x86.avx2.pmins.w"]
+ fn pminsw(a: i16x16, b: i16x16) -> i16x16;
+ #[link_name = "llvm.x86.avx2.pmins.d"]
+ fn pminsd(a: i32x8, b: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx2.pmins.b"]
+ fn pminsb(a: i8x32, b: i8x32) -> i8x32;
+ #[link_name = "llvm.x86.avx2.pminu.w"]
+ fn pminuw(a: u16x16, b: u16x16) -> u16x16;
+ #[link_name = "llvm.x86.avx2.pminu.d"]
+ fn pminud(a: u32x8, b: u32x8) -> u32x8;
+ #[link_name = "llvm.x86.avx2.pminu.b"]
+ fn pminub(a: u8x32, b: u8x32) -> u8x32;
+ #[link_name = "llvm.x86.avx2.pmovmskb"]
+ fn pmovmskb(a: i8x32) -> i32;
+ #[link_name = "llvm.x86.avx2.mpsadbw"]
+ fn mpsadbw(a: u8x32, b: u8x32, imm8: i32) -> u16x16;
+ #[link_name = "llvm.x86.avx2.pmulhu.w"]
+ fn pmulhuw(a: u16x16, b: u16x16) -> u16x16;
+ #[link_name = "llvm.x86.avx2.pmulh.w"]
+ fn pmulhw(a: i16x16, b: i16x16) -> i16x16;
+ #[link_name = "llvm.x86.avx2.pmul.dq"]
+ fn pmuldq(a: i32x8, b: i32x8) -> i64x4;
+ #[link_name = "llvm.x86.avx2.pmulu.dq"]
+ fn pmuludq(a: u32x8, b: u32x8) -> u64x4;
+ #[link_name = "llvm.x86.avx2.pmul.hr.sw"]
+ fn pmulhrsw(a: i16x16, b: i16x16) -> i16x16;
+ #[link_name = "llvm.x86.avx2.packsswb"]
+ fn packsswb(a: i16x16, b: i16x16) -> i8x32;
+ #[link_name = "llvm.x86.avx2.packssdw"]
+ fn packssdw(a: i32x8, b: i32x8) -> i16x16;
+ #[link_name = "llvm.x86.avx2.packuswb"]
+ fn packuswb(a: i16x16, b: i16x16) -> u8x32;
+ #[link_name = "llvm.x86.avx2.packusdw"]
+ fn packusdw(a: i32x8, b: i32x8) -> u16x16;
+ #[link_name = "llvm.x86.avx2.psad.bw"]
+ fn psadbw(a: u8x32, b: u8x32) -> u64x4;
+ #[link_name = "llvm.x86.avx2.psign.b"]
+ fn psignb(a: i8x32, b: i8x32) -> i8x32;
+ #[link_name = "llvm.x86.avx2.psign.w"]
+ fn psignw(a: i16x16, b: i16x16) -> i16x16;
+ #[link_name = "llvm.x86.avx2.psign.d"]
+ fn psignd(a: i32x8, b: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx2.psll.w"]
+ fn psllw(a: i16x16, count: i16x8) -> i16x16;
+ #[link_name = "llvm.x86.avx2.psll.d"]
+ fn pslld(a: i32x8, count: i32x4) -> i32x8;
+ #[link_name = "llvm.x86.avx2.psll.q"]
+ fn psllq(a: i64x4, count: i64x2) -> i64x4;
+ #[link_name = "llvm.x86.avx2.pslli.w"]
+ fn pslliw(a: i16x16, imm8: i32) -> i16x16;
+ #[link_name = "llvm.x86.avx2.pslli.d"]
+ fn psllid(a: i32x8, imm8: i32) -> i32x8;
+ #[link_name = "llvm.x86.avx2.pslli.q"]
+ fn pslliq(a: i64x4, imm8: i32) -> i64x4;
+ #[link_name = "llvm.x86.avx2.psllv.d"]
+ fn psllvd(a: i32x4, count: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.avx2.psllv.d.256"]
+ fn psllvd256(a: i32x8, count: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx2.psllv.q"]
+ fn psllvq(a: i64x2, count: i64x2) -> i64x2;
+ #[link_name = "llvm.x86.avx2.psllv.q.256"]
+ fn psllvq256(a: i64x4, count: i64x4) -> i64x4;
+ #[link_name = "llvm.x86.avx2.psra.w"]
+ fn psraw(a: i16x16, count: i16x8) -> i16x16;
+ #[link_name = "llvm.x86.avx2.psra.d"]
+ fn psrad(a: i32x8, count: i32x4) -> i32x8;
+ #[link_name = "llvm.x86.avx2.psrai.w"]
+ fn psraiw(a: i16x16, imm8: i32) -> i16x16;
+ #[link_name = "llvm.x86.avx2.psrai.d"]
+ fn psraid(a: i32x8, imm8: i32) -> i32x8;
+ #[link_name = "llvm.x86.avx2.psrav.d"]
+ fn psravd(a: i32x4, count: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.avx2.psrav.d.256"]
+ fn psravd256(a: i32x8, count: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx2.psrl.w"]
+ fn psrlw(a: i16x16, count: i16x8) -> i16x16;
+ #[link_name = "llvm.x86.avx2.psrl.d"]
+ fn psrld(a: i32x8, count: i32x4) -> i32x8;
+ #[link_name = "llvm.x86.avx2.psrl.q"]
+ fn psrlq(a: i64x4, count: i64x2) -> i64x4;
+ #[link_name = "llvm.x86.avx2.psrli.w"]
+ fn psrliw(a: i16x16, imm8: i32) -> i16x16;
+ #[link_name = "llvm.x86.avx2.psrli.d"]
+ fn psrlid(a: i32x8, imm8: i32) -> i32x8;
+ #[link_name = "llvm.x86.avx2.psrli.q"]
+ fn psrliq(a: i64x4, imm8: i32) -> i64x4;
+ #[link_name = "llvm.x86.avx2.psrlv.d"]
+ fn psrlvd(a: i32x4, count: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.avx2.psrlv.d.256"]
+ fn psrlvd256(a: i32x8, count: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx2.psrlv.q"]
+ fn psrlvq(a: i64x2, count: i64x2) -> i64x2;
+ #[link_name = "llvm.x86.avx2.psrlv.q.256"]
+ fn psrlvq256(a: i64x4, count: i64x4) -> i64x4;
+ #[link_name = "llvm.x86.avx2.pshuf.b"]
+ fn pshufb(a: u8x32, b: u8x32) -> u8x32;
+ #[link_name = "llvm.x86.avx2.permd"]
+ fn permd(a: u32x8, b: u32x8) -> u32x8;
+ #[link_name = "llvm.x86.avx2.permps"]
+ fn permps(a: __m256, b: i32x8) -> __m256;
+ #[link_name = "llvm.x86.avx2.vperm2i128"]
+ fn vperm2i128(a: i64x4, b: i64x4, imm8: i8) -> i64x4;
+ #[link_name = "llvm.x86.avx2.gather.d.d"]
+ fn pgatherdd(src: i32x4, slice: *const i8, offsets: i32x4, mask: i32x4, scale: i8) -> i32x4;
+ #[link_name = "llvm.x86.avx2.gather.d.d.256"]
+ fn vpgatherdd(src: i32x8, slice: *const i8, offsets: i32x8, mask: i32x8, scale: i8) -> i32x8;
+ #[link_name = "llvm.x86.avx2.gather.d.q"]
+ fn pgatherdq(src: i64x2, slice: *const i8, offsets: i32x4, mask: i64x2, scale: i8) -> i64x2;
+ #[link_name = "llvm.x86.avx2.gather.d.q.256"]
+ fn vpgatherdq(src: i64x4, slice: *const i8, offsets: i32x4, mask: i64x4, scale: i8) -> i64x4;
+ #[link_name = "llvm.x86.avx2.gather.q.d"]
+ fn pgatherqd(src: i32x4, slice: *const i8, offsets: i64x2, mask: i32x4, scale: i8) -> i32x4;
+ #[link_name = "llvm.x86.avx2.gather.q.d.256"]
+ fn vpgatherqd(src: i32x4, slice: *const i8, offsets: i64x4, mask: i32x4, scale: i8) -> i32x4;
+ #[link_name = "llvm.x86.avx2.gather.q.q"]
+ fn pgatherqq(src: i64x2, slice: *const i8, offsets: i64x2, mask: i64x2, scale: i8) -> i64x2;
+ #[link_name = "llvm.x86.avx2.gather.q.q.256"]
+ fn vpgatherqq(src: i64x4, slice: *const i8, offsets: i64x4, mask: i64x4, scale: i8) -> i64x4;
+ #[link_name = "llvm.x86.avx2.gather.d.pd"]
+ fn pgatherdpd(
+ src: __m128d,
+ slice: *const i8,
+ offsets: i32x4,
+ mask: __m128d,
+ scale: i8,
+ ) -> __m128d;
+ #[link_name = "llvm.x86.avx2.gather.d.pd.256"]
+ fn vpgatherdpd(
+ src: __m256d,
+ slice: *const i8,
+ offsets: i32x4,
+ mask: __m256d,
+ scale: i8,
+ ) -> __m256d;
+ #[link_name = "llvm.x86.avx2.gather.q.pd"]
+ fn pgatherqpd(
+ src: __m128d,
+ slice: *const i8,
+ offsets: i64x2,
+ mask: __m128d,
+ scale: i8,
+ ) -> __m128d;
+ #[link_name = "llvm.x86.avx2.gather.q.pd.256"]
+ fn vpgatherqpd(
+ src: __m256d,
+ slice: *const i8,
+ offsets: i64x4,
+ mask: __m256d,
+ scale: i8,
+ ) -> __m256d;
+ #[link_name = "llvm.x86.avx2.gather.d.ps"]
+ fn pgatherdps(src: __m128, slice: *const i8, offsets: i32x4, mask: __m128, scale: i8)
+ -> __m128;
+ #[link_name = "llvm.x86.avx2.gather.d.ps.256"]
+ fn vpgatherdps(
+ src: __m256,
+ slice: *const i8,
+ offsets: i32x8,
+ mask: __m256,
+ scale: i8,
+ ) -> __m256;
+ #[link_name = "llvm.x86.avx2.gather.q.ps"]
+ fn pgatherqps(src: __m128, slice: *const i8, offsets: i64x2, mask: __m128, scale: i8)
+ -> __m128;
+ #[link_name = "llvm.x86.avx2.gather.q.ps.256"]
+ fn vpgatherqps(
+ src: __m128,
+ slice: *const i8,
+ offsets: i64x4,
+ mask: __m128,
+ scale: i8,
+ ) -> __m128;
+ #[link_name = "llvm.x86.avx2.psll.dq"]
+ fn vpslldq(a: i64x4, b: i32) -> i64x4;
+ #[link_name = "llvm.x86.avx2.psrl.dq"]
+ fn vpsrldq(a: i64x4, b: i32) -> i64x4;
+}
+
+#[cfg(test)]
+mod tests {
+
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_abs_epi32() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let r = _mm256_abs_epi32(a);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi32(
+ 0, 1, 1, i32::MAX,
+ i32::MAX.wrapping_add(1), 100, 100, 32,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_abs_epi16() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi16(
+ 0, 1, -1, 2, -2, 3, -3, 4,
+ -4, 5, -5, i16::MAX, i16::MIN, 100, -100, -32,
+ );
+ let r = _mm256_abs_epi16(a);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi16(
+ 0, 1, 1, 2, 2, 3, 3, 4,
+ 4, 5, 5, i16::MAX, i16::MAX.wrapping_add(1), 100, 100, 32,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_abs_epi8() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi8(
+ 0, 1, -1, 2, -2, 3, -3, 4,
+ -4, 5, -5, i8::MAX, i8::MIN, 100, -100, -32,
+ 0, 1, -1, 2, -2, 3, -3, 4,
+ -4, 5, -5, i8::MAX, i8::MIN, 100, -100, -32,
+ );
+ let r = _mm256_abs_epi8(a);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi8(
+ 0, 1, 1, 2, 2, 3, 3, 4,
+ 4, 5, 5, i8::MAX, i8::MAX.wrapping_add(1), 100, 100, 32,
+ 0, 1, 1, 2, 2, 3, 3, 4,
+ 4, 5, 5, i8::MAX, i8::MAX.wrapping_add(1), 100, 100, 32,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_add_epi64() {
+ let a = _mm256_setr_epi64x(-10, 0, 100, 1_000_000_000);
+ let b = _mm256_setr_epi64x(-1, 0, 1, 2);
+ let r = _mm256_add_epi64(a, b);
+ let e = _mm256_setr_epi64x(-11, 0, 101, 1_000_000_002);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_add_epi32() {
+ let a = _mm256_setr_epi32(-1, 0, 1, 2, 3, 4, 5, 6);
+ let b = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_add_epi32(a, b);
+ let e = _mm256_setr_epi32(0, 2, 4, 6, 8, 10, 12, 14);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_add_epi16() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ #[rustfmt::skip]
+ let b = _mm256_setr_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ let r = _mm256_add_epi16(a, b);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi16(
+ 0, 2, 4, 6, 8, 10, 12, 14,
+ 16, 18, 20, 22, 24, 26, 28, 30,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_add_epi8() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_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,
+ );
+ #[rustfmt::skip]
+ let b = _mm256_setr_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 r = _mm256_add_epi8(a, b);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi8(
+ 0, 2, 4, 6, 8, 10, 12, 14,
+ 16, 18, 20, 22, 24, 26, 28, 30,
+ 32, 34, 36, 38, 40, 42, 44, 46,
+ 48, 50, 52, 54, 56, 58, 60, 62,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_adds_epi8() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_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,
+ );
+ #[rustfmt::skip]
+ let b = _mm256_setr_epi8(
+ 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 r = _mm256_adds_epi8(a, b);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi8(
+ 32, 34, 36, 38, 40, 42, 44, 46,
+ 48, 50, 52, 54, 56, 58, 60, 62,
+ 64, 66, 68, 70, 72, 74, 76, 78,
+ 80, 82, 84, 86, 88, 90, 92, 94,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_adds_epi8_saturate_positive() {
+ let a = _mm256_set1_epi8(0x7F);
+ let b = _mm256_set1_epi8(1);
+ let r = _mm256_adds_epi8(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_adds_epi8_saturate_negative() {
+ let a = _mm256_set1_epi8(-0x80);
+ let b = _mm256_set1_epi8(-1);
+ let r = _mm256_adds_epi8(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_adds_epi16() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ #[rustfmt::skip]
+ let b = _mm256_setr_epi16(
+ 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47,
+ );
+ let r = _mm256_adds_epi16(a, b);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi16(
+ 32, 34, 36, 38, 40, 42, 44, 46,
+ 48, 50, 52, 54, 56, 58, 60, 62,
+ );
+
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_adds_epi16_saturate_positive() {
+ let a = _mm256_set1_epi16(0x7FFF);
+ let b = _mm256_set1_epi16(1);
+ let r = _mm256_adds_epi16(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_adds_epi16_saturate_negative() {
+ let a = _mm256_set1_epi16(-0x8000);
+ let b = _mm256_set1_epi16(-1);
+ let r = _mm256_adds_epi16(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_adds_epu8() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_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,
+ );
+ #[rustfmt::skip]
+ let b = _mm256_setr_epi8(
+ 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 r = _mm256_adds_epu8(a, b);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi8(
+ 32, 34, 36, 38, 40, 42, 44, 46,
+ 48, 50, 52, 54, 56, 58, 60, 62,
+ 64, 66, 68, 70, 72, 74, 76, 78,
+ 80, 82, 84, 86, 88, 90, 92, 94,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_adds_epu8_saturate() {
+ let a = _mm256_set1_epi8(!0);
+ let b = _mm256_set1_epi8(1);
+ let r = _mm256_adds_epu8(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_adds_epu16() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ #[rustfmt::skip]
+ let b = _mm256_setr_epi16(
+ 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47,
+ );
+ let r = _mm256_adds_epu16(a, b);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi16(
+ 32, 34, 36, 38, 40, 42, 44, 46,
+ 48, 50, 52, 54, 56, 58, 60, 62,
+ );
+
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_adds_epu16_saturate() {
+ let a = _mm256_set1_epi16(!0);
+ let b = _mm256_set1_epi16(1);
+ let r = _mm256_adds_epu16(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_and_si256() {
+ let a = _mm256_set1_epi8(5);
+ let b = _mm256_set1_epi8(3);
+ let got = _mm256_and_si256(a, b);
+ assert_eq_m256i(got, _mm256_set1_epi8(1));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_andnot_si256() {
+ let a = _mm256_set1_epi8(5);
+ let b = _mm256_set1_epi8(3);
+ let got = _mm256_andnot_si256(a, b);
+ assert_eq_m256i(got, _mm256_set1_epi8(2));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_avg_epu8() {
+ let (a, b) = (_mm256_set1_epi8(3), _mm256_set1_epi8(9));
+ let r = _mm256_avg_epu8(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi8(6));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_avg_epu16() {
+ let (a, b) = (_mm256_set1_epi16(3), _mm256_set1_epi16(9));
+ let r = _mm256_avg_epu16(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi16(6));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_blend_epi32() {
+ let (a, b) = (_mm_set1_epi32(3), _mm_set1_epi32(9));
+ let e = _mm_setr_epi32(9, 3, 3, 3);
+ let r = _mm_blend_epi32::<0x01>(a, b);
+ assert_eq_m128i(r, e);
+
+ let r = _mm_blend_epi32::<0x0E>(b, a);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_blend_epi32() {
+ let (a, b) = (_mm256_set1_epi32(3), _mm256_set1_epi32(9));
+ let e = _mm256_setr_epi32(9, 3, 3, 3, 3, 3, 3, 3);
+ let r = _mm256_blend_epi32::<0x01>(a, b);
+ assert_eq_m256i(r, e);
+
+ let e = _mm256_setr_epi32(3, 9, 3, 3, 3, 3, 3, 9);
+ let r = _mm256_blend_epi32::<0x82>(a, b);
+ assert_eq_m256i(r, e);
+
+ let e = _mm256_setr_epi32(3, 3, 9, 9, 9, 9, 9, 3);
+ let r = _mm256_blend_epi32::<0x7C>(a, b);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_blend_epi16() {
+ let (a, b) = (_mm256_set1_epi16(3), _mm256_set1_epi16(9));
+ let e = _mm256_setr_epi16(9, 3, 3, 3, 3, 3, 3, 3, 9, 3, 3, 3, 3, 3, 3, 3);
+ let r = _mm256_blend_epi16::<0x01>(a, b);
+ assert_eq_m256i(r, e);
+
+ let r = _mm256_blend_epi16::<0xFE>(b, a);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_blendv_epi8() {
+ let (a, b) = (_mm256_set1_epi8(4), _mm256_set1_epi8(2));
+ let mask = _mm256_insert_epi8::<2>(_mm256_set1_epi8(0), -1);
+ let e = _mm256_insert_epi8::<2>(_mm256_set1_epi8(4), 2);
+ let r = _mm256_blendv_epi8(a, b, mask);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_broadcastb_epi8() {
+ let a = _mm_insert_epi8::<0>(_mm_set1_epi8(0x00), 0x2a);
+ let res = _mm_broadcastb_epi8(a);
+ assert_eq_m128i(res, _mm_set1_epi8(0x2a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_broadcastb_epi8() {
+ let a = _mm_insert_epi8::<0>(_mm_set1_epi8(0x00), 0x2a);
+ let res = _mm256_broadcastb_epi8(a);
+ assert_eq_m256i(res, _mm256_set1_epi8(0x2a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_broadcastd_epi32() {
+ let a = _mm_setr_epi32(0x2a, 0x8000000, 0, 0);
+ let res = _mm_broadcastd_epi32(a);
+ assert_eq_m128i(res, _mm_set1_epi32(0x2a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_broadcastd_epi32() {
+ let a = _mm_setr_epi32(0x2a, 0x8000000, 0, 0);
+ let res = _mm256_broadcastd_epi32(a);
+ assert_eq_m256i(res, _mm256_set1_epi32(0x2a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_broadcastq_epi64() {
+ let a = _mm_setr_epi64x(0x1ffffffff, 0);
+ let res = _mm_broadcastq_epi64(a);
+ assert_eq_m128i(res, _mm_set1_epi64x(0x1ffffffff));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_broadcastq_epi64() {
+ let a = _mm_setr_epi64x(0x1ffffffff, 0);
+ let res = _mm256_broadcastq_epi64(a);
+ assert_eq_m256i(res, _mm256_set1_epi64x(0x1ffffffff));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_broadcastsd_pd() {
+ let a = _mm_setr_pd(6.28, 3.14);
+ let res = _mm_broadcastsd_pd(a);
+ assert_eq_m128d(res, _mm_set1_pd(6.28f64));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_broadcastsd_pd() {
+ let a = _mm_setr_pd(6.28, 3.14);
+ let res = _mm256_broadcastsd_pd(a);
+ assert_eq_m256d(res, _mm256_set1_pd(6.28f64));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_broadcastsi128_si256() {
+ let a = _mm_setr_epi64x(0x0987654321012334, 0x5678909876543210);
+ let res = _mm256_broadcastsi128_si256(a);
+ let retval = _mm256_setr_epi64x(
+ 0x0987654321012334,
+ 0x5678909876543210,
+ 0x0987654321012334,
+ 0x5678909876543210,
+ );
+ assert_eq_m256i(res, retval);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_broadcastss_ps() {
+ let a = _mm_setr_ps(6.28, 3.14, 0.0, 0.0);
+ let res = _mm_broadcastss_ps(a);
+ assert_eq_m128(res, _mm_set1_ps(6.28f32));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_broadcastss_ps() {
+ let a = _mm_setr_ps(6.28, 3.14, 0.0, 0.0);
+ let res = _mm256_broadcastss_ps(a);
+ assert_eq_m256(res, _mm256_set1_ps(6.28f32));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_broadcastw_epi16() {
+ let a = _mm_insert_epi16::<0>(_mm_set1_epi16(0x2a), 0x22b);
+ let res = _mm_broadcastw_epi16(a);
+ assert_eq_m128i(res, _mm_set1_epi16(0x22b));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_broadcastw_epi16() {
+ let a = _mm_insert_epi16::<0>(_mm_set1_epi16(0x2a), 0x22b);
+ let res = _mm256_broadcastw_epi16(a);
+ assert_eq_m256i(res, _mm256_set1_epi16(0x22b));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cmpeq_epi8() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_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,
+ );
+ #[rustfmt::skip]
+ let b = _mm256_setr_epi8(
+ 31, 30, 2, 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, 0,
+ );
+ let r = _mm256_cmpeq_epi8(a, b);
+ assert_eq_m256i(r, _mm256_insert_epi8::<2>(_mm256_set1_epi8(0), !0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cmpeq_epi16() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ #[rustfmt::skip]
+ let b = _mm256_setr_epi16(
+ 15, 14, 2, 12, 11, 10, 9, 8,
+ 7, 6, 5, 4, 3, 2, 1, 0,
+ );
+ let r = _mm256_cmpeq_epi16(a, b);
+ assert_eq_m256i(r, _mm256_insert_epi16::<2>(_mm256_set1_epi16(0), !0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cmpeq_epi32() {
+ let a = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm256_setr_epi32(7, 6, 2, 4, 3, 2, 1, 0);
+ let r = _mm256_cmpeq_epi32(a, b);
+ let e = _mm256_set1_epi32(0);
+ let e = _mm256_insert_epi32::<2>(e, !0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cmpeq_epi64() {
+ let a = _mm256_setr_epi64x(0, 1, 2, 3);
+ let b = _mm256_setr_epi64x(3, 2, 2, 0);
+ let r = _mm256_cmpeq_epi64(a, b);
+ assert_eq_m256i(r, _mm256_insert_epi64::<2>(_mm256_set1_epi64x(0), !0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cmpgt_epi8() {
+ let a = _mm256_insert_epi8::<0>(_mm256_set1_epi8(0), 5);
+ let b = _mm256_set1_epi8(0);
+ let r = _mm256_cmpgt_epi8(a, b);
+ assert_eq_m256i(r, _mm256_insert_epi8::<0>(_mm256_set1_epi8(0), !0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cmpgt_epi16() {
+ let a = _mm256_insert_epi16::<0>(_mm256_set1_epi16(0), 5);
+ let b = _mm256_set1_epi16(0);
+ let r = _mm256_cmpgt_epi16(a, b);
+ assert_eq_m256i(r, _mm256_insert_epi16::<0>(_mm256_set1_epi16(0), !0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cmpgt_epi32() {
+ let a = _mm256_insert_epi32::<0>(_mm256_set1_epi32(0), 5);
+ let b = _mm256_set1_epi32(0);
+ let r = _mm256_cmpgt_epi32(a, b);
+ assert_eq_m256i(r, _mm256_insert_epi32::<0>(_mm256_set1_epi32(0), !0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cmpgt_epi64() {
+ let a = _mm256_insert_epi64::<0>(_mm256_set1_epi64x(0), 5);
+ let b = _mm256_set1_epi64x(0);
+ let r = _mm256_cmpgt_epi64(a, b);
+ assert_eq_m256i(r, _mm256_insert_epi64::<0>(_mm256_set1_epi64x(0), !0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepi8_epi16() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0, 0, -1, 1, -2, 2, -3, 3,
+ -4, 4, -5, 5, -6, 6, -7, 7,
+ );
+ #[rustfmt::skip]
+ let r = _mm256_setr_epi16(
+ 0, 0, -1, 1, -2, 2, -3, 3,
+ -4, 4, -5, 5, -6, 6, -7, 7,
+ );
+ assert_eq_m256i(r, _mm256_cvtepi8_epi16(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepi8_epi32() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0, 0, -1, 1, -2, 2, -3, 3,
+ -4, 4, -5, 5, -6, 6, -7, 7,
+ );
+ let r = _mm256_setr_epi32(0, 0, -1, 1, -2, 2, -3, 3);
+ assert_eq_m256i(r, _mm256_cvtepi8_epi32(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepi8_epi64() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0, 0, -1, 1, -2, 2, -3, 3,
+ -4, 4, -5, 5, -6, 6, -7, 7,
+ );
+ let r = _mm256_setr_epi64x(0, 0, -1, 1);
+ assert_eq_m256i(r, _mm256_cvtepi8_epi64(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepi16_epi32() {
+ let a = _mm_setr_epi16(0, 0, -1, 1, -2, 2, -3, 3);
+ let r = _mm256_setr_epi32(0, 0, -1, 1, -2, 2, -3, 3);
+ assert_eq_m256i(r, _mm256_cvtepi16_epi32(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepi16_epi64() {
+ let a = _mm_setr_epi16(0, 0, -1, 1, -2, 2, -3, 3);
+ let r = _mm256_setr_epi64x(0, 0, -1, 1);
+ assert_eq_m256i(r, _mm256_cvtepi16_epi64(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepi32_epi64() {
+ let a = _mm_setr_epi32(0, 0, -1, 1);
+ let r = _mm256_setr_epi64x(0, 0, -1, 1);
+ assert_eq_m256i(r, _mm256_cvtepi32_epi64(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepu16_epi32() {
+ let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m256i(r, _mm256_cvtepu16_epi32(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepu16_epi64() {
+ let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_setr_epi64x(0, 1, 2, 3);
+ assert_eq_m256i(r, _mm256_cvtepu16_epi64(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepu32_epi64() {
+ let a = _mm_setr_epi32(0, 1, 2, 3);
+ let r = _mm256_setr_epi64x(0, 1, 2, 3);
+ assert_eq_m256i(r, _mm256_cvtepu32_epi64(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepu8_epi16() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ #[rustfmt::skip]
+ let r = _mm256_setr_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ assert_eq_m256i(r, _mm256_cvtepu8_epi16(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepu8_epi32() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ let r = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m256i(r, _mm256_cvtepu8_epi32(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtepu8_epi64() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ let r = _mm256_setr_epi64x(0, 1, 2, 3);
+ assert_eq_m256i(r, _mm256_cvtepu8_epi64(a));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_extracti128_si256() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let r = _mm256_extracti128_si256::<1>(a);
+ let e = _mm_setr_epi64x(3, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_hadd_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_hadd_epi16(a, b);
+ let e = _mm256_setr_epi16(4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, 8, 8, 8, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_hadd_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(4);
+ let r = _mm256_hadd_epi32(a, b);
+ let e = _mm256_setr_epi32(4, 4, 8, 8, 4, 4, 8, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_hadds_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let a = _mm256_insert_epi16::<0>(a, 0x7fff);
+ let a = _mm256_insert_epi16::<1>(a, 1);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_hadds_epi16(a, b);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi16(
+ 0x7FFF, 4, 4, 4, 8, 8, 8, 8,
+ 4, 4, 4, 4, 8, 8, 8, 8,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_hsub_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_hsub_epi16(a, b);
+ let e = _mm256_set1_epi16(0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_hsub_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(4);
+ let r = _mm256_hsub_epi32(a, b);
+ let e = _mm256_set1_epi32(0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_hsubs_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let a = _mm256_insert_epi16::<0>(a, 0x7fff);
+ let a = _mm256_insert_epi16::<1>(a, -1);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_hsubs_epi16(a, b);
+ let e = _mm256_insert_epi16::<0>(_mm256_set1_epi16(0), 0x7FFF);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_madd_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_madd_epi16(a, b);
+ let e = _mm256_set1_epi32(16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_inserti128_si256() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let b = _mm_setr_epi64x(7, 8);
+ let r = _mm256_inserti128_si256::<1>(a, b);
+ let e = _mm256_setr_epi64x(1, 2, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_maddubs_epi16() {
+ let a = _mm256_set1_epi8(2);
+ let b = _mm256_set1_epi8(4);
+ let r = _mm256_maddubs_epi16(a, b);
+ let e = _mm256_set1_epi16(16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_maskload_epi32() {
+ let nums = [1, 2, 3, 4];
+ let a = &nums as *const i32;
+ let mask = _mm_setr_epi32(-1, 0, 0, -1);
+ let r = _mm_maskload_epi32(a, mask);
+ let e = _mm_setr_epi32(1, 0, 0, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_maskload_epi32() {
+ let nums = [1, 2, 3, 4, 5, 6, 7, 8];
+ let a = &nums as *const i32;
+ let mask = _mm256_setr_epi32(-1, 0, 0, -1, 0, -1, -1, 0);
+ let r = _mm256_maskload_epi32(a, mask);
+ let e = _mm256_setr_epi32(1, 0, 0, 4, 0, 6, 7, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_maskload_epi64() {
+ let nums = [1_i64, 2_i64];
+ let a = &nums as *const i64;
+ let mask = _mm_setr_epi64x(0, -1);
+ let r = _mm_maskload_epi64(a, mask);
+ let e = _mm_setr_epi64x(0, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_maskload_epi64() {
+ let nums = [1_i64, 2_i64, 3_i64, 4_i64];
+ let a = &nums as *const i64;
+ let mask = _mm256_setr_epi64x(0, -1, -1, 0);
+ let r = _mm256_maskload_epi64(a, mask);
+ let e = _mm256_setr_epi64x(0, 2, 3, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_maskstore_epi32() {
+ let a = _mm_setr_epi32(1, 2, 3, 4);
+ let mut arr = [-1, -1, -1, -1];
+ let mask = _mm_setr_epi32(-1, 0, 0, -1);
+ _mm_maskstore_epi32(arr.as_mut_ptr(), mask, a);
+ let e = [1, -1, -1, 4];
+ assert_eq!(arr, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_maskstore_epi32() {
+ let a = _mm256_setr_epi32(1, 0x6d726f, 3, 42, 0x777161, 6, 7, 8);
+ let mut arr = [-1, -1, -1, 0x776173, -1, 0x68657265, -1, -1];
+ let mask = _mm256_setr_epi32(-1, 0, 0, -1, 0, -1, -1, 0);
+ _mm256_maskstore_epi32(arr.as_mut_ptr(), mask, a);
+ let e = [1, -1, -1, 42, -1, 6, 7, -1];
+ assert_eq!(arr, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_maskstore_epi64() {
+ let a = _mm_setr_epi64x(1_i64, 2_i64);
+ let mut arr = [-1_i64, -1_i64];
+ let mask = _mm_setr_epi64x(0, -1);
+ _mm_maskstore_epi64(arr.as_mut_ptr(), mask, a);
+ let e = [-1, 2];
+ assert_eq!(arr, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_maskstore_epi64() {
+ let a = _mm256_setr_epi64x(1_i64, 2_i64, 3_i64, 4_i64);
+ let mut arr = [-1_i64, -1_i64, -1_i64, -1_i64];
+ let mask = _mm256_setr_epi64x(0, -1, -1, 0);
+ _mm256_maskstore_epi64(arr.as_mut_ptr(), mask, a);
+ let e = [-1, 2, 3, -1];
+ assert_eq!(arr, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_max_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_max_epi16(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_max_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(4);
+ let r = _mm256_max_epi32(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_max_epi8() {
+ let a = _mm256_set1_epi8(2);
+ let b = _mm256_set1_epi8(4);
+ let r = _mm256_max_epi8(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_max_epu16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_max_epu16(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_max_epu32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(4);
+ let r = _mm256_max_epu32(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_max_epu8() {
+ let a = _mm256_set1_epi8(2);
+ let b = _mm256_set1_epi8(4);
+ let r = _mm256_max_epu8(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_min_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_min_epi16(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_min_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(4);
+ let r = _mm256_min_epi32(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_min_epi8() {
+ let a = _mm256_set1_epi8(2);
+ let b = _mm256_set1_epi8(4);
+ let r = _mm256_min_epi8(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_min_epu16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_min_epu16(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_min_epu32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(4);
+ let r = _mm256_min_epu32(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_min_epu8() {
+ let a = _mm256_set1_epi8(2);
+ let b = _mm256_set1_epi8(4);
+ let r = _mm256_min_epu8(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_movemask_epi8() {
+ let a = _mm256_set1_epi8(-1);
+ let r = _mm256_movemask_epi8(a);
+ let e = -1;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mpsadbw_epu8() {
+ let a = _mm256_set1_epi8(2);
+ let b = _mm256_set1_epi8(4);
+ let r = _mm256_mpsadbw_epu8::<0>(a, b);
+ let e = _mm256_set1_epi16(8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mul_epi32() {
+ let a = _mm256_setr_epi32(0, 0, 0, 0, 2, 2, 2, 2);
+ let b = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_mul_epi32(a, b);
+ let e = _mm256_setr_epi64x(0, 0, 10, 14);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mul_epu32() {
+ let a = _mm256_setr_epi32(0, 0, 0, 0, 2, 2, 2, 2);
+ let b = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_mul_epu32(a, b);
+ let e = _mm256_setr_epi64x(0, 0, 10, 14);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mulhi_epi16() {
+ let a = _mm256_set1_epi16(6535);
+ let b = _mm256_set1_epi16(6535);
+ let r = _mm256_mulhi_epi16(a, b);
+ let e = _mm256_set1_epi16(651);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mulhi_epu16() {
+ let a = _mm256_set1_epi16(6535);
+ let b = _mm256_set1_epi16(6535);
+ let r = _mm256_mulhi_epu16(a, b);
+ let e = _mm256_set1_epi16(651);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mullo_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_mullo_epi16(a, b);
+ let e = _mm256_set1_epi16(8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mullo_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(4);
+ let r = _mm256_mullo_epi32(a, b);
+ let e = _mm256_set1_epi32(8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mulhrs_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_mullo_epi16(a, b);
+ let e = _mm256_set1_epi16(8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_or_si256() {
+ let a = _mm256_set1_epi8(-1);
+ let b = _mm256_set1_epi8(0);
+ let r = _mm256_or_si256(a, b);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_packs_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_packs_epi16(a, b);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi8(
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ );
+
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_packs_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(4);
+ let r = _mm256_packs_epi32(a, b);
+ let e = _mm256_setr_epi16(2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4);
+
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_packus_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(4);
+ let r = _mm256_packus_epi16(a, b);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi8(
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ );
+
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_packus_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(4);
+ let r = _mm256_packus_epi32(a, b);
+ let e = _mm256_setr_epi16(2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4);
+
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sad_epu8() {
+ let a = _mm256_set1_epi8(2);
+ let b = _mm256_set1_epi8(4);
+ let r = _mm256_sad_epu8(a, b);
+ let e = _mm256_set1_epi64x(16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_shufflehi_epi16() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi16(
+ 0, 1, 2, 3, 11, 22, 33, 44,
+ 4, 5, 6, 7, 55, 66, 77, 88,
+ );
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi16(
+ 0, 1, 2, 3, 44, 22, 22, 11,
+ 4, 5, 6, 7, 88, 66, 66, 55,
+ );
+ let r = _mm256_shufflehi_epi16::<0b00_01_01_11>(a);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_shufflelo_epi16() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi16(
+ 11, 22, 33, 44, 0, 1, 2, 3,
+ 55, 66, 77, 88, 4, 5, 6, 7,
+ );
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi16(
+ 44, 22, 22, 11, 0, 1, 2, 3,
+ 88, 66, 66, 55, 4, 5, 6, 7,
+ );
+ let r = _mm256_shufflelo_epi16::<0b00_01_01_11>(a);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sign_epi16() {
+ let a = _mm256_set1_epi16(2);
+ let b = _mm256_set1_epi16(-1);
+ let r = _mm256_sign_epi16(a, b);
+ let e = _mm256_set1_epi16(-2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sign_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(-1);
+ let r = _mm256_sign_epi32(a, b);
+ let e = _mm256_set1_epi32(-2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sign_epi8() {
+ let a = _mm256_set1_epi8(2);
+ let b = _mm256_set1_epi8(-1);
+ let r = _mm256_sign_epi8(a, b);
+ let e = _mm256_set1_epi8(-2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sll_epi16() {
+ let a = _mm256_set1_epi16(0xFF);
+ let b = _mm_insert_epi16::<0>(_mm_set1_epi16(0), 4);
+ let r = _mm256_sll_epi16(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi16(0xFF0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sll_epi32() {
+ let a = _mm256_set1_epi32(0xFFFF);
+ let b = _mm_insert_epi32::<0>(_mm_set1_epi32(0), 4);
+ let r = _mm256_sll_epi32(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi32(0xFFFF0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sll_epi64() {
+ let a = _mm256_set1_epi64x(0xFFFFFFFF);
+ let b = _mm_insert_epi64::<0>(_mm_set1_epi64x(0), 4);
+ let r = _mm256_sll_epi64(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi64x(0xFFFFFFFF0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_slli_epi16() {
+ assert_eq_m256i(
+ _mm256_slli_epi16::<4>(_mm256_set1_epi16(0xFF)),
+ _mm256_set1_epi16(0xFF0),
+ );
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_slli_epi32() {
+ assert_eq_m256i(
+ _mm256_slli_epi32::<4>(_mm256_set1_epi32(0xFFFF)),
+ _mm256_set1_epi32(0xFFFF0),
+ );
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_slli_epi64() {
+ assert_eq_m256i(
+ _mm256_slli_epi64::<4>(_mm256_set1_epi64x(0xFFFFFFFF)),
+ _mm256_set1_epi64x(0xFFFFFFFF0),
+ );
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_slli_si256() {
+ let a = _mm256_set1_epi64x(0xFFFFFFFF);
+ let r = _mm256_slli_si256::<3>(a);
+ assert_eq_m256i(r, _mm256_set1_epi64x(0xFFFFFFFF000000));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_sllv_epi32() {
+ let a = _mm_set1_epi32(2);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_sllv_epi32(a, b);
+ let e = _mm_set1_epi32(4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sllv_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_sllv_epi32(a, b);
+ let e = _mm256_set1_epi32(4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_sllv_epi64() {
+ let a = _mm_set1_epi64x(2);
+ let b = _mm_set1_epi64x(1);
+ let r = _mm_sllv_epi64(a, b);
+ let e = _mm_set1_epi64x(4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sllv_epi64() {
+ let a = _mm256_set1_epi64x(2);
+ let b = _mm256_set1_epi64x(1);
+ let r = _mm256_sllv_epi64(a, b);
+ let e = _mm256_set1_epi64x(4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sra_epi16() {
+ let a = _mm256_set1_epi16(-1);
+ let b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm256_sra_epi16(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi16(-1));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sra_epi32() {
+ let a = _mm256_set1_epi32(-1);
+ let b = _mm_insert_epi32::<0>(_mm_set1_epi32(0), 1);
+ let r = _mm256_sra_epi32(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi32(-1));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srai_epi16() {
+ assert_eq_m256i(
+ _mm256_srai_epi16::<1>(_mm256_set1_epi16(-1)),
+ _mm256_set1_epi16(-1),
+ );
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srai_epi32() {
+ assert_eq_m256i(
+ _mm256_srai_epi32::<1>(_mm256_set1_epi32(-1)),
+ _mm256_set1_epi32(-1),
+ );
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_srav_epi32() {
+ let a = _mm_set1_epi32(4);
+ let count = _mm_set1_epi32(1);
+ let r = _mm_srav_epi32(a, count);
+ let e = _mm_set1_epi32(2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srav_epi32() {
+ let a = _mm256_set1_epi32(4);
+ let count = _mm256_set1_epi32(1);
+ let r = _mm256_srav_epi32(a, count);
+ let e = _mm256_set1_epi32(2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srli_si256() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_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,
+ );
+ let r = _mm256_srli_si256::<3>(a);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi8(
+ 4, 5, 6, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15, 16, 0, 0, 0,
+ 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 0, 0, 0,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srl_epi16() {
+ let a = _mm256_set1_epi16(0xFF);
+ let b = _mm_insert_epi16::<0>(_mm_set1_epi16(0), 4);
+ let r = _mm256_srl_epi16(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi16(0xF));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srl_epi32() {
+ let a = _mm256_set1_epi32(0xFFFF);
+ let b = _mm_insert_epi32::<0>(_mm_set1_epi32(0), 4);
+ let r = _mm256_srl_epi32(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi32(0xFFF));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srl_epi64() {
+ let a = _mm256_set1_epi64x(0xFFFFFFFF);
+ let b = _mm_setr_epi64x(4, 0);
+ let r = _mm256_srl_epi64(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi64x(0xFFFFFFF));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srli_epi16() {
+ assert_eq_m256i(
+ _mm256_srli_epi16::<4>(_mm256_set1_epi16(0xFF)),
+ _mm256_set1_epi16(0xF),
+ );
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srli_epi32() {
+ assert_eq_m256i(
+ _mm256_srli_epi32::<4>(_mm256_set1_epi32(0xFFFF)),
+ _mm256_set1_epi32(0xFFF),
+ );
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srli_epi64() {
+ assert_eq_m256i(
+ _mm256_srli_epi64::<4>(_mm256_set1_epi64x(0xFFFFFFFF)),
+ _mm256_set1_epi64x(0xFFFFFFF),
+ );
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_srlv_epi32() {
+ let a = _mm_set1_epi32(2);
+ let count = _mm_set1_epi32(1);
+ let r = _mm_srlv_epi32(a, count);
+ let e = _mm_set1_epi32(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srlv_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let count = _mm256_set1_epi32(1);
+ let r = _mm256_srlv_epi32(a, count);
+ let e = _mm256_set1_epi32(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_srlv_epi64() {
+ let a = _mm_set1_epi64x(2);
+ let count = _mm_set1_epi64x(1);
+ let r = _mm_srlv_epi64(a, count);
+ let e = _mm_set1_epi64x(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_srlv_epi64() {
+ let a = _mm256_set1_epi64x(2);
+ let count = _mm256_set1_epi64x(1);
+ let r = _mm256_srlv_epi64(a, count);
+ let e = _mm256_set1_epi64x(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sub_epi16() {
+ let a = _mm256_set1_epi16(4);
+ let b = _mm256_set1_epi16(2);
+ let r = _mm256_sub_epi16(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sub_epi32() {
+ let a = _mm256_set1_epi32(4);
+ let b = _mm256_set1_epi32(2);
+ let r = _mm256_sub_epi32(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sub_epi64() {
+ let a = _mm256_set1_epi64x(4);
+ let b = _mm256_set1_epi64x(2);
+ let r = _mm256_sub_epi64(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_sub_epi8() {
+ let a = _mm256_set1_epi8(4);
+ let b = _mm256_set1_epi8(2);
+ let r = _mm256_sub_epi8(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_subs_epi16() {
+ let a = _mm256_set1_epi16(4);
+ let b = _mm256_set1_epi16(2);
+ let r = _mm256_subs_epi16(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_subs_epi8() {
+ let a = _mm256_set1_epi8(4);
+ let b = _mm256_set1_epi8(2);
+ let r = _mm256_subs_epi8(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_subs_epu16() {
+ let a = _mm256_set1_epi16(4);
+ let b = _mm256_set1_epi16(2);
+ let r = _mm256_subs_epu16(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_subs_epu8() {
+ let a = _mm256_set1_epi8(4);
+ let b = _mm256_set1_epi8(2);
+ let r = _mm256_subs_epu8(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_xor_si256() {
+ let a = _mm256_set1_epi8(5);
+ let b = _mm256_set1_epi8(3);
+ let r = _mm256_xor_si256(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi8(6));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_alignr_epi8() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_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_setr_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,
+ );
+ let r = _mm256_alignr_epi8::<33>(a, b);
+ assert_eq_m256i(r, _mm256_set1_epi8(0));
+
+ let r = _mm256_alignr_epi8::<17>(a, b);
+ #[rustfmt::skip]
+ let expected = _mm256_setr_epi8(
+ 2, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 0,
+ 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 0,
+ );
+ assert_eq_m256i(r, expected);
+
+ let r = _mm256_alignr_epi8::<4>(a, b);
+ #[rustfmt::skip]
+ let expected = _mm256_setr_epi8(
+ -5, -6, -7, -8, -9, -10, -11, -12,
+ -13, -14, -15, -16, 1, 2, 3, 4,
+ -21, -22, -23, -24, -25, -26, -27, -28,
+ -29, -30, -31, -32, 17, 18, 19, 20,
+ );
+ assert_eq_m256i(r, expected);
+
+ #[rustfmt::skip]
+ let expected = _mm256_setr_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,
+ );
+ let r = _mm256_alignr_epi8::<16>(a, b);
+ assert_eq_m256i(r, expected);
+
+ let r = _mm256_alignr_epi8::<15>(a, b);
+ #[rustfmt::skip]
+ let expected = _mm256_setr_epi8(
+ -16, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ -32, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31,
+ );
+ assert_eq_m256i(r, expected);
+
+ let r = _mm256_alignr_epi8::<0>(a, b);
+ assert_eq_m256i(r, b);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_shuffle_epi8() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_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_setr_epi8(
+ 4, 128u8 as i8, 4, 3, 24, 12, 6, 19,
+ 12, 5, 5, 10, 4, 1, 8, 0,
+ 4, 128u8 as i8, 4, 3, 24, 12, 6, 19,
+ 12, 5, 5, 10, 4, 1, 8, 0,
+ );
+ #[rustfmt::skip]
+ let expected = _mm256_setr_epi8(
+ 5, 0, 5, 4, 9, 13, 7, 4,
+ 13, 6, 6, 11, 5, 2, 9, 1,
+ 21, 0, 21, 20, 25, 29, 23, 20,
+ 29, 22, 22, 27, 21, 18, 25, 17,
+ );
+ let r = _mm256_shuffle_epi8(a, b);
+ assert_eq_m256i(r, expected);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_permutevar8x32_epi32() {
+ let a = _mm256_setr_epi32(100, 200, 300, 400, 500, 600, 700, 800);
+ let b = _mm256_setr_epi32(5, 0, 5, 1, 7, 6, 3, 4);
+ let expected = _mm256_setr_epi32(600, 100, 600, 200, 800, 700, 400, 500);
+ let r = _mm256_permutevar8x32_epi32(a, b);
+ assert_eq_m256i(r, expected);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_permute4x64_epi64() {
+ let a = _mm256_setr_epi64x(100, 200, 300, 400);
+ let expected = _mm256_setr_epi64x(400, 100, 200, 100);
+ let r = _mm256_permute4x64_epi64::<0b00010011>(a);
+ assert_eq_m256i(r, expected);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_permute2x128_si256() {
+ let a = _mm256_setr_epi64x(100, 200, 500, 600);
+ let b = _mm256_setr_epi64x(300, 400, 700, 800);
+ let r = _mm256_permute2x128_si256::<0b00_01_00_11>(a, b);
+ let e = _mm256_setr_epi64x(700, 800, 500, 600);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_permute4x64_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let r = _mm256_permute4x64_pd::<0b00_01_00_11>(a);
+ let e = _mm256_setr_pd(4., 1., 2., 1.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_permutevar8x32_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_setr_epi32(5, 0, 5, 1, 7, 6, 3, 4);
+ let r = _mm256_permutevar8x32_ps(a, b);
+ let e = _mm256_setr_ps(6., 1., 6., 2., 8., 7., 4., 5.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_i32gather_epi32() {
+ let mut arr = [0i32; 128];
+ for i in 0..128i32 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 4 is word-addressing
+ let r = _mm_i32gather_epi32::<4>(arr.as_ptr(), _mm_setr_epi32(0, 16, 32, 48));
+ assert_eq_m128i(r, _mm_setr_epi32(0, 16, 32, 48));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_mask_i32gather_epi32() {
+ let mut arr = [0i32; 128];
+ for i in 0..128i32 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 4 is word-addressing
+ let r = _mm_mask_i32gather_epi32::<4>(
+ _mm_set1_epi32(256),
+ arr.as_ptr(),
+ _mm_setr_epi32(0, 16, 64, 96),
+ _mm_setr_epi32(-1, -1, -1, 0),
+ );
+ assert_eq_m128i(r, _mm_setr_epi32(0, 16, 64, 256));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_i32gather_epi32() {
+ let mut arr = [0i32; 128];
+ for i in 0..128i32 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 4 is word-addressing
+ let r =
+ _mm256_i32gather_epi32::<4>(arr.as_ptr(), _mm256_setr_epi32(0, 16, 32, 48, 1, 2, 3, 4));
+ assert_eq_m256i(r, _mm256_setr_epi32(0, 16, 32, 48, 1, 2, 3, 4));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mask_i32gather_epi32() {
+ let mut arr = [0i32; 128];
+ for i in 0..128i32 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 4 is word-addressing
+ let r = _mm256_mask_i32gather_epi32::<4>(
+ _mm256_set1_epi32(256),
+ arr.as_ptr(),
+ _mm256_setr_epi32(0, 16, 64, 96, 0, 0, 0, 0),
+ _mm256_setr_epi32(-1, -1, -1, 0, 0, 0, 0, 0),
+ );
+ assert_eq_m256i(r, _mm256_setr_epi32(0, 16, 64, 256, 256, 256, 256, 256));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_i32gather_ps() {
+ let mut arr = [0.0f32; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 4 is word-addressing for f32s
+ let r = _mm_i32gather_ps::<4>(arr.as_ptr(), _mm_setr_epi32(0, 16, 32, 48));
+ assert_eq_m128(r, _mm_setr_ps(0.0, 16.0, 32.0, 48.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_mask_i32gather_ps() {
+ let mut arr = [0.0f32; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 4 is word-addressing for f32s
+ let r = _mm_mask_i32gather_ps::<4>(
+ _mm_set1_ps(256.0),
+ arr.as_ptr(),
+ _mm_setr_epi32(0, 16, 64, 96),
+ _mm_setr_ps(-1.0, -1.0, -1.0, 0.0),
+ );
+ assert_eq_m128(r, _mm_setr_ps(0.0, 16.0, 64.0, 256.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_i32gather_ps() {
+ let mut arr = [0.0f32; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 4 is word-addressing for f32s
+ let r =
+ _mm256_i32gather_ps::<4>(arr.as_ptr(), _mm256_setr_epi32(0, 16, 32, 48, 1, 2, 3, 4));
+ assert_eq_m256(r, _mm256_setr_ps(0.0, 16.0, 32.0, 48.0, 1.0, 2.0, 3.0, 4.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mask_i32gather_ps() {
+ let mut arr = [0.0f32; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 4 is word-addressing for f32s
+ let r = _mm256_mask_i32gather_ps::<4>(
+ _mm256_set1_ps(256.0),
+ arr.as_ptr(),
+ _mm256_setr_epi32(0, 16, 64, 96, 0, 0, 0, 0),
+ _mm256_setr_ps(-1.0, -1.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0),
+ );
+ assert_eq_m256(
+ r,
+ _mm256_setr_ps(0.0, 16.0, 64.0, 256.0, 256.0, 256.0, 256.0, 256.0),
+ );
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_i32gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing for i64s
+ let r = _mm_i32gather_epi64::<8>(arr.as_ptr(), _mm_setr_epi32(0, 16, 0, 0));
+ assert_eq_m128i(r, _mm_setr_epi64x(0, 16));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_mask_i32gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing for i64s
+ let r = _mm_mask_i32gather_epi64::<8>(
+ _mm_set1_epi64x(256),
+ arr.as_ptr(),
+ _mm_setr_epi32(16, 16, 16, 16),
+ _mm_setr_epi64x(-1, 0),
+ );
+ assert_eq_m128i(r, _mm_setr_epi64x(16, 256));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_i32gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing for i64s
+ let r = _mm256_i32gather_epi64::<8>(arr.as_ptr(), _mm_setr_epi32(0, 16, 32, 48));
+ assert_eq_m256i(r, _mm256_setr_epi64x(0, 16, 32, 48));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mask_i32gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing for i64s
+ let r = _mm256_mask_i32gather_epi64::<8>(
+ _mm256_set1_epi64x(256),
+ arr.as_ptr(),
+ _mm_setr_epi32(0, 16, 64, 96),
+ _mm256_setr_epi64x(-1, -1, -1, 0),
+ );
+ assert_eq_m256i(r, _mm256_setr_epi64x(0, 16, 64, 256));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_i32gather_pd() {
+ let mut arr = [0.0f64; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 8 is word-addressing for f64s
+ let r = _mm_i32gather_pd::<8>(arr.as_ptr(), _mm_setr_epi32(0, 16, 0, 0));
+ assert_eq_m128d(r, _mm_setr_pd(0.0, 16.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_mask_i32gather_pd() {
+ let mut arr = [0.0f64; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 8 is word-addressing for f64s
+ let r = _mm_mask_i32gather_pd::<8>(
+ _mm_set1_pd(256.0),
+ arr.as_ptr(),
+ _mm_setr_epi32(16, 16, 16, 16),
+ _mm_setr_pd(-1.0, 0.0),
+ );
+ assert_eq_m128d(r, _mm_setr_pd(16.0, 256.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_i32gather_pd() {
+ let mut arr = [0.0f64; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 8 is word-addressing for f64s
+ let r = _mm256_i32gather_pd::<8>(arr.as_ptr(), _mm_setr_epi32(0, 16, 32, 48));
+ assert_eq_m256d(r, _mm256_setr_pd(0.0, 16.0, 32.0, 48.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mask_i32gather_pd() {
+ let mut arr = [0.0f64; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 8 is word-addressing for f64s
+ let r = _mm256_mask_i32gather_pd::<8>(
+ _mm256_set1_pd(256.0),
+ arr.as_ptr(),
+ _mm_setr_epi32(0, 16, 64, 96),
+ _mm256_setr_pd(-1.0, -1.0, -1.0, 0.0),
+ );
+ assert_eq_m256d(r, _mm256_setr_pd(0.0, 16.0, 64.0, 256.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_i64gather_epi32() {
+ let mut arr = [0i32; 128];
+ for i in 0..128i32 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 4 is word-addressing
+ let r = _mm_i64gather_epi32::<4>(arr.as_ptr(), _mm_setr_epi64x(0, 16));
+ assert_eq_m128i(r, _mm_setr_epi32(0, 16, 0, 0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_mask_i64gather_epi32() {
+ let mut arr = [0i32; 128];
+ for i in 0..128i32 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 4 is word-addressing
+ let r = _mm_mask_i64gather_epi32::<4>(
+ _mm_set1_epi32(256),
+ arr.as_ptr(),
+ _mm_setr_epi64x(0, 16),
+ _mm_setr_epi32(-1, 0, -1, 0),
+ );
+ assert_eq_m128i(r, _mm_setr_epi32(0, 256, 0, 0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_i64gather_epi32() {
+ let mut arr = [0i32; 128];
+ for i in 0..128i32 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 4 is word-addressing
+ let r = _mm256_i64gather_epi32::<4>(arr.as_ptr(), _mm256_setr_epi64x(0, 16, 32, 48));
+ assert_eq_m128i(r, _mm_setr_epi32(0, 16, 32, 48));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mask_i64gather_epi32() {
+ let mut arr = [0i32; 128];
+ for i in 0..128i32 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 4 is word-addressing
+ let r = _mm256_mask_i64gather_epi32::<4>(
+ _mm_set1_epi32(256),
+ arr.as_ptr(),
+ _mm256_setr_epi64x(0, 16, 64, 96),
+ _mm_setr_epi32(-1, -1, -1, 0),
+ );
+ assert_eq_m128i(r, _mm_setr_epi32(0, 16, 64, 256));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_i64gather_ps() {
+ let mut arr = [0.0f32; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 4 is word-addressing for f32s
+ let r = _mm_i64gather_ps::<4>(arr.as_ptr(), _mm_setr_epi64x(0, 16));
+ assert_eq_m128(r, _mm_setr_ps(0.0, 16.0, 0.0, 0.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_mask_i64gather_ps() {
+ let mut arr = [0.0f32; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 4 is word-addressing for f32s
+ let r = _mm_mask_i64gather_ps::<4>(
+ _mm_set1_ps(256.0),
+ arr.as_ptr(),
+ _mm_setr_epi64x(0, 16),
+ _mm_setr_ps(-1.0, 0.0, -1.0, 0.0),
+ );
+ assert_eq_m128(r, _mm_setr_ps(0.0, 256.0, 0.0, 0.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_i64gather_ps() {
+ let mut arr = [0.0f32; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 4 is word-addressing for f32s
+ let r = _mm256_i64gather_ps::<4>(arr.as_ptr(), _mm256_setr_epi64x(0, 16, 32, 48));
+ assert_eq_m128(r, _mm_setr_ps(0.0, 16.0, 32.0, 48.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mask_i64gather_ps() {
+ let mut arr = [0.0f32; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 4 is word-addressing for f32s
+ let r = _mm256_mask_i64gather_ps::<4>(
+ _mm_set1_ps(256.0),
+ arr.as_ptr(),
+ _mm256_setr_epi64x(0, 16, 64, 96),
+ _mm_setr_ps(-1.0, -1.0, -1.0, 0.0),
+ );
+ assert_eq_m128(r, _mm_setr_ps(0.0, 16.0, 64.0, 256.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_i64gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing for i64s
+ let r = _mm_i64gather_epi64::<8>(arr.as_ptr(), _mm_setr_epi64x(0, 16));
+ assert_eq_m128i(r, _mm_setr_epi64x(0, 16));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_mask_i64gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing for i64s
+ let r = _mm_mask_i64gather_epi64::<8>(
+ _mm_set1_epi64x(256),
+ arr.as_ptr(),
+ _mm_setr_epi64x(16, 16),
+ _mm_setr_epi64x(-1, 0),
+ );
+ assert_eq_m128i(r, _mm_setr_epi64x(16, 256));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_i64gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing for i64s
+ let r = _mm256_i64gather_epi64::<8>(arr.as_ptr(), _mm256_setr_epi64x(0, 16, 32, 48));
+ assert_eq_m256i(r, _mm256_setr_epi64x(0, 16, 32, 48));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mask_i64gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing for i64s
+ let r = _mm256_mask_i64gather_epi64::<8>(
+ _mm256_set1_epi64x(256),
+ arr.as_ptr(),
+ _mm256_setr_epi64x(0, 16, 64, 96),
+ _mm256_setr_epi64x(-1, -1, -1, 0),
+ );
+ assert_eq_m256i(r, _mm256_setr_epi64x(0, 16, 64, 256));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_i64gather_pd() {
+ let mut arr = [0.0f64; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 8 is word-addressing for f64s
+ let r = _mm_i64gather_pd::<8>(arr.as_ptr(), _mm_setr_epi64x(0, 16));
+ assert_eq_m128d(r, _mm_setr_pd(0.0, 16.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm_mask_i64gather_pd() {
+ let mut arr = [0.0f64; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 8 is word-addressing for f64s
+ let r = _mm_mask_i64gather_pd::<8>(
+ _mm_set1_pd(256.0),
+ arr.as_ptr(),
+ _mm_setr_epi64x(16, 16),
+ _mm_setr_pd(-1.0, 0.0),
+ );
+ assert_eq_m128d(r, _mm_setr_pd(16.0, 256.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_i64gather_pd() {
+ let mut arr = [0.0f64; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 8 is word-addressing for f64s
+ let r = _mm256_i64gather_pd::<8>(arr.as_ptr(), _mm256_setr_epi64x(0, 16, 32, 48));
+ assert_eq_m256d(r, _mm256_setr_pd(0.0, 16.0, 32.0, 48.0));
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_mask_i64gather_pd() {
+ let mut arr = [0.0f64; 128];
+ let mut j = 0.0;
+ for i in 0..128usize {
+ arr[i] = j;
+ j += 1.0;
+ }
+ // A multiplier of 8 is word-addressing for f64s
+ let r = _mm256_mask_i64gather_pd::<8>(
+ _mm256_set1_pd(256.0),
+ arr.as_ptr(),
+ _mm256_setr_epi64x(0, 16, 64, 96),
+ _mm256_setr_pd(-1.0, -1.0, -1.0, 0.0),
+ );
+ assert_eq_m256d(r, _mm256_setr_pd(0.0, 16.0, 64.0, 256.0));
+ }
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_extract_epi8() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi8(
+ -1, 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 r1 = _mm256_extract_epi8::<0>(a);
+ let r2 = _mm256_extract_epi8::<3>(a);
+ assert_eq!(r1, 0xFF);
+ assert_eq!(r2, 3);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_extract_epi16() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi16(
+ -1, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ let r1 = _mm256_extract_epi16::<0>(a);
+ let r2 = _mm256_extract_epi16::<3>(a);
+ assert_eq!(r1, 0xFFFF);
+ assert_eq!(r2, 3);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_extract_epi32() {
+ let a = _mm256_setr_epi32(-1, 1, 2, 3, 4, 5, 6, 7);
+ let r1 = _mm256_extract_epi32::<0>(a);
+ let r2 = _mm256_extract_epi32::<3>(a);
+ assert_eq!(r1, -1);
+ assert_eq!(r2, 3);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtsd_f64() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let r = _mm256_cvtsd_f64(a);
+ assert_eq!(r, 1.);
+ }
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_cvtsi256_si32() {
+ let a = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_cvtsi256_si32(a);
+ assert_eq!(r, 1);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512bf16.rs b/library/stdarch/crates/core_arch/src/x86/avx512bf16.rs
new file mode 100644
index 000000000..e9977e018
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512bf16.rs
@@ -0,0 +1,1573 @@
+//! [AVX512BF16 intrinsics].
+//!
+//! [AVX512BF16 intrinsics]: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769&avx512techs=AVX512_BF16
+
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.avx512bf16.cvtne2ps2bf16.128"]
+ fn cvtne2ps2bf16(a: f32x4, b: f32x4) -> i16x8;
+ #[link_name = "llvm.x86.avx512bf16.cvtne2ps2bf16.256"]
+ fn cvtne2ps2bf16_256(a: f32x8, b: f32x8) -> i16x16;
+ #[link_name = "llvm.x86.avx512bf16.cvtne2ps2bf16.512"]
+ fn cvtne2ps2bf16_512(a: f32x16, b: f32x16) -> i16x32;
+ #[link_name = "llvm.x86.avx512bf16.cvtneps2bf16.256"]
+ fn cvtneps2bf16_256(a: f32x8) -> i16x8;
+ #[link_name = "llvm.x86.avx512bf16.cvtneps2bf16.512"]
+ fn cvtneps2bf16_512(a: f32x16) -> i16x16;
+ #[link_name = "llvm.x86.avx512bf16.dpbf16ps.128"]
+ fn dpbf16ps(a: f32x4, b: i32x4, c: i32x4) -> f32x4;
+ #[link_name = "llvm.x86.avx512bf16.dpbf16ps.256"]
+ fn dpbf16ps_256(a: f32x8, b: i32x8, c: i32x8) -> f32x8;
+ #[link_name = "llvm.x86.avx512bf16.dpbf16ps.512"]
+ fn dpbf16ps_512(a: f32x16, b: i32x16, c: i32x16) -> f32x16;
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in two 128-bit vectors
+/// a and b to packed BF16 (16-bit) floating-point elements, and store the results in a
+/// 128-bit wide vector.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651&avx512techs=AVX512_BF16&text=_mm_cvtne2ps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vcvtne2ps2bf16"))]
+pub unsafe fn _mm_cvtne2ps_pbh(a: __m128, b: __m128) -> __m128bh {
+ transmute(cvtne2ps2bf16(a.as_f32x4(), b.as_f32x4()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in two vectors
+/// a and b to packed BF16 (16-bit) floating-point elements, and store the results
+/// in single vector dst using writemask k (elements are copied from src when the
+/// corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651&avx512techs=AVX512_BF16&text=_mm_mask_cvtne2ps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vcvtne2ps2bf16"))]
+pub unsafe fn _mm_mask_cvtne2ps_pbh(src: __m128bh, k: __mmask8, a: __m128, b: __m128) -> __m128bh {
+ let cvt = _mm_cvtne2ps_pbh(a, b).as_u16x8();
+ transmute(simd_select_bitmask(k, cvt, src.as_u16x8()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in two vectors
+/// a and b to packed BF16 (16-bit) floating-point elements, and store the results
+/// in single vector dst using zeromask k (elements are zeroed out when the corresponding
+/// mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651&avx512techs=AVX512_BF16&text=_mm_maskz_cvtne2ps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vcvtne2ps2bf16"))]
+pub unsafe fn _mm_maskz_cvtne2ps_pbh(k: __mmask8, a: __m128, b: __m128) -> __m128bh {
+ let cvt = _mm_cvtne2ps_pbh(a, b).as_u16x8();
+ let zero = _mm_setzero_si128().as_u16x8();
+ transmute(simd_select_bitmask(k, cvt, zero))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in two 256-bit vectors
+/// a and b to packed BF16 (16-bit) floating-point elements, and store the results in a
+/// 256-bit wide vector.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654&avx512techs=AVX512_BF16&text=_mm256_cvtne2ps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vcvtne2ps2bf16"))]
+pub unsafe fn _mm256_cvtne2ps_pbh(a: __m256, b: __m256) -> __m256bh {
+ transmute(cvtne2ps2bf16_256(a.as_f32x8(), b.as_f32x8()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in two vectors a and b
+/// to packed BF16 (16-bit) floating-point elements and and store the results in single vector
+/// dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654&avx512techs=AVX512_BF16&text=_mm256_mask_cvtne2ps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vcvtne2ps2bf16"))]
+pub unsafe fn _mm256_mask_cvtne2ps_pbh(
+ src: __m256bh,
+ k: __mmask16,
+ a: __m256,
+ b: __m256,
+) -> __m256bh {
+ let cvt = _mm256_cvtne2ps_pbh(a, b).as_u16x16();
+ transmute(simd_select_bitmask(k, cvt, src.as_u16x16()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in two vectors a and b
+/// to packed BF16 (16-bit) floating-point elements, and store the results in single vector
+/// dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654&avx512techs=AVX512_BF16&text=_mm256_maskz_cvtne2ps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vcvtne2ps2bf16"))]
+pub unsafe fn _mm256_maskz_cvtne2ps_pbh(k: __mmask16, a: __m256, b: __m256) -> __m256bh {
+ let cvt = _mm256_cvtne2ps_pbh(a, b).as_u16x16();
+ let zero = _mm256_setzero_si256().as_u16x16();
+ transmute(simd_select_bitmask(k, cvt, zero))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in two 512-bit vectors
+/// a and b to packed BF16 (16-bit) floating-point elements, and store the results in a
+/// 512-bit wide vector.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657&avx512techs=AVX512_BF16&text=_mm512_cvtne2ps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512f")]
+#[cfg_attr(test, assert_instr("vcvtne2ps2bf16"))]
+pub unsafe fn _mm512_cvtne2ps_pbh(a: __m512, b: __m512) -> __m512bh {
+ transmute(cvtne2ps2bf16_512(a.as_f32x16(), b.as_f32x16()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in two vectors
+/// a and b to packed BF16 (16-bit) floating-point elements, and store the results
+/// in single vector dst using writemask k (elements are copied from src when the
+/// corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657&avx512techs=AVX512_BF16&text=_mm512_mask_cvtne2ps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512f")]
+#[cfg_attr(test, assert_instr("vcvtne2ps2bf16"))]
+pub unsafe fn _mm512_mask_cvtne2ps_pbh(
+ src: __m512bh,
+ k: __mmask32,
+ a: __m512,
+ b: __m512,
+) -> __m512bh {
+ let cvt = _mm512_cvtne2ps_pbh(a, b).as_u16x32();
+ transmute(simd_select_bitmask(k, cvt, src.as_u16x32()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in two vectors
+/// a and b to packed BF16 (16-bit) floating-point elements, and store the results
+/// in single vector dst using zeromask k (elements are zeroed out when the corresponding
+/// mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657&avx512techs=AVX512_BF16&text=_mm512_maskz_cvtne2ps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512f")]
+#[cfg_attr(test, assert_instr("vcvtne2ps2bf16"))]
+pub unsafe fn _mm512_maskz_cvtne2ps_pbh(k: __mmask32, a: __m512, b: __m512) -> __m512bh {
+ let cvt = _mm512_cvtne2ps_pbh(a, b).as_u16x32();
+ let zero = _mm512_setzero_si512().as_u16x32();
+ transmute(simd_select_bitmask(k, cvt, zero))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed BF16 (16-bit)
+/// floating-point elements, and store the results in dst.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm256_cvtneps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vcvtneps2bf16"))]
+pub unsafe fn _mm256_cvtneps_pbh(a: __m256) -> __m128bh {
+ transmute(cvtneps2bf16_256(a.as_f32x8()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed BF16 (16-bit)
+/// floating-point elements, and store the results in dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm256_mask_cvtneps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vcvtneps2bf16"))]
+pub unsafe fn _mm256_mask_cvtneps_pbh(src: __m128bh, k: __mmask8, a: __m256) -> __m128bh {
+ let cvt = _mm256_cvtneps_pbh(a).as_u16x8();
+ transmute(simd_select_bitmask(k, cvt, src.as_u16x8()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed BF16 (16-bit)
+/// floating-point elements, and store the results in dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm256_maskz_cvtneps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vcvtneps2bf16"))]
+pub unsafe fn _mm256_maskz_cvtneps_pbh(k: __mmask8, a: __m256) -> __m128bh {
+ let cvt = _mm256_cvtneps_pbh(a).as_u16x8();
+ let zero = _mm_setzero_si128().as_u16x8();
+ transmute(simd_select_bitmask(k, cvt, zero))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed BF16 (16-bit)
+/// floating-point elements, and store the results in dst.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm512_cvtneps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512f")]
+#[cfg_attr(test, assert_instr("vcvtneps2bf16"))]
+pub unsafe fn _mm512_cvtneps_pbh(a: __m512) -> __m256bh {
+ transmute(cvtneps2bf16_512(a.as_f32x16()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed BF16 (16-bit)
+/// floating-point elements, and store the results in dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm512_mask_cvtneps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512f")]
+#[cfg_attr(test, assert_instr("vcvtneps2bf16"))]
+pub unsafe fn _mm512_mask_cvtneps_pbh(src: __m256bh, k: __mmask16, a: __m512) -> __m256bh {
+ let cvt = _mm512_cvtneps_pbh(a).as_u16x16();
+ transmute(simd_select_bitmask(k, cvt, src.as_u16x16()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed BF16 (16-bit)
+/// floating-point elements, and store the results in dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm512_maskz_cvtneps_pbh)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512f")]
+#[cfg_attr(test, assert_instr("vcvtneps2bf16"))]
+pub unsafe fn _mm512_maskz_cvtneps_pbh(k: __mmask16, a: __m512) -> __m256bh {
+ let cvt = _mm512_cvtneps_pbh(a).as_u16x16();
+ let zero = _mm256_setzero_si256().as_u16x16();
+ transmute(simd_select_bitmask(k, cvt, zero))
+}
+
+/// Compute dot-product of BF16 (16-bit) floating-point pairs in a and b,
+/// accumulating the intermediate single-precision (32-bit) floating-point elements
+/// with elements in src, and store the results in dst.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm_dpbf16_ps)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vdpbf16ps"))]
+pub unsafe fn _mm_dpbf16_ps(src: __m128, a: __m128bh, b: __m128bh) -> __m128 {
+ transmute(dpbf16ps(src.as_f32x4(), a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compute dot-product of BF16 (16-bit) floating-point pairs in a and b,
+/// accumulating the intermediate single-precision (32-bit) floating-point elements
+/// with elements in src, and store the results in dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm_mask_dpbf16_ps)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vdpbf16ps"))]
+pub unsafe fn _mm_mask_dpbf16_ps(src: __m128, k: __mmask8, a: __m128bh, b: __m128bh) -> __m128 {
+ let rst = _mm_dpbf16_ps(src, a, b).as_f32x4();
+ transmute(simd_select_bitmask(k, rst, src.as_f32x4()))
+}
+
+/// Compute dot-product of BF16 (16-bit) floating-point pairs in a and b,
+/// accumulating the intermediate single-precision (32-bit) floating-point elements
+/// with elements in src, and store the results in dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm_maskz_dpbf16_ps)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vdpbf16ps"))]
+pub unsafe fn _mm_maskz_dpbf16_ps(k: __mmask8, src: __m128, a: __m128bh, b: __m128bh) -> __m128 {
+ let rst = _mm_dpbf16_ps(src, a, b).as_f32x4();
+ let zero = _mm_set1_ps(0.0_f32).as_f32x4();
+ transmute(simd_select_bitmask(k, rst, zero))
+}
+
+/// Compute dot-product of BF16 (16-bit) floating-point pairs in a and b,
+/// accumulating the intermediate single-precision (32-bit) floating-point elements
+/// with elements in src, and store the results in dst.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm256_dpbf16_ps)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vdpbf16ps"))]
+pub unsafe fn _mm256_dpbf16_ps(src: __m256, a: __m256bh, b: __m256bh) -> __m256 {
+ transmute(dpbf16ps_256(src.as_f32x8(), a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compute dot-product of BF16 (16-bit) floating-point pairs in a and b,
+/// accumulating the intermediate single-precision (32-bit) floating-point elements
+/// with elements in src, and store the results in dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm256_mask_dpbf16_ps)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vdpbf16ps"))]
+pub unsafe fn _mm256_mask_dpbf16_ps(src: __m256, k: __mmask8, a: __m256bh, b: __m256bh) -> __m256 {
+ let rst = _mm256_dpbf16_ps(src, a, b).as_f32x8();
+ transmute(simd_select_bitmask(k, rst, src.as_f32x8()))
+}
+
+/// Compute dot-product of BF16 (16-bit) floating-point pairs in a and b,
+/// accumulating the intermediate single-precision (32-bit) floating-point elements
+/// with elements in src, and store the results in dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm256_maskz_dpbf16_ps)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512vl")]
+#[cfg_attr(test, assert_instr("vdpbf16ps"))]
+pub unsafe fn _mm256_maskz_dpbf16_ps(k: __mmask8, src: __m256, a: __m256bh, b: __m256bh) -> __m256 {
+ let rst = _mm256_dpbf16_ps(src, a, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, rst, zero))
+}
+
+/// Compute dot-product of BF16 (16-bit) floating-point pairs in a and b,
+/// accumulating the intermediate single-precision (32-bit) floating-point elements
+/// with elements in src, and store the results in dst.Compute dot-product of BF16 (16-bit)
+/// floating-point pairs in a and b, accumulating the intermediate single-precision (32-bit)
+/// floating-point elements with elements in src, and store the results in dst.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm512_dpbf16_ps)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512f")]
+#[cfg_attr(test, assert_instr("vdpbf16ps"))]
+pub unsafe fn _mm512_dpbf16_ps(src: __m512, a: __m512bh, b: __m512bh) -> __m512 {
+ transmute(dpbf16ps_512(src.as_f32x16(), a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compute dot-product of BF16 (16-bit) floating-point pairs in a and b,
+/// accumulating the intermediate single-precision (32-bit) floating-point elements
+/// with elements in src, and store the results in dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm512_mask_dpbf16_ps)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512f")]
+#[cfg_attr(test, assert_instr("vdpbf16ps"))]
+pub unsafe fn _mm512_mask_dpbf16_ps(src: __m512, k: __mmask16, a: __m512bh, b: __m512bh) -> __m512 {
+ let rst = _mm512_dpbf16_ps(src, a, b).as_f32x16();
+ transmute(simd_select_bitmask(k, rst, src.as_f32x16()))
+}
+
+/// Compute dot-product of BF16 (16-bit) floating-point pairs in a and b,
+/// accumulating the intermediate single-precision (32-bit) floating-point elements
+/// with elements in src, and store the results in dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769,1651,1654,1657,1660&avx512techs=AVX512_BF16&text=_mm512_maskz_dpbf16_ps)
+#[inline]
+#[target_feature(enable = "avx512bf16,avx512f")]
+#[cfg_attr(test, assert_instr("vdpbf16ps"))]
+pub unsafe fn _mm512_maskz_dpbf16_ps(
+ k: __mmask16,
+ src: __m512,
+ a: __m512bh,
+ b: __m512bh,
+) -> __m512 {
+ let rst = _mm512_dpbf16_ps(src, a, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, rst, zero))
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::{core_arch::x86::*, mem::transmute};
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm_cvtne2ps_pbh() {
+ let a_array = [178.125_f32, 10.5_f32, 3.75_f32, 50.25_f32];
+ let b_array = [-178.125_f32, -10.5_f32, -3.75_f32, -50.25_f32];
+ let a: __m128 = transmute(a_array);
+ let b: __m128 = transmute(b_array);
+ let c: __m128bh = _mm_cvtne2ps_pbh(a, b);
+ let result: [u16; 8] = transmute(c.as_u16x8());
+ #[rustfmt::skip]
+ let expected_result: [u16; 8] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm_mask_cvtne2ps_pbh() {
+ let a_array = [178.125_f32, 10.5_f32, 3.75_f32, 50.25_f32];
+ let b_array = [-178.125_f32, -10.5_f32, -3.75_f32, -50.25_f32];
+ #[rustfmt::skip]
+ let src_array: [u16; 8] = [
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ ];
+ let src: __m128bh = transmute(src_array);
+ let a: __m128 = transmute(a_array);
+ let b: __m128 = transmute(b_array);
+ let k: __mmask8 = 0b1111_1111;
+ let c: __m128bh = _mm_mask_cvtne2ps_pbh(src, k, a, b);
+ let result: [u16; 8] = transmute(c.as_u16x8());
+ #[rustfmt::skip]
+ let expected_result: [u16; 8] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ ];
+ assert_eq!(result, expected_result);
+ let k = 0b0000_0000;
+ let c = _mm_mask_cvtne2ps_pbh(src, k, a, b);
+ let result: [u16; 8] = transmute(c.as_u16x8());
+ let expected_result = src_array;
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm_maskz_cvtne2ps_pbh() {
+ let a_array = [178.125_f32, 10.5_f32, 3.75_f32, 50.25_f32];
+ let b_array = [-178.125_f32, -10.5_f32, -3.75_f32, -50.25_f32];
+ let a: __m128 = transmute(a_array);
+ let b: __m128 = transmute(b_array);
+ let k: __mmask8 = 0b1111_1111;
+ let c: __m128bh = _mm_maskz_cvtne2ps_pbh(k, a, b);
+ let result: [u16; 8] = transmute(c.as_u16x8());
+ #[rustfmt::skip]
+ let expected_result: [u16; 8] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ ];
+ assert_eq!(result, expected_result);
+ let k = 0b0011_1100;
+ let c = _mm_maskz_cvtne2ps_pbh(k, a, b);
+ let result: [u16; 8] = transmute(c.as_u16x8());
+ #[rustfmt::skip]
+ let expected_result: [u16; 8] = [
+ 0,
+ 0,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0,
+ 0,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm256_cvtne2ps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let b_array = [
+ -178.125_f32,
+ -10.5_f32,
+ -3.75_f32,
+ -50.25_f32,
+ -16.5_f32,
+ -255.11_f32,
+ -1000.158_f32,
+ -575.575_f32,
+ ];
+ let a: __m256 = transmute(a_array);
+ let b: __m256 = transmute(b_array);
+ let c: __m256bh = _mm256_cvtne2ps_pbh(a, b);
+ let result: [u16; 16] = transmute(c.as_u16x16());
+ #[rustfmt::skip]
+ let expected_result: [u16; 16] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm256_mask_cvtne2ps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let b_array = [
+ -178.125_f32,
+ -10.5_f32,
+ -3.75_f32,
+ -50.25_f32,
+ -16.5_f32,
+ -255.11_f32,
+ -1000.158_f32,
+ -575.575_f32,
+ ];
+ let src_array: [u16; 16] = [
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ ];
+ let src: __m256bh = transmute(src_array);
+ let a: __m256 = transmute(a_array);
+ let b: __m256 = transmute(b_array);
+ let k: __mmask16 = 0xffff;
+ let c: __m256bh = _mm256_mask_cvtne2ps_pbh(src, k, a, b);
+ let result: [u16; 16] = transmute(c.as_u16x16());
+ #[rustfmt::skip]
+ let expected_result: [u16; 16] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask16 = 0;
+ let c: __m256bh = _mm256_mask_cvtne2ps_pbh(src, k, a, b);
+ let result: [u16; 16] = transmute(c.as_u16x16());
+ let expected_result = src_array;
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtne2ps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let b_array = [
+ -178.125_f32,
+ -10.5_f32,
+ -3.75_f32,
+ -50.25_f32,
+ -16.5_f32,
+ -255.11_f32,
+ -1000.158_f32,
+ -575.575_f32,
+ ];
+ let a: __m256 = transmute(a_array);
+ let b: __m256 = transmute(b_array);
+ let k: __mmask16 = 0xffff;
+ let c: __m256bh = _mm256_maskz_cvtne2ps_pbh(k, a, b);
+ let result: [u16; 16] = transmute(c.as_u16x16());
+ #[rustfmt::skip]
+ let expected_result: [u16; 16] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask16 = 0b0110_1100_0011_0110;
+ let c: __m256bh = _mm256_maskz_cvtne2ps_pbh(k, a, b);
+ let result: [u16; 16] = transmute(c.as_u16x16());
+ #[rustfmt::skip]
+ let expected_result: [u16; 16] = [
+ 0,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512f")]
+ unsafe fn test_mm512_cvtne2ps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let b_array = [
+ -178.125_f32,
+ -10.5_f32,
+ -3.75_f32,
+ -50.25_f32,
+ -16.5_f32,
+ -255.11_f32,
+ -1000.158_f32,
+ -575.575_f32,
+ -178.125_f32,
+ -10.5_f32,
+ -3.75_f32,
+ -50.25_f32,
+ -16.5_f32,
+ -255.11_f32,
+ -1000.158_f32,
+ -575.575_f32,
+ ];
+ let a: __m512 = transmute(a_array);
+ let b: __m512 = transmute(b_array);
+ let c: __m512bh = _mm512_cvtne2ps_pbh(a, b);
+ let result: [u16; 32] = transmute(c.as_u16x32());
+ #[rustfmt::skip]
+ let expected_result: [u16; 32] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512f")]
+ unsafe fn test_mm512_mask_cvtne2ps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let b_array = [
+ -178.125_f32,
+ -10.5_f32,
+ -3.75_f32,
+ -50.25_f32,
+ -16.5_f32,
+ -255.11_f32,
+ -1000.158_f32,
+ -575.575_f32,
+ -178.125_f32,
+ -10.5_f32,
+ -3.75_f32,
+ -50.25_f32,
+ -16.5_f32,
+ -255.11_f32,
+ -1000.158_f32,
+ -575.575_f32,
+ ];
+ let src_array: [u16; 32] = [
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ ];
+ let src: __m512bh = transmute(src_array);
+ let a: __m512 = transmute(a_array);
+ let b: __m512 = transmute(b_array);
+ let k: __mmask32 = 0xffffffff;
+ let c: __m512bh = _mm512_mask_cvtne2ps_pbh(src, k, a, b);
+ let result: [u16; 32] = transmute(c.as_u16x32());
+ #[rustfmt::skip]
+ let expected_result: [u16; 32] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask32 = 0;
+ let c: __m512bh = _mm512_mask_cvtne2ps_pbh(src, k, a, b);
+ let result: [u16; 32] = transmute(c.as_u16x32());
+ let expected_result = src_array;
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512f")]
+ unsafe fn test_mm512_maskz_cvtne2ps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let b_array = [
+ -178.125_f32,
+ -10.5_f32,
+ -3.75_f32,
+ -50.25_f32,
+ -16.5_f32,
+ -255.11_f32,
+ -1000.158_f32,
+ -575.575_f32,
+ -178.125_f32,
+ -10.5_f32,
+ -3.75_f32,
+ -50.25_f32,
+ -16.5_f32,
+ -255.11_f32,
+ -1000.158_f32,
+ -575.575_f32,
+ ];
+ let a: __m512 = transmute(a_array);
+ let b: __m512 = transmute(b_array);
+ let k: __mmask32 = 0xffffffff;
+ let c: __m512bh = _mm512_maskz_cvtne2ps_pbh(k, a, b);
+ let result: [u16; 32] = transmute(c.as_u16x32());
+ #[rustfmt::skip]
+ let expected_result: [u16; 32] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask32 = 0b1100_1010_1001_0110_1010_0011_0101_0110;
+ let c: __m512bh = _mm512_maskz_cvtne2ps_pbh(k, a, b);
+ let result: [u16; 32] = transmute(c.as_u16x32());
+ #[rustfmt::skip]
+ let expected_result: [u16; 32] = [
+ 0,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0,
+ 0b1_10000011_0000100,
+ 0,
+ 0b1_10001000_1111010,
+ 0,
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0,
+ 0,
+ 0,
+ 0b1_10000110_1111111,
+ 0,
+ 0b1_10001000_0010000,
+ 0,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0,
+ 0b0_10000011_0000100,
+ 0,
+ 0,
+ 0b0_10001000_0010000,
+ 0,
+ 0b0_10000010_0101000,
+ 0,
+ 0b0_10000100_1001001,
+ 0,
+ 0,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm256_cvtneps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let a: __m256 = transmute(a_array);
+ let c: __m128bh = _mm256_cvtneps_pbh(a);
+ let result: [u16; 8] = transmute(c.as_u16x8());
+ #[rustfmt::skip]
+ let expected_result: [u16; 8] = [
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm256_mask_cvtneps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let src_array: [u16; 8] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ ];
+ let src: __m128bh = transmute(src_array);
+ let a: __m256 = transmute(a_array);
+ let k: __mmask8 = 0xff;
+ let b = _mm256_mask_cvtneps_pbh(src, k, a);
+ let result: [u16; 8] = transmute(b.as_u16x8());
+ #[rustfmt::skip]
+ let expected_result: [u16; 8] = [
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask8 = 0x0;
+ let b: __m128bh = _mm256_mask_cvtneps_pbh(src, k, a);
+ let result: [u16; 8] = transmute(b.as_u16x8());
+ let expected_result: [u16; 8] = src_array;
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtneps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let a: __m256 = transmute(a_array);
+ let k: __mmask8 = 0xff;
+ let b = _mm256_maskz_cvtneps_pbh(k, a);
+ let result: [u16; 8] = transmute(b.as_u16x8());
+ #[rustfmt::skip]
+ let expected_result: [u16; 8] = [
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask8 = 0x6;
+ let b: __m128bh = _mm256_maskz_cvtneps_pbh(k, a);
+ let result: [u16; 8] = transmute(b.as_u16x8());
+ let expected_result: [u16; 8] =
+ [0, 0b0_10000010_0101000, 0b0_10000000_1110000, 0, 0, 0, 0, 0];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512f")]
+ unsafe fn test_mm512_cvtneps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let a: __m512 = transmute(a_array);
+ let c: __m256bh = _mm512_cvtneps_pbh(a);
+ let result: [u16; 16] = transmute(c.as_u16x16());
+ #[rustfmt::skip]
+ let expected_result: [u16; 16] = [
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512f")]
+ unsafe fn test_mm512_mask_cvtneps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let src_array: [u16; 16] = [
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ 0b1_10000110_0110010,
+ 0b1_10000010_0101000,
+ 0b1_10000000_1110000,
+ 0b1_10000100_1001001,
+ 0b1_10000011_0000100,
+ 0b1_10000110_1111111,
+ 0b1_10001000_1111010,
+ 0b1_10001000_0010000,
+ ];
+ let src: __m256bh = transmute(src_array);
+ let a: __m512 = transmute(a_array);
+ let k: __mmask16 = 0xffff;
+ let c: __m256bh = _mm512_mask_cvtneps_pbh(src, k, a);
+ let result: [u16; 16] = transmute(c.as_u16x16());
+ #[rustfmt::skip]
+ let expected_result: [u16; 16] = [
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask16 = 0;
+ let c: __m256bh = _mm512_mask_cvtneps_pbh(src, k, a);
+ let result: [u16; 16] = transmute(c.as_u16x16());
+ let expected_result = src_array;
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512f")]
+ unsafe fn test_mm512_maskz_cvtneps_pbh() {
+ #[rustfmt::skip]
+ let a_array = [
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ 178.125_f32,
+ 10.5_f32,
+ 3.75_f32,
+ 50.25_f32,
+ 16.5_f32,
+ 255.11_f32,
+ 1000.158_f32,
+ 575.575_f32,
+ ];
+ let a: __m512 = transmute(a_array);
+ let k: __mmask16 = 0xffff;
+ let c: __m256bh = _mm512_maskz_cvtneps_pbh(k, a);
+ let result: [u16; 16] = transmute(c.as_u16x16());
+ #[rustfmt::skip]
+ let expected_result: [u16; 16] = [
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ 0b0_10000110_0110010,
+ 0b0_10000010_0101000,
+ 0b0_10000000_1110000,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0b0_10001000_0010000,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask16 = 0x653a;
+ let c: __m256bh = _mm512_maskz_cvtneps_pbh(k, a);
+ let result: [u16; 16] = transmute(c.as_u16x16());
+ #[rustfmt::skip]
+ let expected_result: [u16; 16] = [
+ 0,
+ 0b0_10000010_0101000,
+ 0,
+ 0b0_10000100_1001001,
+ 0b0_10000011_0000100,
+ 0b0_10000110_1111111,
+ 0,
+ 0,
+ 0b0_10000110_0110010,
+ 0,
+ 0b0_10000000_1110000,
+ 0,
+ 0,
+ 0b0_10000110_1111111,
+ 0b0_10001000_1111010,
+ 0,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm_dpbf16_ps() {
+ let a_array = [8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32];
+ let b_array = [-1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32];
+ let a1: __m128 = transmute(a_array);
+ let b1: __m128 = transmute(b_array);
+ let src: __m128 = transmute([1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32]);
+ let a: __m128bh = _mm_cvtne2ps_pbh(a1, a1);
+ let b: __m128bh = _mm_cvtne2ps_pbh(b1, b1);
+ let c: __m128 = _mm_dpbf16_ps(src, a, b);
+ let result: [f32; 4] = transmute(c.as_f32x4());
+ let expected_result: [f32; 4] = [-18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm_mask_dpbf16_ps() {
+ let a_array = [8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32];
+ let b_array = [-1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32];
+ let a1: __m128 = transmute(a_array);
+ let b1: __m128 = transmute(b_array);
+ let k: __mmask8 = 0xf3;
+ let src: __m128 = transmute([1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32]);
+ let a: __m128bh = _mm_cvtne2ps_pbh(a1, a1);
+ let b: __m128bh = _mm_cvtne2ps_pbh(b1, b1);
+ let c: __m128 = _mm_mask_dpbf16_ps(src, k, a, b);
+ let result: [f32; 4] = transmute(c.as_f32x4());
+ let expected_result: [f32; 4] = [-18.0_f32, -52.0_f32, 3.0_f32, 4.0_f32];
+ assert_eq!(result, expected_result);
+ let k: __mmask8 = 0xff;
+ let c: __m128 = _mm_mask_dpbf16_ps(src, k, a, b);
+ let result: [f32; 4] = transmute(c.as_f32x4());
+ let expected_result: [f32; 4] = [-18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32];
+ assert_eq!(result, expected_result);
+ let k: __mmask8 = 0;
+ let c: __m128 = _mm_mask_dpbf16_ps(src, k, a, b);
+ let result: [f32; 4] = transmute(c.as_f32x4());
+ let expected_result: [f32; 4] = [1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm_maskz_dpbf16_ps() {
+ let a_array = [8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32];
+ let b_array = [-1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32];
+ let a1: __m128 = transmute(a_array);
+ let b1: __m128 = transmute(b_array);
+ let k: __mmask8 = 0xf3;
+ let src: __m128 = transmute([1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32]);
+ let a: __m128bh = _mm_cvtne2ps_pbh(a1, a1);
+ let b: __m128bh = _mm_cvtne2ps_pbh(b1, b1);
+ let c: __m128 = _mm_maskz_dpbf16_ps(k, src, a, b);
+ let result: [f32; 4] = transmute(c.as_f32x4());
+ let expected_result: [f32; 4] = [-18.0_f32, -52.0_f32, 0.0, 0.0];
+ assert_eq!(result, expected_result);
+ let k: __mmask8 = 0xff;
+ let c: __m128 = _mm_maskz_dpbf16_ps(k, src, a, b);
+ let result: [f32; 4] = transmute(c.as_f32x4());
+ let expected_result: [f32; 4] = [-18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32];
+ assert_eq!(result, expected_result);
+ let k: __mmask8 = 0;
+ let c: __m128 = _mm_maskz_dpbf16_ps(k, src, a, b);
+ let result: [f32; 4] = transmute(c.as_f32x4());
+ let expected_result: [f32; 4] = [0.0, 0.0, 0.0, 0.0];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm256_dpbf16_ps() {
+ #[rustfmt::skip]
+ let a_array = [
+ 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32, 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32,
+ ];
+ let b_array = [
+ -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
+ ];
+ let a1: __m256 = transmute(a_array);
+ let b1: __m256 = transmute(b_array);
+ #[rustfmt::skip]
+ let src: __m256 = transmute([
+ 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32,
+ ]);
+ let a: __m256bh = _mm256_cvtne2ps_pbh(a1, a1);
+ let b: __m256bh = _mm256_cvtne2ps_pbh(b1, b1);
+ let c: __m256 = _mm256_dpbf16_ps(src, a, b);
+ let result: [f32; 8] = transmute(c.as_f32x8());
+ #[rustfmt::skip]
+ let expected_result: [f32; 8] = [
+ -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32, -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm256_mask_dpbf16_ps() {
+ #[rustfmt::skip]
+ let a_array = [
+ 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32, 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32,
+ ];
+ let b_array = [
+ -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
+ ];
+ let a1: __m256 = transmute(a_array);
+ let b1: __m256 = transmute(b_array);
+ let k: __mmask8 = 0x33;
+ #[rustfmt::skip]
+ let src: __m256 = transmute([
+ 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32,
+ ]);
+ let a: __m256bh = _mm256_cvtne2ps_pbh(a1, a1);
+ let b: __m256bh = _mm256_cvtne2ps_pbh(b1, b1);
+ let c: __m256 = _mm256_mask_dpbf16_ps(src, k, a, b);
+ let result: [f32; 8] = transmute(c.as_f32x8());
+ #[rustfmt::skip]
+ let expected_result: [f32; 8] = [
+ -18.0_f32, -52.0_f32, 3.0_f32, 4.0_f32, -18.0_f32, -52.0_f32, 3.0_f32, 4.0_f32,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask8 = 0xff;
+ let c: __m256 = _mm256_mask_dpbf16_ps(src, k, a, b);
+ let result: [f32; 8] = transmute(c.as_f32x8());
+ #[rustfmt::skip]
+ let expected_result: [f32; 8] = [
+ -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32, -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask8 = 0;
+ let c: __m256 = _mm256_mask_dpbf16_ps(src, k, a, b);
+ let result: [f32; 8] = transmute(c.as_f32x8());
+ #[rustfmt::skip]
+ let expected_result: [f32; 8] = [
+ 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512vl")]
+ unsafe fn test_mm256_maskz_dpbf16_ps() {
+ #[rustfmt::skip]
+ let a_array = [
+ 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32, 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32,
+ ];
+ let b_array = [
+ -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
+ ];
+ let a1: __m256 = transmute(a_array);
+ let b1: __m256 = transmute(b_array);
+ let k: __mmask8 = 0x33;
+ #[rustfmt::skip]
+ let src: __m256 = transmute([
+ 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32,
+ ]);
+ let a: __m256bh = _mm256_cvtne2ps_pbh(a1, a1);
+ let b: __m256bh = _mm256_cvtne2ps_pbh(b1, b1);
+ let c: __m256 = _mm256_maskz_dpbf16_ps(k, src, a, b);
+ let result: [f32; 8] = transmute(c.as_f32x8());
+ #[rustfmt::skip]
+ let expected_result: [f32; 8] = [
+ -18.0_f32, -52.0_f32, 0.0, 0.0, -18.0_f32, -52.0_f32, 0.0, 0.0,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask8 = 0xff;
+ let c: __m256 = _mm256_maskz_dpbf16_ps(k, src, a, b);
+ let result: [f32; 8] = transmute(c.as_f32x8());
+ #[rustfmt::skip]
+ let expected_result: [f32; 8] = [
+ -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32, -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask8 = 0;
+ let c: __m256 = _mm256_maskz_dpbf16_ps(k, src, a, b);
+ let result: [f32; 8] = transmute(c.as_f32x8());
+ let expected_result: [f32; 8] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512f")]
+ unsafe fn test_mm512_dpbf16_ps() {
+ #[rustfmt::skip]
+ let a_array = [
+ 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32, 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32,
+ 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32, 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32,
+ ];
+ let b_array = [
+ -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
+ -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
+ ];
+ let a1: __m512 = transmute(a_array);
+ let b1: __m512 = transmute(b_array);
+ let src: __m512 = transmute([
+ 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32,
+ 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32,
+ ]);
+ let a: __m512bh = _mm512_cvtne2ps_pbh(a1, a1);
+ let b: __m512bh = _mm512_cvtne2ps_pbh(b1, b1);
+ let c: __m512 = _mm512_dpbf16_ps(src, a, b);
+ let result: [f32; 16] = transmute(c.as_f32x16());
+ #[rustfmt::skip]
+ let expected_result: [f32; 16] = [
+ -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32, -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32,
+ -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32, -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512f")]
+ unsafe fn test_mm512_mask_dpbf16_ps() {
+ #[rustfmt::skip]
+ let a_array = [
+ 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32, 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32,
+ 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32, 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32,
+ ];
+ let b_array = [
+ -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
+ -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
+ ];
+ let a1: __m512 = transmute(a_array);
+ let b1: __m512 = transmute(b_array);
+ let k: __mmask16 = 0x3333;
+ #[rustfmt::skip]
+ let src: __m512 = transmute([
+ 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32,
+ 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32,
+ ]);
+ let a: __m512bh = _mm512_cvtne2ps_pbh(a1, a1);
+ let b: __m512bh = _mm512_cvtne2ps_pbh(b1, b1);
+ let c: __m512 = _mm512_mask_dpbf16_ps(src, k, a, b);
+ let result: [f32; 16] = transmute(c.as_f32x16());
+ #[rustfmt::skip]
+ let expected_result: [f32; 16] = [
+ -18.0_f32, -52.0_f32, 3.0_f32, 4.0_f32, -18.0_f32, -52.0_f32, 3.0_f32, 4.0_f32,
+ -18.0_f32, -52.0_f32, 3.0_f32, 4.0_f32, -18.0_f32, -52.0_f32, 3.0_f32, 4.0_f32,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask16 = 0xffff;
+ let c: __m512 = _mm512_mask_dpbf16_ps(src, k, a, b);
+ let result: [f32; 16] = transmute(c.as_f32x16());
+ #[rustfmt::skip]
+ let expected_result: [f32; 16] = [
+ -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32, -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32,
+ -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32, -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask16 = 0;
+ let c: __m512 = _mm512_mask_dpbf16_ps(src, k, a, b);
+ let result: [f32; 16] = transmute(c.as_f32x16());
+ #[rustfmt::skip]
+ let expected_result: [f32; 16] = [
+ 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32,
+ 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32,
+ ];
+ assert_eq!(result, expected_result);
+ }
+
+ #[simd_test(enable = "avx512bf16,avx512f")]
+ unsafe fn test_mm512_maskz_dpbf16_ps() {
+ #[rustfmt::skip]
+ let a_array = [
+ 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32, 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32,
+ 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32, 8.5_f32, 10.5_f32, 3.75_f32, 50.25_f32,
+ ];
+ let b_array = [
+ -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
+ -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32, -1.0_f32,
+ ];
+ let a1: __m512 = transmute(a_array);
+ let b1: __m512 = transmute(b_array);
+ let k: __mmask16 = 0x3333;
+ #[rustfmt::skip]
+ let src: __m512 = transmute([
+ 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32,
+ 2.0_f32, 3.0_f32, 4.0_f32, 1.0_f32, 2.0_f32, 3.0_f32, 4.0_f32,
+ ]);
+ let a: __m512bh = _mm512_cvtne2ps_pbh(a1, a1);
+ let b: __m512bh = _mm512_cvtne2ps_pbh(b1, b1);
+ let c: __m512 = _mm512_maskz_dpbf16_ps(k, src, a, b);
+ let result: [f32; 16] = transmute(c.as_f32x16());
+ #[rustfmt::skip]
+ let expected_result: [f32; 16] = [
+ -18.0_f32, -52.0_f32, 0.0, 0.0, -18.0_f32, -52.0_f32, 0.0, 0.0, -18.0_f32, -52.0_f32,
+ 0.0, 0.0, -18.0_f32, -52.0_f32, 0.0, 0.0,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask16 = 0xffff;
+ let c: __m512 = _mm512_maskz_dpbf16_ps(k, src, a, b);
+ let result: [f32; 16] = transmute(c.as_f32x16());
+ #[rustfmt::skip]
+ let expected_result: [f32; 16] = [
+ -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32, -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32,
+ -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32, -18.0_f32, -52.0_f32, -16.0_f32, -50.0_f32,
+ ];
+ assert_eq!(result, expected_result);
+ let k: __mmask16 = 0;
+ let c: __m512 = _mm512_maskz_dpbf16_ps(k, src, a, b);
+ let result: [f32; 16] = transmute(c.as_f32x16());
+ #[rustfmt::skip]
+ let expected_result: [f32; 16] = [
+ 0.0, 0.0, 0.0, 0.0, 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!(result, expected_result);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512bitalg.rs b/library/stdarch/crates/core_arch/src/x86/avx512bitalg.rs
new file mode 100644
index 000000000..3c9df3912
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512bitalg.rs
@@ -0,0 +1,760 @@
+//! Bit-oriented Algorithms (BITALG)
+//!
+//! The intrinsics here correspond to those in the `immintrin.h` C header.
+//!
+//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
+//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref].
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+
+use crate::core_arch::simd::i16x16;
+use crate::core_arch::simd::i16x32;
+use crate::core_arch::simd::i16x8;
+use crate::core_arch::simd::i8x16;
+use crate::core_arch::simd::i8x32;
+use crate::core_arch::simd::i8x64;
+use crate::core_arch::simd_llvm::simd_select_bitmask;
+use crate::core_arch::x86::__m128i;
+use crate::core_arch::x86::__m256i;
+use crate::core_arch::x86::__m512i;
+use crate::core_arch::x86::__mmask16;
+use crate::core_arch::x86::__mmask32;
+use crate::core_arch::x86::__mmask64;
+use crate::core_arch::x86::__mmask8;
+use crate::core_arch::x86::_mm256_setzero_si256;
+use crate::core_arch::x86::_mm512_setzero_si512;
+use crate::core_arch::x86::_mm_setzero_si128;
+use crate::core_arch::x86::m128iExt;
+use crate::core_arch::x86::m256iExt;
+use crate::core_arch::x86::m512iExt;
+use crate::mem::transmute;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.ctpop.v32i16"]
+ fn popcnt_v32i16(x: i16x32) -> i16x32;
+ #[link_name = "llvm.ctpop.v16i16"]
+ fn popcnt_v16i16(x: i16x16) -> i16x16;
+ #[link_name = "llvm.ctpop.v8i16"]
+ fn popcnt_v8i16(x: i16x8) -> i16x8;
+
+ #[link_name = "llvm.ctpop.v64i8"]
+ fn popcnt_v64i8(x: i8x64) -> i8x64;
+ #[link_name = "llvm.ctpop.v32i8"]
+ fn popcnt_v32i8(x: i8x32) -> i8x32;
+ #[link_name = "llvm.ctpop.v16i8"]
+ fn popcnt_v16i8(x: i8x16) -> i8x16;
+
+ #[link_name = "llvm.x86.avx512.mask.vpshufbitqmb.512"]
+ fn bitshuffle_512(data: i8x64, indices: i8x64, mask: __mmask64) -> __mmask64;
+ #[link_name = "llvm.x86.avx512.mask.vpshufbitqmb.256"]
+ fn bitshuffle_256(data: i8x32, indices: i8x32, mask: __mmask32) -> __mmask32;
+ #[link_name = "llvm.x86.avx512.mask.vpshufbitqmb.128"]
+ fn bitshuffle_128(data: i8x16, indices: i8x16, mask: __mmask16) -> __mmask16;
+}
+
+/// For each packed 16-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_popcnt_epi16)
+#[inline]
+#[target_feature(enable = "avx512bitalg")]
+#[cfg_attr(test, assert_instr(vpopcntw))]
+pub unsafe fn _mm512_popcnt_epi16(a: __m512i) -> __m512i {
+ transmute(popcnt_v32i16(a.as_i16x32()))
+}
+
+/// For each packed 16-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_popcnt_epi16)
+#[inline]
+#[target_feature(enable = "avx512bitalg")]
+#[cfg_attr(test, assert_instr(vpopcntw))]
+pub unsafe fn _mm512_maskz_popcnt_epi16(k: __mmask32, a: __m512i) -> __m512i {
+ let zero = _mm512_setzero_si512().as_i16x32();
+ transmute(simd_select_bitmask(k, popcnt_v32i16(a.as_i16x32()), zero))
+}
+
+/// For each packed 16-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_popcnt_epi16)
+#[inline]
+#[target_feature(enable = "avx512bitalg")]
+#[cfg_attr(test, assert_instr(vpopcntw))]
+pub unsafe fn _mm512_mask_popcnt_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v32i16(a.as_i16x32()),
+ src.as_i16x32(),
+ ))
+}
+
+/// For each packed 16-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_popcnt_epi16)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntw))]
+pub unsafe fn _mm256_popcnt_epi16(a: __m256i) -> __m256i {
+ transmute(popcnt_v16i16(a.as_i16x16()))
+}
+
+/// For each packed 16-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_popcnt_epi16)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntw))]
+pub unsafe fn _mm256_maskz_popcnt_epi16(k: __mmask16, a: __m256i) -> __m256i {
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, popcnt_v16i16(a.as_i16x16()), zero))
+}
+
+/// For each packed 16-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_popcnt_epi16)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntw))]
+pub unsafe fn _mm256_mask_popcnt_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v16i16(a.as_i16x16()),
+ src.as_i16x16(),
+ ))
+}
+
+/// For each packed 16-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_popcnt_epi16)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntw))]
+pub unsafe fn _mm_popcnt_epi16(a: __m128i) -> __m128i {
+ transmute(popcnt_v8i16(a.as_i16x8()))
+}
+
+/// For each packed 16-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_popcnt_epi16)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntw))]
+pub unsafe fn _mm_maskz_popcnt_epi16(k: __mmask8, a: __m128i) -> __m128i {
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, popcnt_v8i16(a.as_i16x8()), zero))
+}
+
+/// For each packed 16-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_popcnt_epi16)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntw))]
+pub unsafe fn _mm_mask_popcnt_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v8i16(a.as_i16x8()),
+ src.as_i16x8(),
+ ))
+}
+
+/// For each packed 8-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_popcnt_epi8)
+#[inline]
+#[target_feature(enable = "avx512bitalg")]
+#[cfg_attr(test, assert_instr(vpopcntb))]
+pub unsafe fn _mm512_popcnt_epi8(a: __m512i) -> __m512i {
+ transmute(popcnt_v64i8(a.as_i8x64()))
+}
+
+/// For each packed 8-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_popcnt_epi8)
+#[inline]
+#[target_feature(enable = "avx512bitalg")]
+#[cfg_attr(test, assert_instr(vpopcntb))]
+pub unsafe fn _mm512_maskz_popcnt_epi8(k: __mmask64, a: __m512i) -> __m512i {
+ let zero = _mm512_setzero_si512().as_i8x64();
+ transmute(simd_select_bitmask(k, popcnt_v64i8(a.as_i8x64()), zero))
+}
+
+/// For each packed 8-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_popcnt_epi8)
+#[inline]
+#[target_feature(enable = "avx512bitalg")]
+#[cfg_attr(test, assert_instr(vpopcntb))]
+pub unsafe fn _mm512_mask_popcnt_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v64i8(a.as_i8x64()),
+ src.as_i8x64(),
+ ))
+}
+
+/// For each packed 8-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_popcnt_epi8)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntb))]
+pub unsafe fn _mm256_popcnt_epi8(a: __m256i) -> __m256i {
+ transmute(popcnt_v32i8(a.as_i8x32()))
+}
+
+/// For each packed 8-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_popcnt_epi8)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntb))]
+pub unsafe fn _mm256_maskz_popcnt_epi8(k: __mmask32, a: __m256i) -> __m256i {
+ let zero = _mm256_setzero_si256().as_i8x32();
+ transmute(simd_select_bitmask(k, popcnt_v32i8(a.as_i8x32()), zero))
+}
+
+/// For each packed 8-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_popcnt_epi8)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntb))]
+pub unsafe fn _mm256_mask_popcnt_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v32i8(a.as_i8x32()),
+ src.as_i8x32(),
+ ))
+}
+
+/// For each packed 8-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_popcnt_epi8)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntb))]
+pub unsafe fn _mm_popcnt_epi8(a: __m128i) -> __m128i {
+ transmute(popcnt_v16i8(a.as_i8x16()))
+}
+
+/// For each packed 8-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_popcnt_epi8)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntb))]
+pub unsafe fn _mm_maskz_popcnt_epi8(k: __mmask16, a: __m128i) -> __m128i {
+ let zero = _mm_setzero_si128().as_i8x16();
+ transmute(simd_select_bitmask(k, popcnt_v16i8(a.as_i8x16()), zero))
+}
+
+/// For each packed 8-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_popcnt_epi8)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntb))]
+pub unsafe fn _mm_mask_popcnt_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v16i8(a.as_i8x16()),
+ src.as_i8x16(),
+ ))
+}
+
+/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
+/// Then groups 8 8-bit values from `c`as indices into the the bits of the corresponding 64-bit integer.
+/// It then selects these bits and packs them into the output.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_bitshuffle_epi64_mask)
+#[inline]
+#[target_feature(enable = "avx512bitalg")]
+#[cfg_attr(test, assert_instr(vpshufbitqmb))]
+pub unsafe fn _mm512_bitshuffle_epi64_mask(b: __m512i, c: __m512i) -> __mmask64 {
+ transmute(bitshuffle_512(b.as_i8x64(), c.as_i8x64(), !0))
+}
+
+/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
+/// Then groups 8 8-bit values from `c`as indices into the the bits of the corresponding 64-bit integer.
+/// It then selects these bits and packs them into the output.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_bitshuffle_epi64_mask)
+#[inline]
+#[target_feature(enable = "avx512bitalg")]
+#[cfg_attr(test, assert_instr(vpshufbitqmb))]
+pub unsafe fn _mm512_mask_bitshuffle_epi64_mask(k: __mmask64, b: __m512i, c: __m512i) -> __mmask64 {
+ transmute(bitshuffle_512(b.as_i8x64(), c.as_i8x64(), k))
+}
+
+/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
+/// Then groups 8 8-bit values from `c`as indices into the the bits of the corresponding 64-bit integer.
+/// It then selects these bits and packs them into the output.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_bitshuffle_epi64_mask)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshufbitqmb))]
+pub unsafe fn _mm256_bitshuffle_epi64_mask(b: __m256i, c: __m256i) -> __mmask32 {
+ transmute(bitshuffle_256(b.as_i8x32(), c.as_i8x32(), !0))
+}
+
+/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
+/// Then groups 8 8-bit values from `c`as indices into the the bits of the corresponding 64-bit integer.
+/// It then selects these bits and packs them into the output.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_bitshuffle_epi64_mask)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshufbitqmb))]
+pub unsafe fn _mm256_mask_bitshuffle_epi64_mask(k: __mmask32, b: __m256i, c: __m256i) -> __mmask32 {
+ transmute(bitshuffle_256(b.as_i8x32(), c.as_i8x32(), k))
+}
+
+/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
+/// Then groups 8 8-bit values from `c`as indices into the the bits of the corresponding 64-bit integer.
+/// It then selects these bits and packs them into the output.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_bitshuffle_epi64_mask)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshufbitqmb))]
+pub unsafe fn _mm_bitshuffle_epi64_mask(b: __m128i, c: __m128i) -> __mmask16 {
+ transmute(bitshuffle_128(b.as_i8x16(), c.as_i8x16(), !0))
+}
+
+/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
+/// Then groups 8 8-bit values from `c`as indices into the the bits of the corresponding 64-bit integer.
+/// It then selects these bits and packs them into the output.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_bitshuffle_epi64_mask)
+#[inline]
+#[target_feature(enable = "avx512bitalg,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshufbitqmb))]
+pub unsafe fn _mm_mask_bitshuffle_epi64_mask(k: __mmask16, b: __m128i, c: __m128i) -> __mmask16 {
+ transmute(bitshuffle_128(b.as_i8x16(), c.as_i8x16(), k))
+}
+
+#[cfg(test)]
+mod tests {
+ // Some of the constants in the tests below are just bit patterns. They should not
+ // be interpreted as integers; signedness does not make sense for them, but
+ // __mXXXi happens to be defined in terms of signed integers.
+ #![allow(overflowing_literals)]
+
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "avx512bitalg,avx512f")]
+ unsafe fn test_mm512_popcnt_epi16() {
+ let test_data = _mm512_set_epi16(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF,
+ 0x3F_FF, 0x7F_FF, 0xFF_FF, -1, -100, 255, 256, 2, 4, 8, 16, 32, 64, 128, 256, 512,
+ 1024, 2048,
+ );
+ let actual_result = _mm512_popcnt_epi16(test_data);
+ let reference_result = _mm512_set_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 12, 8, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1,
+ );
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f")]
+ unsafe fn test_mm512_maskz_popcnt_epi16() {
+ let test_data = _mm512_set_epi16(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF,
+ 0x3F_FF, 0x7F_FF, 0xFF_FF, -1, -100, 255, 256, 2, 4, 8, 16, 32, 64, 128, 256, 512,
+ 1024, 2048,
+ );
+ let mask = 0xFF_FF_00_00;
+ let actual_result = _mm512_maskz_popcnt_epi16(mask, test_data);
+ let reference_result = _mm512_set_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ );
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f")]
+ unsafe fn test_mm512_mask_popcnt_epi16() {
+ let test_data = _mm512_set_epi16(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF,
+ 0x3F_FF, 0x7F_FF, 0xFF_FF, -1, -100, 255, 256, 2, 4, 8, 16, 32, 64, 128, 256, 512,
+ 1024, 2048,
+ );
+ let mask = 0xFF_FF_00_00;
+ let actual_result = _mm512_mask_popcnt_epi16(test_data, mask, test_data);
+ let reference_result = _mm512_set_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0xFF_FF, -1, -100, 255, 256, 2,
+ 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048,
+ );
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm256_popcnt_epi16() {
+ let test_data = _mm256_set_epi16(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF,
+ 0x3F_FF, 0x7F_FF,
+ );
+ let actual_result = _mm256_popcnt_epi16(test_data);
+ let reference_result =
+ _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_popcnt_epi16() {
+ let test_data = _mm256_set_epi16(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF,
+ 0x3F_FF, 0x7F_FF,
+ );
+ let mask = 0xFF_00;
+ let actual_result = _mm256_maskz_popcnt_epi16(mask, test_data);
+ let reference_result = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_popcnt_epi16() {
+ let test_data = _mm256_set_epi16(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF,
+ 0x3F_FF, 0x7F_FF,
+ );
+ let mask = 0xFF_00;
+ let actual_result = _mm256_mask_popcnt_epi16(test_data, mask, test_data);
+ let reference_result = _mm256_set_epi16(
+ 0, 1, 2, 3, 4, 5, 6, 7, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF, 0x3F_FF, 0x7F_FF,
+ );
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm_popcnt_epi16() {
+ let test_data = _mm_set_epi16(0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F);
+ let actual_result = _mm_popcnt_epi16(test_data);
+ let reference_result = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_popcnt_epi16() {
+ let test_data = _mm_set_epi16(0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F);
+ let mask = 0xF0;
+ let actual_result = _mm_maskz_popcnt_epi16(mask, test_data);
+ let reference_result = _mm_set_epi16(0, 1, 2, 3, 0, 0, 0, 0);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm_mask_popcnt_epi16() {
+ let test_data = _mm_set_epi16(0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F);
+ let mask = 0xF0;
+ let actual_result = _mm_mask_popcnt_epi16(test_data, mask, test_data);
+ let reference_result = _mm_set_epi16(0, 1, 2, 3, 0xF, 0x1F, 0x3F, 0x7F);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f")]
+ unsafe fn test_mm512_popcnt_epi8() {
+ let test_data = _mm512_set_epi8(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 128, 171, 206, 100,
+ 217, 109, 253, 190, 177, 254, 179, 215, 230, 68, 201, 172, 183, 154, 84, 56, 227, 189,
+ 140, 35, 117, 219, 169, 226, 170, 13, 22, 159, 251, 73, 121, 143, 145, 85, 91, 137, 90,
+ 225, 21, 249, 211, 155, 228, 70,
+ );
+ let actual_result = _mm512_popcnt_epi8(test_data);
+ let reference_result = _mm512_set_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 1, 1, 1, 1, 1, 1, 1, 5, 5, 3, 5, 5, 7, 6, 4, 7, 5, 6, 5,
+ 2, 4, 4, 6, 4, 3, 3, 5, 6, 3, 3, 5, 6, 4, 4, 4, 3, 3, 6, 7, 3, 5, 5, 3, 4, 5, 3, 4, 4,
+ 3, 6, 5, 5, 4, 3,
+ );
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f")]
+ unsafe fn test_mm512_maskz_popcnt_epi8() {
+ let test_data = _mm512_set_epi8(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 128, 171, 206, 100,
+ 217, 109, 253, 190, 177, 254, 179, 215, 230, 68, 201, 172, 183, 154, 84, 56, 227, 189,
+ 140, 35, 117, 219, 169, 226, 170, 13, 22, 159, 251, 73, 121, 143, 145, 85, 91, 137, 90,
+ 225, 21, 249, 211, 155, 228, 70,
+ );
+ let mask = 0xFF_FF_FF_FF_00_00_00_00;
+ let actual_result = _mm512_maskz_popcnt_epi8(mask, test_data);
+ let reference_result = _mm512_set_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 1, 1, 1, 1, 1, 1, 1, 5, 5, 3, 5, 5, 7, 6, 4, 7, 5, 6, 5,
+ 2, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 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(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f")]
+ unsafe fn test_mm512_mask_popcnt_epi8() {
+ let test_data = _mm512_set_epi8(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 128, 171, 206, 100,
+ 217, 109, 253, 190, 177, 254, 179, 215, 230, 68, 201, 172, 183, 154, 84, 56, 227, 189,
+ 140, 35, 117, 219, 169, 226, 170, 13, 22, 159, 251, 73, 121, 143, 145, 85, 91, 137, 90,
+ 225, 21, 249, 211, 155, 228, 70,
+ );
+ let mask = 0xFF_FF_FF_FF_00_00_00_00;
+ let actual_result = _mm512_mask_popcnt_epi8(test_data, mask, test_data);
+ let reference_result = _mm512_set_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 1, 1, 1, 1, 1, 1, 1, 5, 5, 3, 5, 5, 7, 6, 4, 7, 5, 6, 5,
+ 2, 4, 4, 183, 154, 84, 56, 227, 189, 140, 35, 117, 219, 169, 226, 170, 13, 22, 159,
+ 251, 73, 121, 143, 145, 85, 91, 137, 90, 225, 21, 249, 211, 155, 228, 70,
+ );
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm256_popcnt_epi8() {
+ let test_data = _mm256_set_epi8(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 128, 171, 206, 100,
+ 217, 109, 253, 190, 177, 254, 179, 215, 230, 68, 201, 172,
+ );
+ let actual_result = _mm256_popcnt_epi8(test_data);
+ let reference_result = _mm256_set_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 1, 1, 1, 1, 1, 1, 1, 5, 5, 3, 5, 5, 7, 6, 4, 7, 5, 6, 5,
+ 2, 4, 4,
+ );
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_popcnt_epi8() {
+ let test_data = _mm256_set_epi8(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 251, 73, 121, 143,
+ 145, 85, 91, 137, 90, 225, 21, 249, 211, 155, 228, 70,
+ );
+ let mask = 0xFF_FF_00_00;
+ let actual_result = _mm256_maskz_popcnt_epi8(mask, test_data);
+ let reference_result = _mm256_set_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ );
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_popcnt_epi8() {
+ let test_data = _mm256_set_epi8(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 251, 73, 121, 143,
+ 145, 85, 91, 137, 90, 225, 21, 249, 211, 155, 228, 70,
+ );
+ let mask = 0xFF_FF_00_00;
+ let actual_result = _mm256_mask_popcnt_epi8(test_data, mask, test_data);
+ let reference_result = _mm256_set_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 1, 1, 1, 1, 1, 1, 251, 73, 121, 143, 145, 85, 91, 137,
+ 90, 225, 21, 249, 211, 155, 228, 70,
+ );
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm_popcnt_epi8() {
+ let test_data = _mm_set_epi8(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64,
+ );
+ let actual_result = _mm_popcnt_epi8(test_data);
+ let reference_result = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 1, 1, 1, 1, 1, 1);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_popcnt_epi8() {
+ let test_data = _mm_set_epi8(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 90, 225, 21, 249, 211, 155, 228, 70,
+ );
+ let mask = 0xFF_00;
+ let actual_result = _mm_maskz_popcnt_epi8(mask, test_data);
+ let reference_result = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm_mask_popcnt_epi8() {
+ let test_data = _mm_set_epi8(
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 90, 225, 21, 249, 211, 155, 228, 70,
+ );
+ let mask = 0xFF_00;
+ let actual_result = _mm_mask_popcnt_epi8(test_data, mask, test_data);
+ let reference_result =
+ _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 90, 225, 21, 249, 211, 155, 228, 70);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f")]
+ unsafe fn test_mm512_bitshuffle_epi64_mask() {
+ let test_indices = _mm512_set_epi8(
+ 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56, 32, 32, 16, 16, 0, 0,
+ 8, 8, 56, 48, 40, 32, 24, 16, 8, 0, 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59,
+ 58, 57, 56, 32, 32, 16, 16, 0, 0, 8, 8, 56, 48, 40, 32, 24, 16, 8, 0,
+ );
+ let test_data = _mm512_setr_epi64(
+ 0xFF_FF_FF_FF_00_00_00_00,
+ 0xFF_00_FF_00_FF_00_FF_00,
+ 0xFF_00_00_00_00_00_00_00,
+ 0xAC_00_00_00_00_00_00_00,
+ 0xFF_FF_FF_FF_00_00_00_00,
+ 0xFF_00_FF_00_FF_00_FF_00,
+ 0xFF_00_00_00_00_00_00_00,
+ 0xAC_00_00_00_00_00_00_00,
+ );
+ let actual_result = _mm512_bitshuffle_epi64_mask(test_data, test_indices);
+ let reference_result = 0xF0 << 0
+ | 0x03 << 8
+ | 0xFF << 16
+ | 0xAC << 24
+ | 0xF0 << 32
+ | 0x03 << 40
+ | 0xFF << 48
+ | 0xAC << 56;
+
+ assert_eq!(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f")]
+ unsafe fn test_mm512_mask_bitshuffle_epi64_mask() {
+ let test_indices = _mm512_set_epi8(
+ 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56, 32, 32, 16, 16, 0, 0,
+ 8, 8, 56, 48, 40, 32, 24, 16, 8, 0, 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59,
+ 58, 57, 56, 32, 32, 16, 16, 0, 0, 8, 8, 56, 48, 40, 32, 24, 16, 8, 0,
+ );
+ let test_data = _mm512_setr_epi64(
+ 0xFF_FF_FF_FF_00_00_00_00,
+ 0xFF_00_FF_00_FF_00_FF_00,
+ 0xFF_00_00_00_00_00_00_00,
+ 0xAC_00_00_00_00_00_00_00,
+ 0xFF_FF_FF_FF_00_00_00_00,
+ 0xFF_00_FF_00_FF_00_FF_00,
+ 0xFF_00_00_00_00_00_00_00,
+ 0xAC_00_00_00_00_00_00_00,
+ );
+ let mask = 0xFF_FF_FF_FF_00_00_00_00;
+ let actual_result = _mm512_mask_bitshuffle_epi64_mask(mask, test_data, test_indices);
+ let reference_result = 0x00 << 0
+ | 0x00 << 8
+ | 0x00 << 16
+ | 0x00 << 24
+ | 0xF0 << 32
+ | 0x03 << 40
+ | 0xFF << 48
+ | 0xAC << 56;
+
+ assert_eq!(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm256_bitshuffle_epi64_mask() {
+ let test_indices = _mm256_set_epi8(
+ 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56, 32, 32, 16, 16, 0, 0,
+ 8, 8, 56, 48, 40, 32, 24, 16, 8, 0,
+ );
+ let test_data = _mm256_setr_epi64x(
+ 0xFF_FF_FF_FF_00_00_00_00,
+ 0xFF_00_FF_00_FF_00_FF_00,
+ 0xFF_00_00_00_00_00_00_00,
+ 0xAC_00_00_00_00_00_00_00,
+ );
+ let actual_result = _mm256_bitshuffle_epi64_mask(test_data, test_indices);
+ let reference_result = 0xF0 << 0 | 0x03 << 8 | 0xFF << 16 | 0xAC << 24;
+
+ assert_eq!(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_bitshuffle_epi64_mask() {
+ let test_indices = _mm256_set_epi8(
+ 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56, 32, 32, 16, 16, 0, 0,
+ 8, 8, 56, 48, 40, 32, 24, 16, 8, 0,
+ );
+ let test_data = _mm256_setr_epi64x(
+ 0xFF_FF_FF_FF_00_00_00_00,
+ 0xFF_00_FF_00_FF_00_FF_00,
+ 0xFF_00_00_00_00_00_00_00,
+ 0xAC_00_00_00_00_00_00_00,
+ );
+ let mask = 0xFF_FF_00_00;
+ let actual_result = _mm256_mask_bitshuffle_epi64_mask(mask, test_data, test_indices);
+ let reference_result = 0x00 << 0 | 0x00 << 8 | 0xFF << 16 | 0xAC << 24;
+
+ assert_eq!(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm_bitshuffle_epi64_mask() {
+ let test_indices = _mm_set_epi8(
+ 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56,
+ );
+ let test_data = _mm_setr_epi64x(0xFF_00_00_00_00_00_00_00, 0xAC_00_00_00_00_00_00_00);
+ let actual_result = _mm_bitshuffle_epi64_mask(test_data, test_indices);
+ let reference_result = 0xFF << 0 | 0xAC << 8;
+
+ assert_eq!(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")]
+ unsafe fn test_mm_mask_bitshuffle_epi64_mask() {
+ let test_indices = _mm_set_epi8(
+ 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56,
+ );
+ let test_data = _mm_setr_epi64x(0xFF_00_00_00_00_00_00_00, 0xAC_00_00_00_00_00_00_00);
+ let mask = 0xFF_00;
+ let actual_result = _mm_mask_bitshuffle_epi64_mask(mask, test_data, test_indices);
+ let reference_result = 0x00 << 0 | 0xAC << 8;
+
+ assert_eq!(actual_result, reference_result);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512bw.rs b/library/stdarch/crates/core_arch/src/x86/avx512bw.rs
new file mode 100644
index 000000000..47d565cea
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512bw.rs
@@ -0,0 +1,18785 @@
+use crate::{
+ arch::asm,
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ mem::{self, transmute},
+ ptr,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+use super::avx512f::{vpl, vps};
+
+/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_abs_epi16&expand=30)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpabsw))]
+pub unsafe fn _mm512_abs_epi16(a: __m512i) -> __m512i {
+ let a = a.as_i16x32();
+ // all-0 is a properly initialized i16x32
+ let zero: i16x32 = mem::zeroed();
+ let sub = simd_sub(zero, a);
+ let cmp: i16x32 = simd_gt(a, zero);
+ transmute(simd_select(cmp, a, sub))
+}
+
+/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_abs_epi16&expand=31)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_abs_epi16&expand=32)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_abs_epi16&expand=28)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_abs_epi16&expand=29)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_abs_epi16&expand=25)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compute the absolute value of packed signed 16-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_abs_epi16&expand=26)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_abs_epi8&expand=57)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpabsb))]
+pub unsafe fn _mm512_abs_epi8(a: __m512i) -> __m512i {
+ let a = a.as_i8x64();
+ // all-0 is a properly initialized i8x64
+ let zero: i8x64 = mem::zeroed();
+ let sub = simd_sub(zero, a);
+ let cmp: i8x64 = simd_gt(a, zero);
+ transmute(simd_select(cmp, a, sub))
+}
+
+/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_abs_epi8&expand=58)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_abs_epi8&expand=59)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_abs_epi8&expand=55)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_abs_epi8&expand=56)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_abs_epi8&expand=52)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compute the absolute value of packed signed 8-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_abs_epi8&expand=53)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Add packed 16-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_add_epi16&expand=91)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Add packed 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_add_epi16&expand=92)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Add packed 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_add_epi16&expand=93)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Add packed 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_add_epi&expand=89)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Add packed 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_add_epi16&expand=90)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Add packed 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_add_epi16&expand=86)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Add packed 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_add_epi16&expand=87)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Add packed 8-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_add_epi8&expand=118)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Add packed 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_add_epi8&expand=119)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Add packed 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_add_epi8&expand=120)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Add packed 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_add_epi8&expand=116)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Add packed 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_add_epi8&expand=117)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Add packed 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_add_epi8&expand=113)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Add packed 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_add_epi8&expand=114)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_adds_epu16&expand=197)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddusw))]
+pub unsafe fn _mm512_adds_epu16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpaddusw(
+ a.as_u16x32(),
+ b.as_u16x32(),
+ _mm512_setzero_si512().as_u16x32(),
+ 0b11111111_11111111_11111111_11111111,
+ ))
+}
+
+/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_adds_epu16&expand=198)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddusw))]
+pub unsafe fn _mm512_mask_adds_epu16(
+ src: __m512i,
+ k: __mmask32,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ transmute(vpaddusw(a.as_u16x32(), b.as_u16x32(), src.as_u16x32(), k))
+}
+
+/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_adds_epu16&expand=199)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddusw))]
+pub unsafe fn _mm512_maskz_adds_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpaddusw(
+ a.as_u16x32(),
+ b.as_u16x32(),
+ _mm512_setzero_si512().as_u16x32(),
+ k,
+ ))
+}
+
+/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_adds_epu16&expand=195)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddusw))]
+pub unsafe fn _mm256_mask_adds_epu16(
+ src: __m256i,
+ k: __mmask16,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ transmute(vpaddusw256(
+ a.as_u16x16(),
+ b.as_u16x16(),
+ src.as_u16x16(),
+ k,
+ ))
+}
+
+/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_adds_epu16&expand=196)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddusw))]
+pub unsafe fn _mm256_maskz_adds_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpaddusw256(
+ a.as_u16x16(),
+ b.as_u16x16(),
+ _mm256_setzero_si256().as_u16x16(),
+ k,
+ ))
+}
+
+/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_adds_epu16&expand=192)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddusw))]
+pub unsafe fn _mm_mask_adds_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpaddusw128(a.as_u16x8(), b.as_u16x8(), src.as_u16x8(), k))
+}
+
+/// Add packed unsigned 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_adds_epu16&expand=193)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddusw))]
+pub unsafe fn _mm_maskz_adds_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpaddusw128(
+ a.as_u16x8(),
+ b.as_u16x8(),
+ _mm_setzero_si128().as_u16x8(),
+ k,
+ ))
+}
+
+/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_adds_epu8&expand=206)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddusb))]
+pub unsafe fn _mm512_adds_epu8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpaddusb(
+ a.as_u8x64(),
+ b.as_u8x64(),
+ _mm512_setzero_si512().as_u8x64(),
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ ))
+}
+
+/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_adds_epu8&expand=207)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddusb))]
+pub unsafe fn _mm512_mask_adds_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpaddusb(a.as_u8x64(), b.as_u8x64(), src.as_u8x64(), k))
+}
+
+/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_adds_epu8&expand=208)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddusb))]
+pub unsafe fn _mm512_maskz_adds_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpaddusb(
+ a.as_u8x64(),
+ b.as_u8x64(),
+ _mm512_setzero_si512().as_u8x64(),
+ k,
+ ))
+}
+
+/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_adds_epu8&expand=204)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddusb))]
+pub unsafe fn _mm256_mask_adds_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpaddusb256(a.as_u8x32(), b.as_u8x32(), src.as_u8x32(), k))
+}
+
+/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_adds_epu8&expand=205)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddusb))]
+pub unsafe fn _mm256_maskz_adds_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpaddusb256(
+ a.as_u8x32(),
+ b.as_u8x32(),
+ _mm256_setzero_si256().as_u8x32(),
+ k,
+ ))
+}
+
+/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_adds_epu8&expand=201)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddusb))]
+pub unsafe fn _mm_mask_adds_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpaddusb128(a.as_u8x16(), b.as_u8x16(), src.as_u8x16(), k))
+}
+
+/// Add packed unsigned 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_adds_epu8&expand=202)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddusb))]
+pub unsafe fn _mm_maskz_adds_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpaddusb128(
+ a.as_u8x16(),
+ b.as_u8x16(),
+ _mm_setzero_si128().as_u8x16(),
+ k,
+ ))
+}
+
+/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_adds_epi16&expand=179)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddsw))]
+pub unsafe fn _mm512_adds_epi16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpaddsw(
+ a.as_i16x32(),
+ b.as_i16x32(),
+ _mm512_setzero_si512().as_i16x32(),
+ 0b11111111_11111111_11111111_11111111,
+ ))
+}
+
+/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_adds_epi16&expand=180)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddsw))]
+pub unsafe fn _mm512_mask_adds_epi16(
+ src: __m512i,
+ k: __mmask32,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ transmute(vpaddsw(a.as_i16x32(), b.as_i16x32(), src.as_i16x32(), k))
+}
+
+/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_adds_epi16&expand=181)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddsw))]
+pub unsafe fn _mm512_maskz_adds_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpaddsw(
+ a.as_i16x32(),
+ b.as_i16x32(),
+ _mm512_setzero_si512().as_i16x32(),
+ k,
+ ))
+}
+
+/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_adds_epi16&expand=177)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddsw))]
+pub unsafe fn _mm256_mask_adds_epi16(
+ src: __m256i,
+ k: __mmask16,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ transmute(vpaddsw256(a.as_i16x16(), b.as_i16x16(), src.as_i16x16(), k))
+}
+
+/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_adds_epi16&expand=178)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddsw))]
+pub unsafe fn _mm256_maskz_adds_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpaddsw256(
+ a.as_i16x16(),
+ b.as_i16x16(),
+ _mm256_setzero_si256().as_i16x16(),
+ k,
+ ))
+}
+
+/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_adds_epi16&expand=174)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddsw))]
+pub unsafe fn _mm_mask_adds_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpaddsw128(a.as_i16x8(), b.as_i16x8(), src.as_i16x8(), k))
+}
+
+/// Add packed signed 16-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_adds_epi16&expand=175)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddsw))]
+pub unsafe fn _mm_maskz_adds_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpaddsw128(
+ a.as_i16x8(),
+ b.as_i16x8(),
+ _mm_setzero_si128().as_i16x8(),
+ k,
+ ))
+}
+
+/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_adds_epi8&expand=188)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddsb))]
+pub unsafe fn _mm512_adds_epi8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpaddsb(
+ a.as_i8x64(),
+ b.as_i8x64(),
+ _mm512_setzero_si512().as_i8x64(),
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ ))
+}
+
+/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_adds_epi8&expand=189)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddsb))]
+pub unsafe fn _mm512_mask_adds_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpaddsb(a.as_i8x64(), b.as_i8x64(), src.as_i8x64(), k))
+}
+
+/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_adds_epi8&expand=190)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpaddsb))]
+pub unsafe fn _mm512_maskz_adds_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpaddsb(
+ a.as_i8x64(),
+ b.as_i8x64(),
+ _mm512_setzero_si512().as_i8x64(),
+ k,
+ ))
+}
+
+/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_adds_epi8&expand=186)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddsb))]
+pub unsafe fn _mm256_mask_adds_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpaddsb256(a.as_i8x32(), b.as_i8x32(), src.as_i8x32(), k))
+}
+
+/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_adds_epi8&expand=187)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddsb))]
+pub unsafe fn _mm256_maskz_adds_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpaddsb256(
+ a.as_i8x32(),
+ b.as_i8x32(),
+ _mm256_setzero_si256().as_i8x32(),
+ k,
+ ))
+}
+
+/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_adds_epi8&expand=183)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddsb))]
+pub unsafe fn _mm_mask_adds_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpaddsb128(a.as_i8x16(), b.as_i8x16(), src.as_i8x16(), k))
+}
+
+/// Add packed signed 8-bit integers in a and b using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_adds_epi8&expand=184)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddsb))]
+pub unsafe fn _mm_maskz_adds_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpaddsb128(
+ a.as_i8x16(),
+ b.as_i8x16(),
+ _mm_setzero_si128().as_i8x16(),
+ k,
+ ))
+}
+
+/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sub_epi16&expand=5685)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sub_epi16&expand=5683)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sub_epi16&expand=5684)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sub_epi16&expand=5680)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sub_epi16&expand=5681)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sub_epi16&expand=5677)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Subtract packed 16-bit integers in b from packed 16-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sub_epi16&expand=5678)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sub_epi8&expand=5712)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sub_epi8&expand=5710)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sub_epi8&expand=5711)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sub_epi8&expand=5707)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sub_epi8&expand=5708)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sub_epi8&expand=5704)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Subtract packed 8-bit integers in b from packed 8-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sub_epi8&expand=5705)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_subs_epu16&expand=5793)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubusw))]
+pub unsafe fn _mm512_subs_epu16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpsubusw(
+ a.as_u16x32(),
+ b.as_u16x32(),
+ _mm512_setzero_si512().as_u16x32(),
+ 0b11111111_11111111_11111111_11111111,
+ ))
+}
+
+/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_subs_epu16&expand=5791)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubusw))]
+pub unsafe fn _mm512_mask_subs_epu16(
+ src: __m512i,
+ k: __mmask32,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ transmute(vpsubusw(a.as_u16x32(), b.as_u16x32(), src.as_u16x32(), k))
+}
+
+/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_subs_epu16&expand=5792)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubusw))]
+pub unsafe fn _mm512_maskz_subs_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpsubusw(
+ a.as_u16x32(),
+ b.as_u16x32(),
+ _mm512_setzero_si512().as_u16x32(),
+ k,
+ ))
+}
+
+/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_subs_epu16&expand=5788)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubusw))]
+pub unsafe fn _mm256_mask_subs_epu16(
+ src: __m256i,
+ k: __mmask16,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ transmute(vpsubusw256(
+ a.as_u16x16(),
+ b.as_u16x16(),
+ src.as_u16x16(),
+ k,
+ ))
+}
+
+/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_subs_epu16&expand=5789)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubusw))]
+pub unsafe fn _mm256_maskz_subs_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpsubusw256(
+ a.as_u16x16(),
+ b.as_u16x16(),
+ _mm256_setzero_si256().as_u16x16(),
+ k,
+ ))
+}
+
+/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_subs_epu16&expand=5785)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubusw))]
+pub unsafe fn _mm_mask_subs_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpsubusw128(a.as_u16x8(), b.as_u16x8(), src.as_u16x8(), k))
+}
+
+/// Subtract packed unsigned 16-bit integers in b from packed unsigned 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_subs_epu16&expand=5786)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubusw))]
+pub unsafe fn _mm_maskz_subs_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpsubusw128(
+ a.as_u16x8(),
+ b.as_u16x8(),
+ _mm_setzero_si128().as_u16x8(),
+ k,
+ ))
+}
+
+/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_subs_epu8&expand=5802)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubusb))]
+pub unsafe fn _mm512_subs_epu8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpsubusb(
+ a.as_u8x64(),
+ b.as_u8x64(),
+ _mm512_setzero_si512().as_u8x64(),
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ ))
+}
+
+/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_subs_epu8&expand=5800)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubusb))]
+pub unsafe fn _mm512_mask_subs_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpsubusb(a.as_u8x64(), b.as_u8x64(), src.as_u8x64(), k))
+}
+
+/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_subs_epu8&expand=5801)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubusb))]
+pub unsafe fn _mm512_maskz_subs_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpsubusb(
+ a.as_u8x64(),
+ b.as_u8x64(),
+ _mm512_setzero_si512().as_u8x64(),
+ k,
+ ))
+}
+
+/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_subs_epu8&expand=5797)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubusb))]
+pub unsafe fn _mm256_mask_subs_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpsubusb256(a.as_u8x32(), b.as_u8x32(), src.as_u8x32(), k))
+}
+
+/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_subs_epu8&expand=5798)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubusb))]
+pub unsafe fn _mm256_maskz_subs_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpsubusb256(
+ a.as_u8x32(),
+ b.as_u8x32(),
+ _mm256_setzero_si256().as_u8x32(),
+ k,
+ ))
+}
+
+/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_subs_epu8&expand=5794)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubusb))]
+pub unsafe fn _mm_mask_subs_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpsubusb128(a.as_u8x16(), b.as_u8x16(), src.as_u8x16(), k))
+}
+
+/// Subtract packed unsigned 8-bit integers in b from packed unsigned 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_subs_epu8&expand=5795)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubusb))]
+pub unsafe fn _mm_maskz_subs_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpsubusb128(
+ a.as_u8x16(),
+ b.as_u8x16(),
+ _mm_setzero_si128().as_u8x16(),
+ k,
+ ))
+}
+
+/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_subs_epi16&expand=5775)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubsw))]
+pub unsafe fn _mm512_subs_epi16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpsubsw(
+ a.as_i16x32(),
+ b.as_i16x32(),
+ _mm512_setzero_si512().as_i16x32(),
+ 0b11111111_11111111_11111111_11111111,
+ ))
+}
+
+/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_subs_epi16&expand=5773)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubsw))]
+pub unsafe fn _mm512_mask_subs_epi16(
+ src: __m512i,
+ k: __mmask32,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ transmute(vpsubsw(a.as_i16x32(), b.as_i16x32(), src.as_i16x32(), k))
+}
+
+/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_subs_epi16&expand=5774)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubsw))]
+pub unsafe fn _mm512_maskz_subs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpsubsw(
+ a.as_i16x32(),
+ b.as_i16x32(),
+ _mm512_setzero_si512().as_i16x32(),
+ k,
+ ))
+}
+
+/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_subs_epi16&expand=5770)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubsw))]
+pub unsafe fn _mm256_mask_subs_epi16(
+ src: __m256i,
+ k: __mmask16,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ transmute(vpsubsw256(a.as_i16x16(), b.as_i16x16(), src.as_i16x16(), k))
+}
+
+/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_subs_epi16&expand=5771)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubsw))]
+pub unsafe fn _mm256_maskz_subs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpsubsw256(
+ a.as_i16x16(),
+ b.as_i16x16(),
+ _mm256_setzero_si256().as_i16x16(),
+ k,
+ ))
+}
+
+/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_subs_epi16&expand=5767)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubsw))]
+pub unsafe fn _mm_mask_subs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpsubsw128(a.as_i16x8(), b.as_i16x8(), src.as_i16x8(), k))
+}
+
+/// Subtract packed signed 16-bit integers in b from packed 16-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_subs_epi16&expand=5768)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubsw))]
+pub unsafe fn _mm_maskz_subs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpsubsw128(
+ a.as_i16x8(),
+ b.as_i16x8(),
+ _mm_setzero_si128().as_i16x8(),
+ k,
+ ))
+}
+
+/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_subs_epi8&expand=5784)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubsb))]
+pub unsafe fn _mm512_subs_epi8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpsubsb(
+ a.as_i8x64(),
+ b.as_i8x64(),
+ _mm512_setzero_si512().as_i8x64(),
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ ))
+}
+
+/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_subs_epi8&expand=5782)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubsb))]
+pub unsafe fn _mm512_mask_subs_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpsubsb(a.as_i8x64(), b.as_i8x64(), src.as_i8x64(), k))
+}
+
+/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_subs_epi8&expand=5783)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpsubsb))]
+pub unsafe fn _mm512_maskz_subs_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpsubsb(
+ a.as_i8x64(),
+ b.as_i8x64(),
+ _mm512_setzero_si512().as_i8x64(),
+ k,
+ ))
+}
+
+/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_subs_epi8&expand=5779)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubsb))]
+pub unsafe fn _mm256_mask_subs_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpsubsb256(a.as_i8x32(), b.as_i8x32(), src.as_i8x32(), k))
+}
+
+/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_subs_epi8&expand=5780)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubsb))]
+pub unsafe fn _mm256_maskz_subs_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpsubsb256(
+ a.as_i8x32(),
+ b.as_i8x32(),
+ _mm256_setzero_si256().as_i8x32(),
+ k,
+ ))
+}
+
+/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_subs_epi8&expand=5776)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubsb))]
+pub unsafe fn _mm_mask_subs_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpsubsb128(a.as_i8x16(), b.as_i8x16(), src.as_i8x16(), k))
+}
+
+/// Subtract packed signed 8-bit integers in b from packed 8-bit integers in a using saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_subs_epi8&expand=5777)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubsb))]
+pub unsafe fn _mm_maskz_subs_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpsubsb128(
+ a.as_i8x16(),
+ b.as_i8x16(),
+ _mm_setzero_si128().as_i8x16(),
+ k,
+ ))
+}
+
+/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mulhi_epu16&expand=3973)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpmulhuw))]
+pub unsafe fn _mm512_mulhi_epu16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmulhuw(a.as_u16x32(), b.as_u16x32()))
+}
+
+/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mulhi_epu16&expand=3971)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mulhi_epu16&expand=3972)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mulhi_epu16&expand=3968)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mulhi_epu16&expand=3969)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mulhi_epu16&expand=3965)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply the packed unsigned 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mulhi_epu16&expand=3966)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mulhi_epi16&expand=3962)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpmulhw))]
+pub unsafe fn _mm512_mulhi_epi16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmulhw(a.as_i16x32(), b.as_i16x32()))
+}
+
+/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mulhi_epi16&expand=3960)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mulhi_epi16&expand=3961)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mulhi_epi16&expand=3957)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mulhi_epi16&expand=3958)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mulhi_epi16&expand=3954)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply the packed signed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the high 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mulhi_epi16&expand=3955)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mulhrs_epi16&expand=3986)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mulhrs_epi16&expand=3984)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mulhrs_epi16&expand=3985)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mulhrs_epi16&expand=3981)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mulhrs_epi16&expand=3982)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mulhrs_epi16&expand=3978)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Truncate each intermediate integer to the 18 most significant bits, round by adding 1, and store bits \[16:1\] to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mulhrs_epi16&expand=3979)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mullo_epi16&expand=3996)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mullo_epi16&expand=3994)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mullo_epi16&expand=3995)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mullo_epi16&expand=3991)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mullo_epi16&expand=3992)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mullo_epi16&expand=3988)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply the packed 16-bit integers in a and b, producing intermediate 32-bit integers, and store the low 16 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mullo_epi16&expand=3989)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_epu16&expand=3609)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpmaxuw))]
+pub unsafe fn _mm512_max_epu16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmaxuw(a.as_u16x32(), b.as_u16x32()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_epu16&expand=3607)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_epu16&expand=3608)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_max_epu16&expand=3604)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_max_epu16&expand=3605)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_max_epu16&expand=3601)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_max_epu16&expand=3602)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_epu8&expand=3636)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpmaxub))]
+pub unsafe fn _mm512_max_epu8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmaxub(a.as_u8x64(), b.as_u8x64()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_epu8&expand=3634)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_epu8&expand=3635)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_max_epu8&expand=3631)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_max_epu8&expand=3632)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_max_epu8&expand=3628)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_max_epu8&expand=3629)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_epi16&expand=3573)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpmaxsw))]
+pub unsafe fn _mm512_max_epi16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmaxsw(a.as_i16x32(), b.as_i16x32()))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_epi16&expand=3571)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_epi16&expand=3572)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_max_epi16&expand=3568)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_max_epi16&expand=3569)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_max_epi16&expand=3565)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_max_epi16&expand=3566)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_epi8&expand=3600)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpmaxsb))]
+pub unsafe fn _mm512_max_epi8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmaxsb(a.as_i8x64(), b.as_i8x64()))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_epi8&expand=3598)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_epi8&expand=3599)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_max_epi8&expand=3595)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_max_epi8&expand=3596)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_max_epi8&expand=3592)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_max_epi8&expand=3593)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_epu16&expand=3723)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpminuw))]
+pub unsafe fn _mm512_min_epu16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpminuw(a.as_u16x32(), b.as_u16x32()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_epu16&expand=3721)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_min_epu16&expand=3722)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_min_epu16&expand=3718)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_min_epu16&expand=3719)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_min_epu16&expand=3715)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_min_epu16&expand=3716)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_epu8&expand=3750)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpminub))]
+pub unsafe fn _mm512_min_epu8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpminub(a.as_u8x64(), b.as_u8x64()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_epu8&expand=3748)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_min_epu8&expand=3749)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_min_epu8&expand=3745)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_min_epu8&expand=3746)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_min_epu8&expand=3742)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_min_epu8&expand=3743)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_epi16&expand=3687)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpminsw))]
+pub unsafe fn _mm512_min_epi16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpminsw(a.as_i16x32(), b.as_i16x32()))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_epi16&expand=3685)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_min_epi16&expand=3686)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_min_epi16&expand=3682)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_min_epi16&expand=3683)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_min_epi16&expand=3679)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_min_epi16&expand=3680)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_epi8&expand=3714)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpminsb))]
+pub unsafe fn _mm512_min_epi8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpminsb(a.as_i8x64(), b.as_i8x64()))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_epi8&expand=3712)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_min_epi8&expand=3713)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_min_epi8&expand=3709)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_min_epi8&expand=3710)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_min_epi8&expand=3706)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_min_epi8&expand=3707)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_cmplt_epu16_mask&expand=1050)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmplt_epu16_mask&expand=1051)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmplt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmplt_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_cmplt_epu16_mask&expand=1050)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmplt_epu16_mask&expand=1049)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmplt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmplt_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epi16_mask&expand=1018)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmplt_epi16_mask&expand=1019)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmplt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmplt_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm512_cmplt_epu8_mask&expand=1068)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmplt_epu8_mask&expand=1069)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmplt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmplt_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmplt_epu8_mask&expand=1066)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmplt_epu8_mask&expand=1067)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmplt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmplt_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epu8_mask&expand=1064)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmplt_epu8_mask&expand=1065)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmplt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmplt_epu8_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmplt_epi16_mask&expand=1022)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmplt_epi16_mask&expand=1023)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmplt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmplt_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmplt_epi16_mask&expand=1020)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmplt_epi16_mask&expand=1021)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmplt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmplt_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epi16_mask&expand=1018)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmplt_epi16_mask&expand=1019)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmplt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmplt_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmplt_epi8_mask&expand=1044)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmplt_epi8_mask&expand=1045)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmplt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmplt_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmplt_epi8_mask&expand=1042)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmplt_epi8_mask&expand=1043)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmplt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmplt_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epi8_mask&expand=1040)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmplt_epi8_mask&expand=1041)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmplt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmplt_epi8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpgt_epu16_mask&expand=927)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpgt_epu16_mask&expand=928)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpgt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmpgt_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epu16_mask&expand=925)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpgt_epu16_mask&expand=926)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpgt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmpgt_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epu16_mask&expand=923)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpgt_epu16_mask&expand=924)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpgt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpgt_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpgt_epu8_mask&expand=945)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpgt_epu8_mask&expand=946)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpgt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmpgt_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epu8_mask&expand=943)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpgt_epu8_mask&expand=944)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpgt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmpgt_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epu8_mask&expand=941)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpgt_epu8_mask&expand=942)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpgt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmpgt_epu8_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpgt_epi16_mask&expand=897)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpgt_epi16_mask&expand=898)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpgt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmpgt_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epi16_mask&expand=895)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpgt_epi16_mask&expand=896)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpgt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmpgt_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epi16_mask&expand=893)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpgt_epi16_mask&expand=894)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpgt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpgt_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpgt_epi8_mask&expand=921)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpgt_epi8_mask&expand=922)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpgt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmpgt_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epi8_mask&expand=919)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpgt_epi8_mask&expand=920)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpgt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmpgt_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epi8_mask&expand=917)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpgt_epi8_mask&expand=918)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpgt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmpgt_epi8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmple_epu16_mask&expand=989)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmple_epu16_mask&expand=990)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmple_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmple_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmple_epu16_mask&expand=987)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmple_epu16_mask&expand=988)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmple_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmple_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_epu16_mask&expand=985)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmple_epu16_mask&expand=986)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmple_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmple_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmple_epu8_mask&expand=1007)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmple_epu8_mask&expand=1008)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmple_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmple_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmple_epu8_mask&expand=1005)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmple_epu8_mask&expand=1006)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmple_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmple_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_epu8_mask&expand=1003)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmple_epu8_mask&expand=1004)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmple_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmple_epu8_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmple_epi16_mask&expand=965)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmple_epi16_mask&expand=966)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmple_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmple_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmple_epi16_mask&expand=963)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmple_epi16_mask&expand=964)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmple_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmple_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_epi16_mask&expand=961)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmple_epi16_mask&expand=962)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmple_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmple_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmple_epi8_mask&expand=983)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmple_epi8_mask&expand=984)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmple_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmple_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmple_epi8_mask&expand=981)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmple_epi8_mask&expand=982)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmple_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmple_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_epi8_mask&expand=979)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmple_epi8_mask&expand=980)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmple_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmple_epi8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpge_epu16_mask&expand=867)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpge_epu16_mask&expand=868)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpge_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmpge_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpge_epu16_mask&expand=865)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpge_epu16_mask&expand=866)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpge_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmpge_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_epu16_mask&expand=863)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpge_epu16_mask&expand=864)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpge_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpge_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpge_epu8_mask&expand=885)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpge_epu8_mask&expand=886)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpge_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmpge_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpge_epu8_mask&expand=883)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpge_epu8_mask&expand=884)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpge_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmpge_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_epu8_mask&expand=881)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpge_epu8_mask&expand=882)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpge_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmpge_epu8_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpge_epi16_mask&expand=843)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpge_epi16_mask&expand=844)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpge_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmpge_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpge_epi16_mask&expand=841)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpge_epi16_mask&expand=842)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpge_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmpge_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_epi16_mask&expand=839)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpge_epi16_mask&expand=840)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpge_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpge_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpge_epi8_mask&expand=861)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpge_epi8_mask&expand=862)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpge_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmpge_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpge_epi8_mask&expand=859)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpge_epi8_mask&expand=860)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpge_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmpge_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_epi8_mask&expand=857)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpge_epi8_mask&expand=858)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpge_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmpge_epi8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpeq_epu16_mask&expand=801)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpeq_epu16_mask&expand=802)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpeq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmpeq_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epu16_mask&expand=799)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpeq_epu16_mask&expand=800)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpeq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmpeq_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epu16_mask&expand=797)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpeq_epu16_mask&expand=798)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpeq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpeq_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpeq_epu8_mask&expand=819)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpeq_epu8_mask&expand=820)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpeq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmpeq_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epu8_mask&expand=817)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpeq_epu8_mask&expand=818)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpeq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmpeq_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epu8_mask&expand=815)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpeq_epu8_mask&expand=816)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpeq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmpeq_epu8_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpeq_epi16_mask&expand=771)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpeq_epi16_mask&expand=772)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpeq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmpeq_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epi16_mask&expand=769)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpeq_epi16_mask&expand=770)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpeq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmpeq_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epi16_mask&expand=767)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpeq_epi16_mask&expand=768)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpeq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpeq_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpeq_epi8_mask&expand=795)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpeq_epi8_mask&expand=796)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpeq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmpeq_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epi8_mask&expand=793)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpeq_epi8_mask&expand=794)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpeq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmpeq_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epi8_mask&expand=791)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpeq_epi8_mask&expand=792)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpeq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmpeq_epi8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpneq_epu16_mask&expand=1106)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpneq_epu16_mask&expand=1107)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpneq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmpneq_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpneq_epu16_mask&expand=1104)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpneq_epu16_mask&expand=1105)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpneq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmpneq_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_epu16_mask&expand=1102)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpneq_epu16_mask&expand=1103)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpneq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpneq_epu16_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpneq_epu8_mask&expand=1124)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpneq_epu8_mask&expand=1125)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpneq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmpneq_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpneq_epu8_mask&expand=1122)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpneq_epu8_mask&expand=1123)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpneq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmpneq_epu8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_epu8_mask&expand=1120)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed unsigned 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpneq_epu8_mask&expand=1121)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpneq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmpneq_epu8_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpneq_epi16_mask&expand=1082)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpneq_epi16_mask&expand=1083)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpneq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 {
+ _mm512_cmpneq_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpneq_epi16_mask&expand=1080)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpneq_epi16_mask&expand=1081)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpneq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 {
+ _mm256_cmpneq_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_epi16_mask&expand=1078)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 16-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpneq_epi16_mask&expand=1079)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpneq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpneq_epi16_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpneq_epi8_mask&expand=1100)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpneq_epi8_mask&expand=1101)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm512_mask_cmpneq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 {
+ _mm512_cmpneq_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpneq_epi8_mask&expand=1098)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpneq_epi8_mask&expand=1099)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm256_mask_cmpneq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 {
+ _mm256_cmpneq_epi8_mask(a, b) & k1
+}
+
+/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_epi8_mask&expand=1096)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Compare packed signed 8-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpneq_epi8_mask&expand=1097)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))]
+pub unsafe fn _mm_mask_cmpneq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 {
+ _mm_cmpneq_epi8_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by `IMM8`, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_epu16_mask&expand=715)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm3!(IMM8);
+ let a = a.as_u16x32();
+ let b = b.as_u16x32();
+ let r = vpcmpuw(a, b, IMM8, 0b11111111_11111111_11111111_11111111);
+ transmute(r)
+}
+
+/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_epu16_mask&expand=716)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm3!(IMM8);
+ let a = a.as_u16x32();
+ let b = b.as_u16x32();
+ let r = vpcmpuw(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_epu16_mask&expand=713)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_u16x16();
+ let b = b.as_u16x16();
+ let r = vpcmpuw256(a, b, IMM8, 0b11111111_11111111);
+ transmute(r)
+}
+
+/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmp_epu16_mask&expand=714)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_u16x16();
+ let b = b.as_u16x16();
+ let r = vpcmpuw256(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_epu16_mask&expand=711)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_u16x8();
+ let b = b.as_u16x8();
+ let r = vpcmpuw128(a, b, IMM8, 0b11111111);
+ transmute(r)
+}
+
+/// Compare packed unsigned 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_epu16_mask&expand=712)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_u16x8();
+ let b = b.as_u16x8();
+ let r = vpcmpuw128(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_epu8_mask&expand=733)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm3!(IMM8);
+ let a = a.as_u8x64();
+ let b = b.as_u8x64();
+ let r = vpcmpub(
+ a,
+ b,
+ IMM8,
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ );
+ transmute(r)
+}
+
+/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_epu8_mask&expand=734)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm3!(IMM8);
+ let a = a.as_u8x64();
+ let b = b.as_u8x64();
+ let r = vpcmpub(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_epu8_mask&expand=731)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_u8x32();
+ let b = b.as_u8x32();
+ let r = vpcmpub256(a, b, IMM8, 0b11111111_11111111_11111111_11111111);
+ transmute(r)
+}
+
+/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmp_epu8_mask&expand=732)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_u8x32();
+ let b = b.as_u8x32();
+ let r = vpcmpub256(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_epu8_mask&expand=729)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_u8x16();
+ let b = b.as_u8x16();
+ let r = vpcmpub128(a, b, IMM8, 0b11111111_11111111);
+ transmute(r)
+}
+
+/// Compare packed unsigned 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_epu8_mask&expand=730)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_u8x16();
+ let b = b.as_u8x16();
+ let r = vpcmpub128(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_epi16_mask&expand=691)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm3!(IMM8);
+ let a = a.as_i16x32();
+ let b = b.as_i16x32();
+ let r = vpcmpw(a, b, IMM8, 0b11111111_11111111_11111111_11111111);
+ transmute(r)
+}
+
+/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_epi16_mask&expand=692)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm3!(IMM8);
+ let a = a.as_i16x32();
+ let b = b.as_i16x32();
+ let r = vpcmpw(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_epi16_mask&expand=689)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_i16x16();
+ let b = b.as_i16x16();
+ let r = vpcmpw256(a, b, IMM8, 0b11111111_11111111);
+ transmute(r)
+}
+
+/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmp_epi16_mask&expand=690)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_i16x16();
+ let b = b.as_i16x16();
+ let r = vpcmpw256(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_epi16_mask&expand=687)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_i16x8();
+ let b = b.as_i16x8();
+ let r = vpcmpw128(a, b, IMM8, 0b11111111);
+ transmute(r)
+}
+
+/// Compare packed signed 16-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_epi16_mask&expand=688)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_i16x8();
+ let b = b.as_i16x8();
+ let r = vpcmpw128(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_epi8_mask&expand=709)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm3!(IMM8);
+ let a = a.as_i8x64();
+ let b = b.as_i8x64();
+ let r = vpcmpb(
+ a,
+ b,
+ IMM8,
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ );
+ transmute(r)
+}
+
+/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_epi8_mask&expand=710)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm3!(IMM8);
+ let a = a.as_i8x64();
+ let b = b.as_i8x64();
+ let r = vpcmpb(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_epi8_mask&expand=707)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_i8x32();
+ let b = b.as_i8x32();
+ let r = vpcmpb256(a, b, IMM8, 0b11111111_11111111_11111111_11111111);
+ transmute(r)
+}
+
+/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmp_epi8_mask&expand=708)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_i8x32();
+ let b = b.as_i8x32();
+ let r = vpcmpb256(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_epi8_mask&expand=705)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_i8x16();
+ let b = b.as_i8x16();
+ let r = vpcmpb128(a, b, IMM8, 0b11111111_11111111);
+ transmute(r)
+}
+
+/// Compare packed signed 8-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_epi8_mask&expand=706)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm3!(IMM8);
+ let a = a.as_i8x16();
+ let b = b.as_i8x16();
+ let r = vpcmpb128(a, b, IMM8, k1);
+ transmute(r)
+}
+
+/// Load 512-bits (composed of 32 packed 16-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_loadu_epi16&expand=3368)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
+pub unsafe fn _mm512_loadu_epi16(mem_addr: *const i16) -> __m512i {
+ ptr::read_unaligned(mem_addr as *const __m512i)
+}
+
+/// Load 256-bits (composed of 16 packed 16-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_loadu_epi16&expand=3365)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
+pub unsafe fn _mm256_loadu_epi16(mem_addr: *const i16) -> __m256i {
+ ptr::read_unaligned(mem_addr as *const __m256i)
+}
+
+/// Load 128-bits (composed of 8 packed 16-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadu_epi16&expand=3362)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
+pub unsafe fn _mm_loadu_epi16(mem_addr: *const i16) -> __m128i {
+ ptr::read_unaligned(mem_addr as *const __m128i)
+}
+
+/// Load 512-bits (composed of 64 packed 8-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_loadu_epi8&expand=3395)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
+pub unsafe fn _mm512_loadu_epi8(mem_addr: *const i8) -> __m512i {
+ ptr::read_unaligned(mem_addr as *const __m512i)
+}
+
+/// Load 256-bits (composed of 32 packed 8-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_loadu_epi8&expand=3392)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
+pub unsafe fn _mm256_loadu_epi8(mem_addr: *const i8) -> __m256i {
+ ptr::read_unaligned(mem_addr as *const __m256i)
+}
+
+/// Load 128-bits (composed of 16 packed 8-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadu_epi8&expand=3389)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
+pub unsafe fn _mm_loadu_epi8(mem_addr: *const i8) -> __m128i {
+ ptr::read_unaligned(mem_addr as *const __m128i)
+}
+
+/// Store 512-bits (composed of 32 packed 16-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_storeu_epi16&expand=5622)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
+pub unsafe fn _mm512_storeu_epi16(mem_addr: *mut i16, a: __m512i) {
+ ptr::write_unaligned(mem_addr as *mut __m512i, a);
+}
+
+/// Store 256-bits (composed of 16 packed 16-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_storeu_epi16&expand=5620)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
+pub unsafe fn _mm256_storeu_epi16(mem_addr: *mut i16, a: __m256i) {
+ ptr::write_unaligned(mem_addr as *mut __m256i, a);
+}
+
+/// Store 128-bits (composed of 8 packed 16-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storeu_epi16&expand=5618)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16
+pub unsafe fn _mm_storeu_epi16(mem_addr: *mut i16, a: __m128i) {
+ ptr::write_unaligned(mem_addr as *mut __m128i, a);
+}
+
+/// Store 512-bits (composed of 64 packed 8-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_storeu_epi8&expand=5640)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
+pub unsafe fn _mm512_storeu_epi8(mem_addr: *mut i8, a: __m512i) {
+ ptr::write_unaligned(mem_addr as *mut __m512i, a);
+}
+
+/// Store 256-bits (composed of 32 packed 8-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_storeu_epi8&expand=5638)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
+pub unsafe fn _mm256_storeu_epi8(mem_addr: *mut i8, a: __m256i) {
+ ptr::write_unaligned(mem_addr as *mut __m256i, a);
+}
+
+/// Store 128-bits (composed of 16 packed 8-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storeu_epi8&expand=5636)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8
+pub unsafe fn _mm_storeu_epi8(mem_addr: *mut i8, a: __m128i) {
+ ptr::write_unaligned(mem_addr as *mut __m128i, a);
+}
+
+/// Load packed 16-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_loadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw")]
+pub unsafe fn _mm512_mask_loadu_epi16(src: __m512i, k: __mmask32, mem_addr: *const i16) -> __m512i {
+ let mut dst: __m512i = src;
+ asm!(
+ vpl!("vmovdqu16 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 16-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_loadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw")]
+pub unsafe fn _mm512_maskz_loadu_epi16(k: __mmask32, mem_addr: *const i16) -> __m512i {
+ let mut dst: __m512i;
+ asm!(
+ vpl!("vmovdqu16 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 8-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_loadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw")]
+pub unsafe fn _mm512_mask_loadu_epi8(src: __m512i, k: __mmask64, mem_addr: *const i8) -> __m512i {
+ let mut dst: __m512i = src;
+ asm!(
+ vpl!("vmovdqu8 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 8-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_loadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw")]
+pub unsafe fn _mm512_maskz_loadu_epi8(k: __mmask64, mem_addr: *const i8) -> __m512i {
+ let mut dst: __m512i;
+ asm!(
+ vpl!("vmovdqu8 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 16-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_loadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx")]
+pub unsafe fn _mm256_mask_loadu_epi16(src: __m256i, k: __mmask16, mem_addr: *const i16) -> __m256i {
+ let mut dst: __m256i = src;
+ asm!(
+ vpl!("vmovdqu16 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 16-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_loadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_loadu_epi16(k: __mmask16, mem_addr: *const i16) -> __m256i {
+ let mut dst: __m256i;
+ asm!(
+ vpl!("vmovdqu16 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 8-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_loadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx")]
+pub unsafe fn _mm256_mask_loadu_epi8(src: __m256i, k: __mmask32, mem_addr: *const i8) -> __m256i {
+ let mut dst: __m256i = src;
+ asm!(
+ vpl!("vmovdqu8 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 8-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_loadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_loadu_epi8(k: __mmask32, mem_addr: *const i8) -> __m256i {
+ let mut dst: __m256i;
+ asm!(
+ vpl!("vmovdqu8 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 16-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_loadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_loadu_epi16(src: __m128i, k: __mmask8, mem_addr: *const i16) -> __m128i {
+ let mut dst: __m128i = src;
+ asm!(
+ vpl!("vmovdqu16 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 16-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_loadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_loadu_epi16(k: __mmask8, mem_addr: *const i16) -> __m128i {
+ let mut dst: __m128i;
+ asm!(
+ vpl!("vmovdqu16 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 8-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_loadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_loadu_epi8(src: __m128i, k: __mmask16, mem_addr: *const i8) -> __m128i {
+ let mut dst: __m128i = src;
+ asm!(
+ vpl!("vmovdqu8 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 8-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_loadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_loadu_epi8(k: __mmask16, mem_addr: *const i8) -> __m128i {
+ let mut dst: __m128i;
+ asm!(
+ vpl!("vmovdqu8 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Store packed 16-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_storeu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw")]
+pub unsafe fn _mm512_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask32, a: __m512i) {
+ asm!(
+ vps!("vmovdqu16", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(zmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 8-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_storeu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw")]
+pub unsafe fn _mm512_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask64, a: __m512i) {
+ asm!(
+ vps!("vmovdqu8", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(zmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 16-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_storeu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx")]
+pub unsafe fn _mm256_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask16, a: __m256i) {
+ asm!(
+ vps!("vmovdqu16", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(ymm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 8-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_storeu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx")]
+pub unsafe fn _mm256_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask32, a: __m256i) {
+ asm!(
+ vps!("vmovdqu8", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(ymm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 16-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_storeu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask8, a: __m128i) {
+ asm!(
+ vps!("vmovdqu16", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(xmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 8-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_storeu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask16, a: __m128i) {
+ asm!(
+ vps!("vmovdqu8", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(xmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_madd_epi16&expand=3511)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_madd_epi16&expand=3512)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_madd_epi16&expand=3513)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_madd_epi16&expand=3509)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_madd_epi16&expand=3510)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_madd_epi16&expand=3506)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_madd_epi16&expand=3507)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Vertically multiply each unsigned 8-bit integer from a with the corresponding signed 8-bit integer from b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maddubs_epi16&expand=3539)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_maddubs_epi16&expand=3540)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_maddubs_epi16&expand=3541)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_maddubs_epi16&expand=3537)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_maddubs_epi16&expand=3538)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_maddubs_epi16&expand=3534)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Multiply packed unsigned 8-bit integers in a by packed signed 8-bit integers in b, producing intermediate signed 16-bit integers. Horizontally add adjacent pairs of intermediate signed 16-bit integers, and pack the saturated results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_maddubs_epi16&expand=3535)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_packs_epi32&expand=4091)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_packs_epi32&expand=4089)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_packs_epi32&expand=4090)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_packs_epi32&expand=4086)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_packs_epi32&expand=4087)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_packs_epi32&expand=4083)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_packs_epi32&expand=4084)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_packs_epi16&expand=4082)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_packs_epi16&expand=4080)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_packs_epi16&expand=4081)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_packs_epi16&expand=4077)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=#text=_mm256_maskz_packs_epi16&expand=4078)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_packs_epi16&expand=4074)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_packs_epi16&expand=4075)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_packus_epi32&expand=4130)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_packus_epi32&expand=4128)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_packus_epi32&expand=4129)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_packus_epi32&expand=4125)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_packus_epi32&expand=4126)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_packus_epi32&expand=4122)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_packus_epi32&expand=4123)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_packus_epi16&expand=4121)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_packus_epi16&expand=4119)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_packus_epi16&expand=4120)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_packus_epi16&expand=4116)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_packus_epi16&expand=4117)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_packus_epi16&expand=4113)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_packus_epi16&expand=4114)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Average packed unsigned 16-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_avg_epu16&expand=388)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpavgw))]
+pub unsafe fn _mm512_avg_epu16(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpavgw(a.as_u16x32(), b.as_u16x32()))
+}
+
+/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_avg_epu16&expand=389)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_avg_epu16&expand=390)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_avg_epu16&expand=386)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_avg_epu16&expand=387)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_avg_epu16&expand=383)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Average packed unsigned 16-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_avg_epu16&expand=384)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Average packed unsigned 8-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_avg_epu8&expand=397)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpavgb))]
+pub unsafe fn _mm512_avg_epu8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpavgb(a.as_u8x64(), b.as_u8x64()))
+}
+
+/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_avg_epu8&expand=398)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_avg_epu8&expand=399)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_avg_epu8&expand=395)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_avg_epu8&expand=396)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_avg_epu8&expand=392)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Average packed unsigned 8-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_avg_epu8&expand=393)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sll_epi16&expand=5271)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sll_epi16&expand=5269)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sll_epi16&expand=5270)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sll_epi16&expand=5266)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sll_epi16&expand=5267)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sll_epi16&expand=5263)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sll_epi16&expand=5264)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_slli_epi16&expand=5301)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm_u8!(IMM8);
+ let a = a.as_i16x32();
+ let r = vpslliw(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_slli_epi16&expand=5299)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm_u8!(IMM8);
+ let a = a.as_i16x32();
+ let shf = vpslliw(a, IMM8);
+ transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
+}
+
+/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_slli_epi16&expand=5300)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm_u8!(IMM8);
+ let a = a.as_i16x32();
+ let shf = vpslliw(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i16x32();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_slli_epi16&expand=5296)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = pslliw256(a.as_i16x16(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i16x16()))
+}
+
+/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_slli_epi16&expand=5297)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = pslliw256(a.as_i16x16(), imm8);
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_slli_epi16&expand=5293)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = pslliw128(a.as_i16x8(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i16x8()))
+}
+
+/// Shift packed 16-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_slli_epi16&expand=5294)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = pslliw128(a.as_i16x8(), imm8);
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sllv_epi16&expand=5333)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sllv_epi16&expand=5331)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sllv_epi16&expand=5332)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sllv_epi16&expand=5330)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sllv_epi16&expand=5328)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sllv_epi16&expand=5329)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sllv_epi16&expand=5327)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sllv_epi16&expand=5325)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sllv_epi16&expand=5326)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srl_epi16&expand=5483)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srl_epi16&expand=5481)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srl_epi16&expand=5482)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srl_epi16&expand=5478)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srl_epi16&expand=5479)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srl_epi16&expand=5475)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srl_epi16&expand=5476)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srli_epi16&expand=5513)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm_u8!(IMM8);
+ let a = a.as_i16x32();
+ let r = vpsrliw(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srli_epi16&expand=5511)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm_u8!(IMM8);
+ let a = a.as_i16x32();
+ let shf = vpsrliw(a, IMM8);
+ transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srli_epi16&expand=5512)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ //imm8 should be u32, it seems the document to verify is incorrect
+ let a = a.as_i16x32();
+ let shf = vpsrliw(a, IMM8 as u32);
+ let zero = _mm512_setzero_si512().as_i16x32();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srli_epi16&expand=5508)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shf = _mm256_srli_epi16::<IMM8>(a);
+ transmute(simd_select_bitmask(k, shf.as_i16x16(), src.as_i16x16()))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srli_epi16&expand=5509)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shf = _mm256_srli_epi16::<IMM8>(a);
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, shf.as_i16x16(), zero))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srli_epi16&expand=5505)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shf = _mm_srli_epi16::<IMM8>(a);
+ transmute(simd_select_bitmask(k, shf.as_i16x8(), src.as_i16x8()))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srli_epi16&expand=5506)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shf = _mm_srli_epi16::<IMM8>(a);
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, shf.as_i16x8(), zero))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srlv_epi16&expand=5545)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srlv_epi16&expand=5543)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srlv_epi16&expand=5544)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srlv_epi16&expand=5542)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srlv_epi16&expand=5540)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srlv_epi16&expand=5541)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srlv_epi16&expand=5539)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srlv_epi16&expand=5537)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srlv_epi16&expand=5538)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sra_epi16&expand=5398)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sra_epi16&expand=5396)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sra_epi16&expand=5397)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sra_epi16&expand=5393)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sra_epi16&expand=5394)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sra_epi16&expand=5390)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sra_epi16&expand=5391)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srai_epi16&expand=5427)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm_u8!(IMM8);
+ let a = a.as_i16x32();
+ let r = vpsraiw(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srai_epi16&expand=5425)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm_u8!(IMM8);
+ let a = a.as_i16x32();
+ let shf = vpsraiw(a, IMM8);
+ transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srai_epi16&expand=5426)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm_u8!(IMM8);
+ let a = a.as_i16x32();
+ let shf = vpsraiw(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i16x32();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srai_epi16&expand=5422)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psraiw256(a.as_i16x16(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i16x16()))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srai_epi16&expand=5423)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psraiw256(a.as_i16x16(), imm8);
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srai_epi16&expand=5419)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psraiw128(a.as_i16x8(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i16x8()))
+}
+
+/// Shift packed 16-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srai_epi16&expand=5420)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psraiw128(a.as_i16x8(), imm8);
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srav_epi16&expand=5456)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srav_epi16&expand=5454)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srav_epi16&expand=5455)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srav_epi16&expand=5453)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srav_epi16&expand=5451)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srav_epi16&expand=5452)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srav_epi16&expand=5450)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srav_epi16&expand=5448)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shift packed 16-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srav_epi16&expand=5449)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutex2var_epi16&expand=4226)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
+pub unsafe fn _mm512_permutex2var_epi16(a: __m512i, idx: __m512i, b: __m512i) -> __m512i {
+ transmute(vpermi2w(a.as_i16x32(), idx.as_i16x32(), b.as_i16x32()))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutex2var_epi16&expand=4223)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutex2var_epi16&expand=4225)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
+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))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask2_permutex2var_epi16&expand=4224)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutex2var_epi16&expand=4222)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
+pub unsafe fn _mm256_permutex2var_epi16(a: __m256i, idx: __m256i, b: __m256i) -> __m256i {
+ transmute(vpermi2w256(a.as_i16x16(), idx.as_i16x16(), b.as_i16x16()))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutex2var_epi16&expand=4219)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutex2var_epi16&expand=4221)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
+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))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask2_permutex2var_epi16&expand=4220)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutex2var_epi16&expand=4218)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
+pub unsafe fn _mm_permutex2var_epi16(a: __m128i, idx: __m128i, b: __m128i) -> __m128i {
+ transmute(vpermi2w128(a.as_i16x8(), idx.as_i16x8(), b.as_i16x8()))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permutex2var_epi16&expand=4215)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permutex2var_epi16&expand=4217)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2w or vpermt2w
+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))
+}
+
+/// Shuffle 16-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask2_permutex2var_epi16&expand=4216)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutexvar_epi16&expand=4295)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutexvar_epi16&expand=4293)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutexvar_epi16&expand=4294)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutexvar_epi16&expand=4292)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutexvar_epi16&expand=4290)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutexvar_epi16&expand=4291)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutexvar_epi16&expand=4289)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permutexvar_epi16&expand=4287)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shuffle 16-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permutexvar_epi16&expand=4288)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Blend packed 16-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_blend_epi16&expand=430)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw
+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()))
+}
+
+/// Blend packed 16-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_blend_epi16&expand=429)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw
+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()))
+}
+
+/// Blend packed 16-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_blend_epi16&expand=427)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw
+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()))
+}
+
+/// Blend packed 8-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_blend_epi8&expand=441)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb
+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()))
+}
+
+/// Blend packed 8-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_blend_epi8&expand=440)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb
+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()))
+}
+
+/// Blend packed 8-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_blend_epi8&expand=439)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb
+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()))
+}
+
+/// Broadcast the low packed 16-bit integer from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_broadcastw_epi16&expand=587)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_shuffle32!(
+ 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)
+}
+
+/// Broadcast the low packed 16-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_broadcastw_epi16&expand=588)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_broadcastw_epi16&expand=589)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Broadcast the low packed 16-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_broadcastw_epi16&expand=585)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_broadcastw_epi16&expand=586)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Broadcast the low packed 16-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_broadcastw_epi16&expand=582)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_broadcastw_epi16&expand=583)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Broadcast the low packed 8-bit integer from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_broadcastb_epi8&expand=536)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_shuffle64!(
+ 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)
+}
+
+/// Broadcast the low packed 8-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_broadcastb_epi8&expand=537)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Broadcast the low packed 8-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_broadcastb_epi8&expand=538)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Broadcast the low packed 8-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_broadcastb_epi8&expand=534)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Broadcast the low packed 8-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_broadcastb_epi8&expand=535)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Broadcast the low packed 8-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_broadcastb_epi8&expand=531)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Broadcast the low packed 8-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_broadcastb_epi8&expand=532)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpackhi_epi16&expand=6012)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_shuffle32!(
+ 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)
+}
+
+/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpackhi_epi16&expand=6010)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpackhi_epi16&expand=6011)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpackhi_epi16&expand=6007)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpackhi_epi16&expand=6008)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpackhi_epi16&expand=6004)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Unpack and interleave 16-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpackhi_epi16&expand=6005)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpackhi_epi8&expand=6039)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_shuffle64!(
+ 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)
+}
+
+/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpackhi_epi8&expand=6037)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpackhi_epi8&expand=6038)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpackhi_epi8&expand=6034)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpackhi_epi8&expand=6035)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpackhi_epi8&expand=6031)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Unpack and interleave 8-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpackhi_epi8&expand=6032)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpacklo_epi16&expand=6069)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_shuffle32!(
+ 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)
+}
+
+/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpacklo_epi16&expand=6067)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpacklo_epi16&expand=6068)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpacklo_epi16&expand=6064)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpacklo_epi16&expand=6065)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpacklo_epi16&expand=6061)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Unpack and interleave 16-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpacklo_epi16&expand=6062)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpacklo_epi8&expand=6096)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_shuffle64!(
+ 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)
+}
+
+/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpacklo_epi8&expand=6094)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpacklo_epi8&expand=6095)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpacklo_epi8&expand=6091)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpacklo_epi8&expand=6092)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpacklo_epi8&expand=6088)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Unpack and interleave 8-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpacklo_epi8&expand=6089)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Move packed 16-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mov_epi16&expand=3795)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Move packed 16-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mov_epi16&expand=3796)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Move packed 16-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mov_epi16&expand=3793)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Move packed 16-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mov_epi16&expand=3794)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Move packed 16-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mov_epi16&expand=3791)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Move packed 16-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mov_epi16&expand=3792)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Move packed 8-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mov_epi8&expand=3813)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Move packed 8-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mov_epi8&expand=3814)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Move packed 8-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mov_epi8&expand=3811)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Move packed 8-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mov_epi8&expand=3812)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Move packed 8-bit integers from a into dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mov_epi8&expand=3809)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Move packed 8-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mov_epi8&expand=3810)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Broadcast 16-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_set1_epi16&expand=4942)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_set1_epi16&expand=4943)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Broadcast 16-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_set1_epi16&expand=4939)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_set1_epi16&expand=4940)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Broadcast 16-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_set1_epi16&expand=4936)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Broadcast the low packed 16-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_set1_epi16&expand=4937)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Broadcast 8-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_set1_epi8&expand=4970)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpbroadcastb))]
+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()))
+}
+
+/// Broadcast 8-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_set1_epi8&expand=4971)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(vpbroadcastb))]
+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))
+}
+
+/// Broadcast 8-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_set1_epi8&expand=4967)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastb))]
+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()))
+}
+
+/// Broadcast 8-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_set1_epi8&expand=4968)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastb))]
+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))
+}
+
+/// Broadcast 8-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_set1_epi8&expand=4964)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastb))]
+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()))
+}
+
+/// Broadcast 8-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_set1_epi8&expand=4965)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastb))]
+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))
+}
+
+/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from from a to dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shufflelo_epi16&expand=5221)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ let a = a.as_i16x32();
+ let r: i16x32 = simd_shuffle32!(
+ a,
+ a,
+ <const IMM8: i32> [
+ 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)
+}
+
+/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shufflelo_epi16&expand=5219)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ let r = _mm512_shufflelo_epi16::<IMM8>(a);
+ transmute(simd_select_bitmask(k, r.as_i16x32(), src.as_i16x32()))
+}
+
+/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from from a to dst, using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shufflelo_epi16&expand=5220)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ let r = _mm512_shufflelo_epi16::<IMM8>(a);
+ let zero = _mm512_setzero_si512().as_i16x32();
+ transmute(simd_select_bitmask(k, r.as_i16x32(), zero))
+}
+
+/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shufflelo_epi16&expand=5216)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shuffle = _mm256_shufflelo_epi16::<IMM8>(a);
+ transmute(simd_select_bitmask(k, shuffle.as_i16x16(), src.as_i16x16()))
+}
+
+/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shufflelo_epi16&expand=5217)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shuffle = _mm256_shufflelo_epi16::<IMM8>(a);
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, shuffle.as_i16x16(), zero))
+}
+
+/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shufflelo_epi16&expand=5213)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shuffle = _mm_shufflelo_epi16::<IMM8>(a);
+ transmute(simd_select_bitmask(k, shuffle.as_i16x8(), src.as_i16x8()))
+}
+
+/// Shuffle 16-bit integers in the low 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the low 64 bits of 128-bit lanes of dst, with the high 64 bits of 128-bit lanes being copied from from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shufflelo_epi16&expand=5214)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shuffle = _mm_shufflelo_epi16::<IMM8>(a);
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, shuffle.as_i16x8(), zero))
+}
+
+/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from from a to dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shufflehi_epi16&expand=5212)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ let a = a.as_i16x32();
+ let r: i16x32 = simd_shuffle32!(
+ a,
+ a,
+ <const IMM8: i32> [
+ 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)
+}
+
+/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shufflehi_epi16&expand=5210)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ let r = _mm512_shufflehi_epi16::<IMM8>(a);
+ transmute(simd_select_bitmask(k, r.as_i16x32(), src.as_i16x32()))
+}
+
+/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from from a to dst, using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shufflehi_epi16&expand=5211)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ let r = _mm512_shufflehi_epi16::<IMM8>(a);
+ let zero = _mm512_setzero_si512().as_i16x32();
+ transmute(simd_select_bitmask(k, r.as_i16x32(), zero))
+}
+
+/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shufflehi_epi16&expand=5207)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shuffle = _mm256_shufflehi_epi16::<IMM8>(a);
+ transmute(simd_select_bitmask(k, shuffle.as_i16x16(), src.as_i16x16()))
+}
+
+/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from from a to dst, using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shufflehi_epi16&expand=5208)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shuffle = _mm256_shufflehi_epi16::<IMM8>(a);
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, shuffle.as_i16x16(), zero))
+}
+
+/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from from a to dst, using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shufflehi_epi16&expand=5204)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shuffle = _mm_shufflehi_epi16::<IMM8>(a);
+ transmute(simd_select_bitmask(k, shuffle.as_i16x8(), src.as_i16x8()))
+}
+
+/// Shuffle 16-bit integers in the high 64 bits of 128-bit lanes of a using the control in imm8. Store the results in the high 64 bits of 128-bit lanes of dst, with the low 64 bits of 128-bit lanes being copied from from a to dst, using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shufflehi_epi16&expand=5205)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let shuffle = _mm_shufflehi_epi16::<IMM8>(a);
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, shuffle.as_i16x8(), zero))
+}
+
+/// Shuffle packed 8-bit integers in a according to shuffle control mask in the corresponding 8-bit element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shuffle_epi8&expand=5159)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shuffle 8-bit integers in a within 128-bit lanes using the control in the corresponding 8-bit element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shuffle_epi8&expand=5157)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Shuffle packed 8-bit integers in a according to shuffle control mask in the corresponding 8-bit element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shuffle_epi8&expand=5158)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Shuffle 8-bit integers in a within 128-bit lanes using the control in the corresponding 8-bit element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shuffle_epi8&expand=5154)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shuffle packed 8-bit integers in a according to shuffle control mask in the corresponding 8-bit element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shuffle_epi8&expand=5155)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Shuffle 8-bit integers in a within 128-bit lanes using the control in the corresponding 8-bit element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shuffle_epi8&expand=5151)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Shuffle packed 8-bit integers in a according to shuffle control mask in the corresponding 8-bit element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shuffle_epi8&expand=5152)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_test_epi16_mask&expand=5884)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_test_epi16_mask&expand=5883)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_test_epi16_mask&expand=5882)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_test_epi16_mask&expand=5881)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_test_epi16_mask&expand=5880)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_test_epi16_mask&expand=5879)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_test_epi8_mask&expand=5902)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_test_epi8_mask&expand=5901)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_test_epi8_mask&expand=5900)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_test_epi8_mask&expand=5899)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_test_epi8_mask&expand=5898)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise AND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_test_epi8_mask&expand=5897)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_testn_epi16_mask&expand=5915)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_testn_epi16&expand=5914)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testn_epi16_mask&expand=5913)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_testn_epi16_mask&expand=5912)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testn_epi16_mask&expand=5911)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 16-bit integers in a and b, producing intermediate 16-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_testn_epi16_mask&expand=5910)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_testn_epi8_mask&expand=5933)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_testn_epi8_mask&expand=5932)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testn_epi8_mask&expand=5931)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_testn_epi8_mask&expand=5930)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testn_epi8_mask&expand=5929)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Compute the bitwise NAND of packed 8-bit integers in a and b, producing intermediate 8-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_testn_epi8_mask&expand=5928)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Store 64-bit mask from a into memory.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_store_mask64&expand=5578)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(mov))] //should be kmovq
+pub unsafe fn _store_mask64(mem_addr: *mut u64, a: __mmask64) {
+ ptr::write(mem_addr as *mut __mmask64, a);
+}
+
+/// Store 32-bit mask from a into memory.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_store_mask32&expand=5577)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(mov))] //should be kmovd
+pub unsafe fn _store_mask32(mem_addr: *mut u32, a: __mmask32) {
+ ptr::write(mem_addr as *mut __mmask32, a);
+}
+
+/// Load 64-bit mask from memory into k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_load_mask64&expand=3318)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(mov))] //should be kmovq
+pub unsafe fn _load_mask64(mem_addr: *const u64) -> __mmask64 {
+ ptr::read(mem_addr as *const __mmask64)
+}
+
+/// Load 32-bit mask from memory into k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_load_mask32&expand=3317)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(mov))] //should be kmovd
+pub unsafe fn _load_mask32(mem_addr: *const u32) -> __mmask32 {
+ ptr::read(mem_addr as *const __mmask32)
+}
+
+/// Compute the absolute differences of packed unsigned 8-bit integers in a and b, then horizontally sum each consecutive 8 differences to produce eight unsigned 16-bit integers, and pack these unsigned 16-bit integers in the low 16 bits of 64-bit elements in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sad_epu8&expand=4855)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst. Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_dbsad_epu8&expand=2114)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ let a = a.as_u8x64();
+ let b = b.as_u8x64();
+ let r = vdbpsadbw(a, b, IMM8);
+ transmute(r)
+}
+
+/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_dbsad_epu8&expand=2115)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ 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()))
+}
+
+/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_dbsad_epu8&expand=2116)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ 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(),
+ ))
+}
+
+/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst. Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_dbsad_epu8&expand=2111)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let a = a.as_u8x32();
+ let b = b.as_u8x32();
+ let r = vdbpsadbw256(a, b, IMM8);
+ transmute(r)
+}
+
+/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_dbsad_epu8&expand=2112)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ 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()))
+}
+
+/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_dbsad_epu8&expand=2113)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ 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(),
+ ))
+}
+
+/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst. Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_dbsad_epu8&expand=2108)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let a = a.as_u8x16();
+ let b = b.as_u8x16();
+ let r = vdbpsadbw128(a, b, IMM8);
+ transmute(r)
+}
+
+/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_dbsad_epu8&expand=2109)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ 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()))
+}
+
+/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_dbsad_epu8&expand=2110)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vdbpsadbw, IMM8 = 0))]
+pub unsafe fn _mm_maskz_dbsad_epu8<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_u8x16();
+ let b = b.as_u8x16();
+ let r = vdbpsadbw128(a, b, IMM8);
+ transmute(simd_select_bitmask(k, r, _mm_setzero_si128().as_u16x8()))
+}
+
+/// Set each bit of mask register k based on the most significant bit of the corresponding packed 16-bit integer in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_movepi16_mask&expand=3873)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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)
+}
+
+/// Set each bit of mask register k based on the most significant bit of the corresponding packed 16-bit integer in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_movepi16_mask&expand=3872)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Set each bit of mask register k based on the most significant bit of the corresponding packed 16-bit integer in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movepi16_mask&expand=3871)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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)
+}
+
+/// Set each bit of mask register k based on the most significant bit of the corresponding packed 8-bit integer in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_movepi8_mask&expand=3883)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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)
+}
+
+/// Set each bit of mask register k based on the most significant bit of the corresponding packed 8-bit integer in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_movepi8_mask&expand=3882)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovmskb))] // should be vpmovb2m but compiled to vpmovmskb in the test shim because that takes less cycles than
+ // using vpmovb2m plus converting the mask register to a standard register.
+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)
+}
+
+/// Set each bit of mask register k based on the most significant bit of the corresponding packed 8-bit integer in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movepi8_mask&expand=3881)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovmskb))] // should be vpmovb2m but compiled to vpmovmskb in the test shim because that takes less cycles than
+ // using vpmovb2m plus converting the mask register to a standard register.
+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)
+}
+
+/// Set each packed 16-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_movm_epi16&expand=3886)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Set each packed 16-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_movm_epi16&expand=3885)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Set each packed 16-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movm_epi16&expand=3884)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Set each packed 8-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_movm_epi8&expand=3895)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Set each packed 8-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_movm_epi8&expand=3894)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Set each packed 8-bit integer in dst to all ones or all zeros based on the value of the corresponding bit in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movm_epi8&expand=3893)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Add 32-bit masks in a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kadd_mask32&expand=3207)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(all(test, target_arch = "x86"), assert_instr(add))]
+#[cfg_attr(all(test, target_arch = "x86_64"), assert_instr(lea))] // generate normal lea/add code instead of kaddd
+ //llvm.x86.avx512.kadd.d
+pub unsafe fn _kadd_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
+ transmute(a + b)
+}
+
+/// Add 64-bit masks in a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kadd_mask64&expand=3208)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(all(test, target_arch = "x86"), assert_instr(add))]
+#[cfg_attr(all(test, target_arch = "x86_64"), assert_instr(lea))] // generate normal lea/add code instead of kaddd
+ //llvm.x86.avx512.kadd.d
+pub unsafe fn _kadd_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
+ transmute(a + b)
+}
+
+/// Compute the bitwise AND of 32-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kand_mask32&expand=3213)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(and))] // generate normal and code instead of kandd
+pub unsafe fn _kand_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
+ transmute(a & b)
+}
+
+/// Compute the bitwise AND of 64-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kand_mask64&expand=3214)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(and))] // generate normal and code instead of kandq
+pub unsafe fn _kand_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
+ transmute(a & b)
+}
+
+/// Compute the bitwise NOT of 32-bit mask a, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_knot_mask32&expand=3234)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+pub unsafe fn _knot_mask32(a: __mmask32) -> __mmask32 {
+ transmute(a ^ 0b11111111_11111111_11111111_11111111)
+}
+
+/// Compute the bitwise NOT of 64-bit mask a, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_knot_mask64&expand=3235)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+pub unsafe fn _knot_mask64(a: __mmask64) -> __mmask64 {
+ transmute(a ^ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111)
+}
+
+/// Compute the bitwise NOT of 32-bit masks a and then AND with b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kandn_mask32&expand=3219)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(not))] // generate normal and code instead of kandnd
+pub unsafe fn _kandn_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
+ transmute(_knot_mask32(a) & b)
+}
+
+/// Compute the bitwise NOT of 64-bit masks a and then AND with b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kandn_mask64&expand=3220)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(not))] // generate normal and code instead of kandnq
+pub unsafe fn _kandn_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
+ transmute(_knot_mask64(a) & b)
+}
+
+/// Compute the bitwise OR of 32-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kor_mask32&expand=3240)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(or))] // generate normal and code instead of kord
+pub unsafe fn _kor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
+ transmute(a | b)
+}
+
+/// Compute the bitwise OR of 64-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kor_mask64&expand=3241)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(or))] // generate normal and code instead of korq
+pub unsafe fn _kor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
+ transmute(a | b)
+}
+
+/// Compute the bitwise XOR of 32-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kxor_mask32&expand=3292)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(xor))] // generate normal and code instead of kxord
+pub unsafe fn _kxor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
+ transmute(a ^ b)
+}
+
+/// Compute the bitwise XOR of 64-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kxor_mask64&expand=3293)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(xor))] // generate normal and code instead of kxorq
+pub unsafe fn _kxor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
+ transmute(a ^ b)
+}
+
+/// Compute the bitwise XNOR of 32-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kxnor_mask32&expand=3286)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(xor))] // generate normal and code instead of kxnord
+pub unsafe fn _kxnor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
+ transmute(_knot_mask32(a ^ b))
+}
+
+/// Compute the bitwise XNOR of 64-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kxnor_mask64&expand=3287)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[cfg_attr(test, assert_instr(xor))] // generate normal and code instead of kxnorq
+pub unsafe fn _kxnor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
+ transmute(_knot_mask64(a ^ b))
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi16_epi8&expand=1407)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi16_epi8&expand=1408)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi16_epi8&expand=1409)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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(),
+ ))
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi16_epi8&expand=1404)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi16_epi8&expand=1405)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi16_epi8&expand=1406)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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(),
+ ))
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi16_epi8&expand=1401)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_shuffle16!(a, zero, [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8]);
+ transmute::<i8x16, _>(simd_cast(v256))
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi16_epi8&expand=1402)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi16_epi8&expand=1403)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtsepi16_epi8&expand=1807)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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,
+ ))
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi16_epi8&expand=1808)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtsepi16_epi8&expand=1809)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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,
+ ))
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtsepi16_epi8&expand=1804)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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,
+ ))
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi16_epi8&expand=1805)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtsepi16_epi8&expand=1806)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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,
+ ))
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsepi16_epi8&expand=1801)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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,
+ ))
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi16_epi8&expand=1802)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtsepi16_epi8&expand=1803)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtusepi16_epi8&expand=2042)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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,
+ ))
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi16_epi8&expand=2043)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtusepi16_epi8&expand=2044)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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,
+ ))
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtusepi16_epi8&expand=2039)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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,
+ ))
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi16_epi8&expand=2040)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtusepi16_epi8&expand=2041)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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,
+ ))
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtusepi16_epi8&expand=2036)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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,
+ ))
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi16_epi8&expand=2037)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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))
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtusepi16_epi8&expand=2038)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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,
+ ))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi8_epi16&expand=1526)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi8_epi16&expand=1527)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi8_epi16&expand=1528)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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(),
+ ))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi8_epi16&expand=1524)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi8_epi16&expand=1525)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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(),
+ ))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi8_epi16&expand=1521)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi8_epi16&expand=1522)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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(),
+ ))
+}
+
+/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepu8_epi16&expand=1612)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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))
+}
+
+/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepu8_epi16&expand=1613)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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()))
+}
+
+/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepu8_epi16&expand=1614)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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(),
+ ))
+}
+
+/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepu8_epi16&expand=1610)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepu8_epi16&expand=1611)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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(),
+ ))
+}
+
+/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepu8_epi16&expand=1607)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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()))
+}
+
+/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepu8_epi16&expand=1608)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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(),
+ ))
+}
+
+/// Shift 128-bit lanes in a left by imm8 bytes while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_bslli_epi128&expand=591)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ 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_shuffle64!(
+ zero,
+ a,
+ <const IMM8: i32> [
+ 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)
+}
+
+/// Shift 128-bit lanes in a right by imm8 bytes while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_bsrli_epi128&expand=594)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ let a = a.as_i8x64();
+ let zero = _mm512_setzero_si512().as_i8x64();
+ let r: i8x64 = match IMM8 % 16 {
+ 0 => simd_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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)
+}
+
+/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_alignr_epi8&expand=263)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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 palignr is shifting the pair of vectors more than the size of two
+ // lanes, emit zero.
+ if IMM8 > 32 {
+ return _mm512_set1_epi8(0);
+ }
+ // If palignr is shifting the pair of input vectors more than one lane,
+ // but less than two lanes, convert to shifting in zeroes.
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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_shuffle64!(
+ 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)
+}
+
+/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_alignr_epi8&expand=264)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ let r = _mm512_alignr_epi8::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i8x64(), src.as_i8x64()))
+}
+
+/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_alignr_epi8&expand=265)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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_imm8!(IMM8);
+ let r = _mm512_alignr_epi8::<IMM8>(a, b);
+ let zero = _mm512_setzero_si512().as_i8x64();
+ transmute(simd_select_bitmask(k, r.as_i8x64(), zero))
+}
+
+/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_alignr_epi8&expand=261)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let r = _mm256_alignr_epi8::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i8x32(), src.as_i8x32()))
+}
+
+/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_alignr_epi8&expand=262)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let r = _mm256_alignr_epi8::<IMM8>(a, b);
+ transmute(simd_select_bitmask(
+ k,
+ r.as_i8x32(),
+ _mm256_setzero_si256().as_i8x32(),
+ ))
+}
+
+/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_alignr_epi8&expand=258)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let r = _mm_alignr_epi8::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i8x16(), src.as_i8x16()))
+}
+
+/// Concatenate pairs of 16-byte blocks in a and b into a 32-byte temporary result, shift the result right by imm8 bytes, and store the low 16 bytes in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_alignr_epi8&expand=259)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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_imm8!(IMM8);
+ let r = _mm_alignr_epi8::<IMM8>(a, b);
+ let zero = _mm_setzero_si128().as_i8x16();
+ transmute(simd_select_bitmask(k, r.as_i8x16(), zero))
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi16_storeu_epi8&expand=1812)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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 as *mut i8, a.as_i16x32(), k);
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi16_storeu_epi8&expand=1811)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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 as *mut i8, a.as_i16x16(), k);
+}
+
+/// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi16_storeu_epi8&expand=1810)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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 as *mut i8, a.as_i16x8(), k);
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi16_storeu_epi8&expand=1412)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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 as *mut i8, a.as_i16x32(), k);
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi16_storeu_epi8&expand=1411)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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 as *mut i8, a.as_i16x16(), k);
+}
+
+/// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi16_storeu_epi8&expand=1410)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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 as *mut i8, a.as_i16x8(), k);
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi16_storeu_epi8&expand=2047)
+#[inline]
+#[target_feature(enable = "avx512bw")]
+#[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 as *mut i8, a.as_i16x32(), k);
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi16_storeu_epi8&expand=2046)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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 as *mut i8, a.as_i16x16(), k);
+}
+
+/// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi16_storeu_epi8&expand=2045)
+#[inline]
+#[target_feature(enable = "avx512bw,avx512vl")]
+#[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 as *mut i8, a.as_i16x8(), k);
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.avx512.mask.paddus.w.512"]
+ fn vpaddusw(a: u16x32, b: u16x32, src: u16x32, mask: u32) -> u16x32;
+ #[link_name = "llvm.x86.avx512.mask.paddus.w.256"]
+ fn vpaddusw256(a: u16x16, b: u16x16, src: u16x16, mask: u16) -> u16x16;
+ #[link_name = "llvm.x86.avx512.mask.paddus.w.128"]
+ fn vpaddusw128(a: u16x8, b: u16x8, src: u16x8, mask: u8) -> u16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.paddus.b.512"]
+ fn vpaddusb(a: u8x64, b: u8x64, src: u8x64, mask: u64) -> u8x64;
+ #[link_name = "llvm.x86.avx512.mask.paddus.b.256"]
+ fn vpaddusb256(a: u8x32, b: u8x32, src: u8x32, mask: u32) -> u8x32;
+ #[link_name = "llvm.x86.avx512.mask.paddus.b.128"]
+ fn vpaddusb128(a: u8x16, b: u8x16, src: u8x16, mask: u16) -> u8x16;
+
+ #[link_name = "llvm.x86.avx512.mask.padds.w.512"]
+ fn vpaddsw(a: i16x32, b: i16x32, src: i16x32, mask: u32) -> i16x32;
+ #[link_name = "llvm.x86.avx512.mask.padds.w.256"]
+ fn vpaddsw256(a: i16x16, b: i16x16, src: i16x16, mask: u16) -> i16x16;
+ #[link_name = "llvm.x86.avx512.mask.padds.w.128"]
+ fn vpaddsw128(a: i16x8, b: i16x8, src: i16x8, mask: u8) -> i16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.padds.b.512"]
+ fn vpaddsb(a: i8x64, b: i8x64, src: i8x64, mask: u64) -> i8x64;
+ #[link_name = "llvm.x86.avx512.mask.padds.b.256"]
+ fn vpaddsb256(a: i8x32, b: i8x32, src: i8x32, mask: u32) -> i8x32;
+ #[link_name = "llvm.x86.avx512.mask.padds.b.128"]
+ fn vpaddsb128(a: i8x16, b: i8x16, src: i8x16, mask: u16) -> i8x16;
+
+ #[link_name = "llvm.x86.avx512.mask.psubus.w.512"]
+ fn vpsubusw(a: u16x32, b: u16x32, src: u16x32, mask: u32) -> u16x32;
+ #[link_name = "llvm.x86.avx512.mask.psubus.w.256"]
+ fn vpsubusw256(a: u16x16, b: u16x16, src: u16x16, mask: u16) -> u16x16;
+ #[link_name = "llvm.x86.avx512.mask.psubus.w.128"]
+ fn vpsubusw128(a: u16x8, b: u16x8, src: u16x8, mask: u8) -> u16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.psubus.b.512"]
+ fn vpsubusb(a: u8x64, b: u8x64, src: u8x64, mask: u64) -> u8x64;
+ #[link_name = "llvm.x86.avx512.mask.psubus.b.256"]
+ fn vpsubusb256(a: u8x32, b: u8x32, src: u8x32, mask: u32) -> u8x32;
+ #[link_name = "llvm.x86.avx512.mask.psubus.b.128"]
+ fn vpsubusb128(a: u8x16, b: u8x16, src: u8x16, mask: u16) -> u8x16;
+
+ #[link_name = "llvm.x86.avx512.mask.psubs.w.512"]
+ fn vpsubsw(a: i16x32, b: i16x32, src: i16x32, mask: u32) -> i16x32;
+ #[link_name = "llvm.x86.avx512.mask.psubs.w.256"]
+ fn vpsubsw256(a: i16x16, b: i16x16, src: i16x16, mask: u16) -> i16x16;
+ #[link_name = "llvm.x86.avx512.mask.psubs.w.128"]
+ fn vpsubsw128(a: i16x8, b: i16x8, src: i16x8, mask: u8) -> i16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.psubs.b.512"]
+ fn vpsubsb(a: i8x64, b: i8x64, src: i8x64, mask: u64) -> i8x64;
+ #[link_name = "llvm.x86.avx512.mask.psubs.b.256"]
+ fn vpsubsb256(a: i8x32, b: i8x32, src: i8x32, mask: u32) -> i8x32;
+ #[link_name = "llvm.x86.avx512.mask.psubs.b.128"]
+ fn vpsubsb128(a: i8x16, b: i8x16, src: i8x16, mask: u16) -> i8x16;
+
+ #[link_name = "llvm.x86.avx512.pmulhu.w.512"]
+ fn vpmulhuw(a: u16x32, b: u16x32) -> u16x32;
+ #[link_name = "llvm.x86.avx512.pmulh.w.512"]
+ fn vpmulhw(a: i16x32, b: i16x32) -> i16x32;
+ #[link_name = "llvm.x86.avx512.pmul.hr.sw.512"]
+ fn vpmulhrsw(a: i16x32, b: i16x32) -> i16x32;
+
+ #[link_name = "llvm.x86.avx512.mask.ucmp.w.512"]
+ fn vpcmpuw(a: u16x32, b: u16x32, op: i32, mask: u32) -> u32;
+ #[link_name = "llvm.x86.avx512.mask.ucmp.w.256"]
+ fn vpcmpuw256(a: u16x16, b: u16x16, op: i32, mask: u16) -> u16;
+ #[link_name = "llvm.x86.avx512.mask.ucmp.w.128"]
+ fn vpcmpuw128(a: u16x8, b: u16x8, op: i32, mask: u8) -> u8;
+
+ #[link_name = "llvm.x86.avx512.mask.ucmp.b.512"]
+ fn vpcmpub(a: u8x64, b: u8x64, op: i32, mask: u64) -> u64;
+ #[link_name = "llvm.x86.avx512.mask.ucmp.b.256"]
+ fn vpcmpub256(a: u8x32, b: u8x32, op: i32, mask: u32) -> u32;
+ #[link_name = "llvm.x86.avx512.mask.ucmp.b.128"]
+ fn vpcmpub128(a: u8x16, b: u8x16, op: i32, mask: u16) -> u16;
+
+ #[link_name = "llvm.x86.avx512.mask.cmp.w.512"]
+ fn vpcmpw(a: i16x32, b: i16x32, op: i32, mask: u32) -> u32;
+ #[link_name = "llvm.x86.avx512.mask.cmp.w.256"]
+ fn vpcmpw256(a: i16x16, b: i16x16, op: i32, mask: u16) -> u16;
+ #[link_name = "llvm.x86.avx512.mask.cmp.w.128"]
+ fn vpcmpw128(a: i16x8, b: i16x8, op: i32, mask: u8) -> u8;
+
+ #[link_name = "llvm.x86.avx512.mask.cmp.b.512"]
+ fn vpcmpb(a: i8x64, b: i8x64, op: i32, mask: u64) -> u64;
+ #[link_name = "llvm.x86.avx512.mask.cmp.b.256"]
+ fn vpcmpb256(a: i8x32, b: i8x32, op: i32, mask: u32) -> u32;
+ #[link_name = "llvm.x86.avx512.mask.cmp.b.128"]
+ fn vpcmpb128(a: i8x16, b: i8x16, op: i32, mask: u16) -> u16;
+
+ #[link_name = "llvm.x86.avx512.mask.pmaxu.w.512"]
+ fn vpmaxuw(a: u16x32, b: u16x32) -> u16x32;
+ #[link_name = "llvm.x86.avx512.mask.pmaxu.b.512"]
+ fn vpmaxub(a: u8x64, b: u8x64) -> u8x64;
+ #[link_name = "llvm.x86.avx512.mask.pmaxs.w.512"]
+ fn vpmaxsw(a: i16x32, b: i16x32) -> i16x32;
+ #[link_name = "llvm.x86.avx512.mask.pmaxs.b.512"]
+ fn vpmaxsb(a: i8x64, b: i8x64) -> i8x64;
+
+ #[link_name = "llvm.x86.avx512.mask.pminu.w.512"]
+ fn vpminuw(a: u16x32, b: u16x32) -> u16x32;
+ #[link_name = "llvm.x86.avx512.mask.pminu.b.512"]
+ fn vpminub(a: u8x64, b: u8x64) -> u8x64;
+ #[link_name = "llvm.x86.avx512.mask.pmins.w.512"]
+ fn vpminsw(a: i16x32, b: i16x32) -> i16x32;
+ #[link_name = "llvm.x86.avx512.mask.pmins.b.512"]
+ fn vpminsb(a: i8x64, b: i8x64) -> i8x64;
+
+ #[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.pavg.w.512"]
+ fn vpavgw(a: u16x32, b: u16x32) -> u16x32;
+ #[link_name = "llvm.x86.avx512.pavg.b.512"]
+ fn vpavgb(a: u8x64, b: u8x64) -> u8x64;
+
+ #[link_name = "llvm.x86.avx512.psll.w.512"]
+ fn vpsllw(a: i16x32, count: i16x8) -> i16x32;
+ #[link_name = "llvm.x86.avx512.pslli.w.512"]
+ fn vpslliw(a: i16x32, imm8: u32) -> i16x32;
+
+ #[link_name = "llvm.x86.avx2.pslli.w"]
+ fn pslliw256(a: i16x16, imm8: i32) -> i16x16;
+ #[link_name = "llvm.x86.sse2.pslli.w"]
+ fn pslliw128(a: i16x8, imm8: i32) -> i16x8;
+
+ #[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.psrli.w.512"]
+ fn vpsrliw(a: i16x32, imm8: u32) -> 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.psrai.w.512"]
+ fn vpsraiw(a: i16x32, imm8: u32) -> i16x32;
+
+ #[link_name = "llvm.x86.avx2.psrai.w"]
+ fn psraiw256(a: i16x16, imm8: i32) -> i16x16;
+ #[link_name = "llvm.x86.sse2.psrai.w"]
+ fn psraiw128(a: i16x8, imm8: i32) -> i16x8;
+
+ #[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);
+}
+
+#[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")]
+ 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 as *mut _ as *mut u64, 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 as *mut _ as *mut u32, 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_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_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);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512cd.rs b/library/stdarch/crates/core_arch/src/x86/avx512cd.rs
new file mode 100644
index 000000000..ac9d3aed3
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512cd.rs
@@ -0,0 +1,1170 @@
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Broadcast the low 16-bits from input mask k to all 32-bit elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_broadcastmw_epi32&expand=553)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmw2d
+pub unsafe fn _mm512_broadcastmw_epi32(k: __mmask16) -> __m512i {
+ _mm512_set1_epi32(k as i32)
+}
+
+/// Broadcast the low 16-bits from input mask k to all 32-bit elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcastmw_epi32&expand=552)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmw2d
+pub unsafe fn _mm256_broadcastmw_epi32(k: __mmask16) -> __m256i {
+ _mm256_set1_epi32(k as i32)
+}
+
+/// Broadcast the low 16-bits from input mask k to all 32-bit elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_broadcastmw_epi32&expand=551)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmw2d
+pub unsafe fn _mm_broadcastmw_epi32(k: __mmask16) -> __m128i {
+ _mm_set1_epi32(k as i32)
+}
+
+/// Broadcast the low 8-bits from input mask k to all 64-bit elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_broadcastmb_epi64&expand=550)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmb2q
+pub unsafe fn _mm512_broadcastmb_epi64(k: __mmask8) -> __m512i {
+ _mm512_set1_epi64(k as i64)
+}
+
+/// Broadcast the low 8-bits from input mask k to all 64-bit elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcastmb_epi64&expand=549)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmb2q
+pub unsafe fn _mm256_broadcastmb_epi64(k: __mmask8) -> __m256i {
+ _mm256_set1_epi64x(k as i64)
+}
+
+/// Broadcast the low 8-bits from input mask k to all 64-bit elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_broadcastmb_epi64&expand=548)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmb2q
+pub unsafe fn _mm_broadcastmb_epi64(k: __mmask8) -> __m128i {
+ _mm_set1_epi64x(k as i64)
+}
+
+/// Test each 32-bit element of a for equality with all other elements in a closer to the least significant bit. Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_conflict_epi32&expand=1248)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vpconflictd))]
+pub unsafe fn _mm512_conflict_epi32(a: __m512i) -> __m512i {
+ transmute(vpconflictd(a.as_i32x16()))
+}
+
+/// Test each 32-bit element of a for equality with all other elements in a closer to the least significant bit using writemask k (elements are copied from src when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_conflict_epi32&expand=1249)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vpconflictd))]
+pub unsafe fn _mm512_mask_conflict_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i {
+ let conflict = _mm512_conflict_epi32(a).as_i32x16();
+ transmute(simd_select_bitmask(k, conflict, src.as_i32x16()))
+}
+
+/// Test each 32-bit element of a for equality with all other elements in a closer to the least significant bit using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_conflict_epi32&expand=1250)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vpconflictd))]
+pub unsafe fn _mm512_maskz_conflict_epi32(k: __mmask16, a: __m512i) -> __m512i {
+ let conflict = _mm512_conflict_epi32(a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, conflict, zero))
+}
+
+/// Test each 32-bit element of a for equality with all other elements in a closer to the least significant bit. Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_conflict_epi32&expand=1245)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictd))]
+pub unsafe fn _mm256_conflict_epi32(a: __m256i) -> __m256i {
+ transmute(vpconflictd256(a.as_i32x8()))
+}
+
+/// Test each 32-bit element of a for equality with all other elements in a closer to the least significant bit using writemask k (elements are copied from src when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_conflict_epi32&expand=1246)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictd))]
+pub unsafe fn _mm256_mask_conflict_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ let conflict = _mm256_conflict_epi32(a).as_i32x8();
+ transmute(simd_select_bitmask(k, conflict, src.as_i32x8()))
+}
+
+/// Test each 32-bit element of a for equality with all other elements in a closer to the least significant bit using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_conflict_epi32&expand=1247)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictd))]
+pub unsafe fn _mm256_maskz_conflict_epi32(k: __mmask8, a: __m256i) -> __m256i {
+ let conflict = _mm256_conflict_epi32(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, conflict, zero))
+}
+
+/// Test each 32-bit element of a for equality with all other elements in a closer to the least significant bit. Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_conflict_epi32&expand=1242)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictd))]
+pub unsafe fn _mm_conflict_epi32(a: __m128i) -> __m128i {
+ transmute(vpconflictd128(a.as_i32x4()))
+}
+
+/// Test each 32-bit element of a for equality with all other elements in a closer to the least significant bit using writemask k (elements are copied from src when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_conflict_epi32&expand=1243)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictd))]
+pub unsafe fn _mm_mask_conflict_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let conflict = _mm_conflict_epi32(a).as_i32x4();
+ transmute(simd_select_bitmask(k, conflict, src.as_i32x4()))
+}
+
+/// Test each 32-bit element of a for equality with all other elements in a closer to the least significant bit using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_conflict_epi32&expand=1244)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictd))]
+pub unsafe fn _mm_maskz_conflict_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ let conflict = _mm_conflict_epi32(a).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, conflict, zero))
+}
+
+/// Test each 64-bit element of a for equality with all other elements in a closer to the least significant bit. Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_conflict_epi64&expand=1257)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vpconflictq))]
+pub unsafe fn _mm512_conflict_epi64(a: __m512i) -> __m512i {
+ transmute(vpconflictq(a.as_i64x8()))
+}
+
+/// Test each 64-bit element of a for equality with all other elements in a closer to the least significant bit using writemask k (elements are copied from src when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_conflict_epi64&expand=1258)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vpconflictq))]
+pub unsafe fn _mm512_mask_conflict_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i {
+ let conflict = _mm512_conflict_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, conflict, src.as_i64x8()))
+}
+
+/// Test each 64-bit element of a for equality with all other elements in a closer to the least significant bit using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_conflict_epi64&expand=1259)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vpconflictq))]
+pub unsafe fn _mm512_maskz_conflict_epi64(k: __mmask8, a: __m512i) -> __m512i {
+ let conflict = _mm512_conflict_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, conflict, zero))
+}
+
+/// Test each 64-bit element of a for equality with all other elements in a closer to the least significant bit. Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_conflict_epi64&expand=1254)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictq))]
+pub unsafe fn _mm256_conflict_epi64(a: __m256i) -> __m256i {
+ transmute(vpconflictq256(a.as_i64x4()))
+}
+
+/// Test each 64-bit element of a for equality with all other elements in a closer to the least significant bit using writemask k (elements are copied from src when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_conflict_epi64&expand=1255)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictq))]
+pub unsafe fn _mm256_mask_conflict_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ let conflict = _mm256_conflict_epi64(a).as_i64x4();
+ transmute(simd_select_bitmask(k, conflict, src.as_i64x4()))
+}
+
+/// Test each 64-bit element of a for equality with all other elements in a closer to the least significant bit using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_conflict_epi64&expand=1256)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictq))]
+pub unsafe fn _mm256_maskz_conflict_epi64(k: __mmask8, a: __m256i) -> __m256i {
+ let conflict = _mm256_conflict_epi64(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, conflict, zero))
+}
+
+/// Test each 64-bit element of a for equality with all other elements in a closer to the least significant bit. Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_conflict_epi64&expand=1251)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictq))]
+pub unsafe fn _mm_conflict_epi64(a: __m128i) -> __m128i {
+ transmute(vpconflictq128(a.as_i64x2()))
+}
+
+/// Test each 64-bit element of a for equality with all other elements in a closer to the least significant bit using writemask k (elements are copied from src when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_conflict_epi64&expand=1252)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictq))]
+pub unsafe fn _mm_mask_conflict_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let conflict = _mm_conflict_epi64(a).as_i64x2();
+ transmute(simd_select_bitmask(k, conflict, src.as_i64x2()))
+}
+
+/// Test each 64-bit element of a for equality with all other elements in a closer to the least significant bit using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Each element's comparison forms a zero extended bit vector in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_conflict_epi64&expand=1253)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vpconflictq))]
+pub unsafe fn _mm_maskz_conflict_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let conflict = _mm_conflict_epi64(a).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, conflict, zero))
+}
+
+/// Counts the number of leading zero bits in each packed 32-bit integer in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_lzcnt_epi32&expand=3491)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vplzcntd))]
+pub unsafe fn _mm512_lzcnt_epi32(a: __m512i) -> __m512i {
+ transmute(vplzcntd(a.as_i32x16(), false))
+}
+
+/// Counts the number of leading zero bits in each packed 32-bit integer in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_lzcnt_epi32&expand=3492)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vplzcntd))]
+pub unsafe fn _mm512_mask_lzcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i {
+ let zerocount = _mm512_lzcnt_epi32(a).as_i32x16();
+ transmute(simd_select_bitmask(k, zerocount, src.as_i32x16()))
+}
+
+/// Counts the number of leading zero bits in each packed 32-bit integer in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_lzcnt_epi32&expand=3493)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vplzcntd))]
+pub unsafe fn _mm512_maskz_lzcnt_epi32(k: __mmask16, a: __m512i) -> __m512i {
+ let zerocount = _mm512_lzcnt_epi32(a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, zerocount, zero))
+}
+
+/// Counts the number of leading zero bits in each packed 32-bit integer in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_lzcnt_epi32&expand=3488)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntd))]
+pub unsafe fn _mm256_lzcnt_epi32(a: __m256i) -> __m256i {
+ transmute(vplzcntd256(a.as_i32x8(), false))
+}
+
+/// Counts the number of leading zero bits in each packed 32-bit integer in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_lzcnt_epi32&expand=3489)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntd))]
+pub unsafe fn _mm256_mask_lzcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ let zerocount = _mm256_lzcnt_epi32(a).as_i32x8();
+ transmute(simd_select_bitmask(k, zerocount, src.as_i32x8()))
+}
+
+/// Counts the number of leading zero bits in each packed 32-bit integer in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_lzcnt_epi32&expand=3490)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntd))]
+pub unsafe fn _mm256_maskz_lzcnt_epi32(k: __mmask8, a: __m256i) -> __m256i {
+ let zerocount = _mm256_lzcnt_epi32(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, zerocount, zero))
+}
+
+/// Counts the number of leading zero bits in each packed 32-bit integer in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_lzcnt_epi32&expand=3485)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntd))]
+pub unsafe fn _mm_lzcnt_epi32(a: __m128i) -> __m128i {
+ transmute(vplzcntd128(a.as_i32x4(), false))
+}
+
+/// Counts the number of leading zero bits in each packed 32-bit integer in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_lzcnt_epi32&expand=3486)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntd))]
+pub unsafe fn _mm_mask_lzcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let zerocount = _mm_lzcnt_epi32(a).as_i32x4();
+ transmute(simd_select_bitmask(k, zerocount, src.as_i32x4()))
+}
+
+/// Counts the number of leading zero bits in each packed 32-bit integer in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_lzcnt_epi32&expand=3487)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntd))]
+pub unsafe fn _mm_maskz_lzcnt_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ let zerocount = _mm_lzcnt_epi32(a).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, zerocount, zero))
+}
+
+/// Counts the number of leading zero bits in each packed 64-bit integer in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_lzcnt_epi64&expand=3500)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vplzcntq))]
+pub unsafe fn _mm512_lzcnt_epi64(a: __m512i) -> __m512i {
+ transmute(vplzcntq(a.as_i64x8(), false))
+}
+
+/// Counts the number of leading zero bits in each packed 64-bit integer in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_lzcnt_epi64&expand=3501)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vplzcntq))]
+pub unsafe fn _mm512_mask_lzcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i {
+ let zerocount = _mm512_lzcnt_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, zerocount, src.as_i64x8()))
+}
+
+/// Counts the number of leading zero bits in each packed 64-bit integer in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_lzcnt_epi64&expand=3502)
+#[inline]
+#[target_feature(enable = "avx512cd")]
+#[cfg_attr(test, assert_instr(vplzcntq))]
+pub unsafe fn _mm512_maskz_lzcnt_epi64(k: __mmask8, a: __m512i) -> __m512i {
+ let zerocount = _mm512_lzcnt_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, zerocount, zero))
+}
+
+/// Counts the number of leading zero bits in each packed 64-bit integer in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_lzcnt_epi64&expand=3497)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntq))]
+pub unsafe fn _mm256_lzcnt_epi64(a: __m256i) -> __m256i {
+ transmute(vplzcntq256(a.as_i64x4(), false))
+}
+
+/// Counts the number of leading zero bits in each packed 64-bit integer in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_lzcnt_epi64&expand=3498)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntq))]
+pub unsafe fn _mm256_mask_lzcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ let zerocount = _mm256_lzcnt_epi64(a).as_i64x4();
+ transmute(simd_select_bitmask(k, zerocount, src.as_i64x4()))
+}
+
+/// Counts the number of leading zero bits in each packed 64-bit integer in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_lzcnt_epi64&expand=3499)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntq))]
+pub unsafe fn _mm256_maskz_lzcnt_epi64(k: __mmask8, a: __m256i) -> __m256i {
+ let zerocount = _mm256_lzcnt_epi64(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, zerocount, zero))
+}
+
+/// Counts the number of leading zero bits in each packed 64-bit integer in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_lzcnt_epi64&expand=3494)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntq))]
+pub unsafe fn _mm_lzcnt_epi64(a: __m128i) -> __m128i {
+ transmute(vplzcntq128(a.as_i64x2(), false))
+}
+
+/// Counts the number of leading zero bits in each packed 64-bit integer in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_lzcnt_epi64&expand=3495)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntq))]
+pub unsafe fn _mm_mask_lzcnt_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let zerocount = _mm_lzcnt_epi64(a).as_i64x2();
+ transmute(simd_select_bitmask(k, zerocount, src.as_i64x2()))
+}
+
+/// Counts the number of leading zero bits in each packed 64-bit integer in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_lzcnt_epi64&expand=3496)
+#[inline]
+#[target_feature(enable = "avx512cd,avx512vl")]
+#[cfg_attr(test, assert_instr(vplzcntq))]
+pub unsafe fn _mm_maskz_lzcnt_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let zerocount = _mm_lzcnt_epi64(a).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, zerocount, zero))
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.avx512.conflict.d.512"]
+ fn vpconflictd(a: i32x16) -> i32x16;
+ #[link_name = "llvm.x86.avx512.conflict.d.256"]
+ fn vpconflictd256(a: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx512.conflict.d.128"]
+ fn vpconflictd128(a: i32x4) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.conflict.q.512"]
+ fn vpconflictq(a: i64x8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.conflict.q.256"]
+ fn vpconflictq256(a: i64x4) -> i64x4;
+ #[link_name = "llvm.x86.avx512.conflict.q.128"]
+ fn vpconflictq128(a: i64x2) -> i64x2;
+
+ #[link_name = "llvm.ctlz.v16i32"]
+ fn vplzcntd(a: i32x16, nonzero: bool) -> i32x16;
+ #[link_name = "llvm.ctlz.v8i32"]
+ fn vplzcntd256(a: i32x8, nonzero: bool) -> i32x8;
+ #[link_name = "llvm.ctlz.v4i32"]
+ fn vplzcntd128(a: i32x4, nonzero: bool) -> i32x4;
+
+ #[link_name = "llvm.ctlz.v8i64"]
+ fn vplzcntq(a: i64x8, nonzero: bool) -> i64x8;
+ #[link_name = "llvm.ctlz.v4i64"]
+ fn vplzcntq256(a: i64x4, nonzero: bool) -> i64x4;
+ #[link_name = "llvm.ctlz.v2i64"]
+ fn vplzcntq128(a: i64x2, nonzero: bool) -> i64x2;
+}
+
+#[cfg(test)]
+mod tests {
+
+ use crate::core_arch::x86::*;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_broadcastmw_epi32() {
+ let a: __mmask16 = 2;
+ let r = _mm512_broadcastmw_epi32(a);
+ let e = _mm512_set1_epi32(2);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_broadcastmw_epi32() {
+ let a: __mmask16 = 2;
+ let r = _mm256_broadcastmw_epi32(a);
+ let e = _mm256_set1_epi32(2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_broadcastmw_epi32() {
+ let a: __mmask16 = 2;
+ let r = _mm_broadcastmw_epi32(a);
+ let e = _mm_set1_epi32(2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_broadcastmb_epi64() {
+ let a: __mmask8 = 2;
+ let r = _mm512_broadcastmb_epi64(a);
+ let e = _mm512_set1_epi64(2);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_broadcastmb_epi64() {
+ let a: __mmask8 = 2;
+ let r = _mm256_broadcastmb_epi64(a);
+ let e = _mm256_set1_epi64x(2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_broadcastmb_epi64() {
+ let a: __mmask8 = 2;
+ let r = _mm_broadcastmb_epi64(a);
+ let e = _mm_set1_epi64x(2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_conflict_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let r = _mm512_conflict_epi32(a);
+ let e = _mm512_set_epi32(
+ 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,
+ 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,
+ 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,
+ 1 << 11
+ | 1 << 10
+ | 1 << 9
+ | 1 << 8
+ | 1 << 7
+ | 1 << 6
+ | 1 << 5
+ | 1 << 4
+ | 1 << 3
+ | 1 << 2
+ | 1 << 1
+ | 1 << 0,
+ 1 << 10
+ | 1 << 9
+ | 1 << 8
+ | 1 << 7
+ | 1 << 6
+ | 1 << 5
+ | 1 << 4
+ | 1 << 3
+ | 1 << 2
+ | 1 << 1
+ | 1 << 0,
+ 1 << 9 | 1 << 8 | 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 8 | 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 1 | 1 << 0,
+ 1 << 0,
+ 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_mask_conflict_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let r = _mm512_mask_conflict_epi32(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_conflict_epi32(a, 0b11111111_11111111, a);
+ let e = _mm512_set_epi32(
+ 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,
+ 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,
+ 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,
+ 1 << 11
+ | 1 << 10
+ | 1 << 9
+ | 1 << 8
+ | 1 << 7
+ | 1 << 6
+ | 1 << 5
+ | 1 << 4
+ | 1 << 3
+ | 1 << 2
+ | 1 << 1
+ | 1 << 0,
+ 1 << 10
+ | 1 << 9
+ | 1 << 8
+ | 1 << 7
+ | 1 << 6
+ | 1 << 5
+ | 1 << 4
+ | 1 << 3
+ | 1 << 2
+ | 1 << 1
+ | 1 << 0,
+ 1 << 9 | 1 << 8 | 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 8 | 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 1 | 1 << 0,
+ 1 << 0,
+ 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_maskz_conflict_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let r = _mm512_maskz_conflict_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_conflict_epi32(0b11111111_11111111, a);
+ let e = _mm512_set_epi32(
+ 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,
+ 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,
+ 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,
+ 1 << 11
+ | 1 << 10
+ | 1 << 9
+ | 1 << 8
+ | 1 << 7
+ | 1 << 6
+ | 1 << 5
+ | 1 << 4
+ | 1 << 3
+ | 1 << 2
+ | 1 << 1
+ | 1 << 0,
+ 1 << 10
+ | 1 << 9
+ | 1 << 8
+ | 1 << 7
+ | 1 << 6
+ | 1 << 5
+ | 1 << 4
+ | 1 << 3
+ | 1 << 2
+ | 1 << 1
+ | 1 << 0,
+ 1 << 9 | 1 << 8 | 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 8 | 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 1 | 1 << 0,
+ 1 << 0,
+ 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_conflict_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let r = _mm256_conflict_epi32(a);
+ let e = _mm256_set_epi32(
+ 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 1 | 1 << 0,
+ 1 << 0,
+ 0,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_mask_conflict_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let r = _mm256_mask_conflict_epi32(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_conflict_epi32(a, 0b11111111, a);
+ let e = _mm256_set_epi32(
+ 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 1 | 1 << 0,
+ 1 << 0,
+ 0,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_maskz_conflict_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let r = _mm256_maskz_conflict_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_conflict_epi32(0b11111111, a);
+ let e = _mm256_set_epi32(
+ 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 1 | 1 << 0,
+ 1 << 0,
+ 0,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_conflict_epi32() {
+ let a = _mm_set1_epi32(1);
+ let r = _mm_conflict_epi32(a);
+ let e = _mm_set_epi32(1 << 2 | 1 << 1 | 1 << 0, 1 << 1 | 1 << 0, 1 << 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_mask_conflict_epi32() {
+ let a = _mm_set1_epi32(1);
+ let r = _mm_mask_conflict_epi32(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_conflict_epi32(a, 0b00001111, a);
+ let e = _mm_set_epi32(1 << 2 | 1 << 1 | 1 << 0, 1 << 1 | 1 << 0, 1 << 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_maskz_conflict_epi32() {
+ let a = _mm_set1_epi32(1);
+ let r = _mm_maskz_conflict_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_conflict_epi32(0b00001111, a);
+ let e = _mm_set_epi32(1 << 2 | 1 << 1 | 1 << 0, 1 << 1 | 1 << 0, 1 << 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_conflict_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let r = _mm512_conflict_epi64(a);
+ let e = _mm512_set_epi64(
+ 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 1 | 1 << 0,
+ 1 << 0,
+ 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_mask_conflict_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let r = _mm512_mask_conflict_epi64(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_conflict_epi64(a, 0b11111111, a);
+ let e = _mm512_set_epi64(
+ 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 1 | 1 << 0,
+ 1 << 0,
+ 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_maskz_conflict_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let r = _mm512_maskz_conflict_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_conflict_epi64(0b11111111, a);
+ let e = _mm512_set_epi64(
+ 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 2 | 1 << 1 | 1 << 0,
+ 1 << 1 | 1 << 0,
+ 1 << 0,
+ 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_conflict_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let r = _mm256_conflict_epi64(a);
+ let e = _mm256_set_epi64x(1 << 2 | 1 << 1 | 1 << 0, 1 << 1 | 1 << 0, 1 << 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_mask_conflict_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let r = _mm256_mask_conflict_epi64(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_conflict_epi64(a, 0b00001111, a);
+ let e = _mm256_set_epi64x(1 << 2 | 1 << 1 | 1 << 0, 1 << 1 | 1 << 0, 1 << 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_maskz_conflict_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let r = _mm256_maskz_conflict_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_conflict_epi64(0b00001111, a);
+ let e = _mm256_set_epi64x(1 << 2 | 1 << 1 | 1 << 0, 1 << 1 | 1 << 0, 1 << 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_conflict_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let r = _mm_conflict_epi64(a);
+ let e = _mm_set_epi64x(1 << 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_mask_conflict_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let r = _mm_mask_conflict_epi64(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_conflict_epi64(a, 0b00000011, a);
+ let e = _mm_set_epi64x(1 << 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_maskz_conflict_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let r = _mm_maskz_conflict_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_conflict_epi64(0b00000011, a);
+ let e = _mm_set_epi64x(1 << 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_lzcnt_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let r = _mm512_lzcnt_epi32(a);
+ let e = _mm512_set1_epi32(31);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_mask_lzcnt_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let r = _mm512_mask_lzcnt_epi32(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_lzcnt_epi32(a, 0b11111111_11111111, a);
+ let e = _mm512_set1_epi32(31);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_maskz_lzcnt_epi32() {
+ let a = _mm512_set1_epi32(2);
+ let r = _mm512_maskz_lzcnt_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_lzcnt_epi32(0b11111111_11111111, a);
+ let e = _mm512_set1_epi32(30);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_lzcnt_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let r = _mm256_lzcnt_epi32(a);
+ let e = _mm256_set1_epi32(31);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_mask_lzcnt_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let r = _mm256_mask_lzcnt_epi32(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_lzcnt_epi32(a, 0b11111111, a);
+ let e = _mm256_set1_epi32(31);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_maskz_lzcnt_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let r = _mm256_maskz_lzcnt_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_lzcnt_epi32(0b11111111, a);
+ let e = _mm256_set1_epi32(31);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_lzcnt_epi32() {
+ let a = _mm_set1_epi32(1);
+ let r = _mm_lzcnt_epi32(a);
+ let e = _mm_set1_epi32(31);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_mask_lzcnt_epi32() {
+ let a = _mm_set1_epi32(1);
+ let r = _mm_mask_lzcnt_epi32(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_lzcnt_epi32(a, 0b00001111, a);
+ let e = _mm_set1_epi32(31);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_maskz_lzcnt_epi32() {
+ let a = _mm_set1_epi32(1);
+ let r = _mm_maskz_lzcnt_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_lzcnt_epi32(0b00001111, a);
+ let e = _mm_set1_epi32(31);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_lzcnt_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let r = _mm512_lzcnt_epi64(a);
+ let e = _mm512_set1_epi64(63);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_mask_lzcnt_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let r = _mm512_mask_lzcnt_epi64(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_lzcnt_epi64(a, 0b11111111, a);
+ let e = _mm512_set1_epi64(63);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd")]
+ unsafe fn test_mm512_maskz_lzcnt_epi64() {
+ let a = _mm512_set1_epi64(2);
+ let r = _mm512_maskz_lzcnt_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_lzcnt_epi64(0b11111111, a);
+ let e = _mm512_set1_epi64(62);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_lzcnt_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let r = _mm256_lzcnt_epi64(a);
+ let e = _mm256_set1_epi64x(63);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_mask_lzcnt_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let r = _mm256_mask_lzcnt_epi64(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_lzcnt_epi64(a, 0b00001111, a);
+ let e = _mm256_set1_epi64x(63);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm256_maskz_lzcnt_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let r = _mm256_maskz_lzcnt_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_lzcnt_epi64(0b00001111, a);
+ let e = _mm256_set1_epi64x(63);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_lzcnt_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let r = _mm_lzcnt_epi64(a);
+ let e = _mm_set1_epi64x(63);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_mask_lzcnt_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let r = _mm_mask_lzcnt_epi64(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_lzcnt_epi64(a, 0b00001111, a);
+ let e = _mm_set1_epi64x(63);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512cd,avx512vl")]
+ unsafe fn test_mm_maskz_lzcnt_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let r = _mm_maskz_lzcnt_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_lzcnt_epi64(0b00001111, a);
+ let e = _mm_set1_epi64x(63);
+ assert_eq_m128i(r, e);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512f.rs b/library/stdarch/crates/core_arch/src/x86/avx512f.rs
new file mode 100644
index 000000000..f70a28466
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512f.rs
@@ -0,0 +1,55830 @@
+use crate::{
+ arch::asm,
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ mem::{self, transmute},
+ ptr,
+};
+
+// x86-32 wants to use a 32-bit address size, but asm! defaults to using the full
+// register name (e.g. rax). We have to explicitly override the placeholder to
+// use the 32-bit register name in that case.
+
+#[cfg(target_pointer_width = "32")]
+macro_rules! vpl {
+ ($inst:expr) => {
+ concat!($inst, ", [{p:e}]")
+ };
+}
+#[cfg(target_pointer_width = "64")]
+macro_rules! vpl {
+ ($inst:expr) => {
+ concat!($inst, ", [{p}]")
+ };
+}
+#[cfg(target_pointer_width = "32")]
+macro_rules! vps {
+ ($inst1:expr, $inst2:expr) => {
+ concat!($inst1, " [{p:e}]", $inst2)
+ };
+}
+#[cfg(target_pointer_width = "64")]
+macro_rules! vps {
+ ($inst1:expr, $inst2:expr) => {
+ concat!($inst1, " [{p}]", $inst2)
+ };
+}
+
+pub(crate) use {vpl, vps};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Computes the absolute values of packed 32-bit integers in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_abs_epi32&expand=39)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpabsd))]
+pub unsafe fn _mm512_abs_epi32(a: __m512i) -> __m512i {
+ let a = a.as_i32x16();
+ // all-0 is a properly initialized i32x16
+ let zero: i32x16 = mem::zeroed();
+ let sub = simd_sub(zero, a);
+ let cmp: i32x16 = simd_gt(a, zero);
+ transmute(simd_select(cmp, a, sub))
+}
+
+/// Computes the absolute value of packed 32-bit integers in `a`, and store the
+/// unsigned results in `dst` using writemask `k` (elements are copied from
+/// `src` when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_abs_epi32&expand=40)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpabsd))]
+pub unsafe fn _mm512_mask_abs_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i {
+ let abs = _mm512_abs_epi32(a).as_i32x16();
+ transmute(simd_select_bitmask(k, abs, src.as_i32x16()))
+}
+
+/// Computes the absolute value of packed 32-bit integers in `a`, and store the
+/// unsigned results in `dst` using zeromask `k` (elements are zeroed out when
+/// the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_abs_epi32&expand=41)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpabsd))]
+pub unsafe fn _mm512_maskz_abs_epi32(k: __mmask16, a: __m512i) -> __m512i {
+ let abs = _mm512_abs_epi32(a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, abs, zero))
+}
+
+/// Compute the absolute value of packed signed 32-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_abs_epi32&expand=37)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpabsd))]
+pub unsafe fn _mm256_mask_abs_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ let abs = _mm256_abs_epi32(a).as_i32x8();
+ transmute(simd_select_bitmask(k, abs, src.as_i32x8()))
+}
+
+/// Compute the absolute value of packed signed 32-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_abs_epi32&expand=38)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpabsd))]
+pub unsafe fn _mm256_maskz_abs_epi32(k: __mmask8, a: __m256i) -> __m256i {
+ let abs = _mm256_abs_epi32(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, abs, zero))
+}
+
+/// Compute the absolute value of packed signed 32-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_abs_epi32&expand=34)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpabsd))]
+pub unsafe fn _mm_mask_abs_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let abs = _mm_abs_epi32(a).as_i32x4();
+ transmute(simd_select_bitmask(k, abs, src.as_i32x4()))
+}
+
+/// Compute the absolute value of packed signed 32-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_abs_epi32&expand=35)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpabsd))]
+pub unsafe fn _mm_maskz_abs_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ let abs = _mm_abs_epi32(a).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, abs, zero))
+}
+
+/// Compute the absolute value of packed signed 64-bit integers in a, and store the unsigned results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_abs_epi64&expand=48)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpabsq))]
+pub unsafe fn _mm512_abs_epi64(a: __m512i) -> __m512i {
+ let a = a.as_i64x8();
+ // all-0 is a properly initialized i64x8
+ let zero: i64x8 = mem::zeroed();
+ let sub = simd_sub(zero, a);
+ let cmp: i64x8 = simd_gt(a, zero);
+ transmute(simd_select(cmp, a, sub))
+}
+
+/// Compute the absolute value of packed signed 64-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_abs_epi64&expand=49)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpabsq))]
+pub unsafe fn _mm512_mask_abs_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i {
+ let abs = _mm512_abs_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, abs, src.as_i64x8()))
+}
+
+/// Compute the absolute value of packed signed 64-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_abs_epi64&expand=50)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpabsq))]
+pub unsafe fn _mm512_maskz_abs_epi64(k: __mmask8, a: __m512i) -> __m512i {
+ let abs = _mm512_abs_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, abs, zero))
+}
+
+/// Compute the absolute value of packed signed 64-bit integers in a, and store the unsigned results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_abs_epi64&expand=45)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpabsq))]
+pub unsafe fn _mm256_abs_epi64(a: __m256i) -> __m256i {
+ let a = a.as_i64x4();
+ // all-0 is a properly initialized i64x4
+ let zero: i64x4 = mem::zeroed();
+ let sub = simd_sub(zero, a);
+ let cmp: i64x4 = simd_gt(a, zero);
+ transmute(simd_select(cmp, a, sub))
+}
+
+/// Compute the absolute value of packed signed 64-bit integers in a, and store the unsigned results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_abs_epi64&expand=46)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpabsq))]
+pub unsafe fn _mm256_mask_abs_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ let abs = _mm256_abs_epi64(a).as_i64x4();
+ transmute(simd_select_bitmask(k, abs, src.as_i64x4()))
+}
+
+/// Compute the absolute value of packed signed 64-bit integers in a, and store the unsigned results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_abs_epi64&expand=45)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpabsq))]
+pub unsafe fn _mm256_maskz_abs_epi64(k: __mmask8, a: __m256i) -> __m256i {
+ let abs = _mm256_abs_epi64(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, abs, zero))
+}
+
+/// Finds the absolute value of each packed single-precision (32-bit) floating-point element in v2, storing the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_abs_ps&expand=65)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm512_abs_ps(v2: __m512) -> __m512 {
+ let a = _mm512_set1_epi32(0x7FFFFFFF); // from LLVM code
+ let b = transmute::<f32x16, __m512i>(v2.as_f32x16());
+ let abs = _mm512_and_epi32(a, b);
+ transmute(abs)
+}
+
+/// Finds the absolute value of each packed single-precision (32-bit) floating-point element in v2, storing the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_abs_ps&expand=66)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandd))]
+pub unsafe fn _mm512_mask_abs_ps(src: __m512, k: __mmask16, v2: __m512) -> __m512 {
+ let abs = _mm512_abs_ps(v2).as_f32x16();
+ transmute(simd_select_bitmask(k, abs, src.as_f32x16()))
+}
+
+/// Finds the absolute value of each packed double-precision (64-bit) floating-point element in v2, storing the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_abs_pd&expand=60)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm512_abs_pd(v2: __m512d) -> __m512d {
+ let a = _mm512_set1_epi64(0x7FFFFFFFFFFFFFFF); // from LLVM code
+ let b = transmute::<f64x8, __m512i>(v2.as_f64x8());
+ let abs = _mm512_and_epi64(a, b);
+ transmute(abs)
+}
+
+/// Finds the absolute value of each packed double-precision (64-bit) floating-point element in v2, storing the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_abs_pd&expand=61)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm512_mask_abs_pd(src: __m512d, k: __mmask8, v2: __m512d) -> __m512d {
+ let abs = _mm512_abs_pd(v2).as_f64x8();
+ transmute(simd_select_bitmask(k, abs, src.as_f64x8()))
+}
+
+/// Move packed 32-bit integers from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mov_epi32&expand=3801)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovdqa32))]
+pub unsafe fn _mm512_mask_mov_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i {
+ let mov = a.as_i32x16();
+ transmute(simd_select_bitmask(k, mov, src.as_i32x16()))
+}
+
+/// Move packed 32-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mov_epi32&expand=3802)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovdqa32))]
+pub unsafe fn _mm512_maskz_mov_epi32(k: __mmask16, a: __m512i) -> __m512i {
+ let mov = a.as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed 32-bit integers from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mov_epi32&expand=3799)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa32))]
+pub unsafe fn _mm256_mask_mov_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ let mov = a.as_i32x8();
+ transmute(simd_select_bitmask(k, mov, src.as_i32x8()))
+}
+
+/// Move packed 32-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mov_epi32&expand=3800)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa32))]
+pub unsafe fn _mm256_maskz_mov_epi32(k: __mmask8, a: __m256i) -> __m256i {
+ let mov = a.as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed 32-bit integers from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mov_epi32&expand=3797)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa32))]
+pub unsafe fn _mm_mask_mov_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let mov = a.as_i32x4();
+ transmute(simd_select_bitmask(k, mov, src.as_i32x4()))
+}
+
+/// Move packed 32-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mov_epi32&expand=3798)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa32))]
+pub unsafe fn _mm_maskz_mov_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ let mov = a.as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed 64-bit integers from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mov_epi64&expand=3807)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovdqa64))]
+pub unsafe fn _mm512_mask_mov_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i {
+ let mov = a.as_i64x8();
+ transmute(simd_select_bitmask(k, mov, src.as_i64x8()))
+}
+
+/// Move packed 64-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mov_epi64&expand=3808)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovdqa64))]
+pub unsafe fn _mm512_maskz_mov_epi64(k: __mmask8, a: __m512i) -> __m512i {
+ let mov = a.as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed 64-bit integers from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mov_epi64&expand=3805)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa64))]
+pub unsafe fn _mm256_mask_mov_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ let mov = a.as_i64x4();
+ transmute(simd_select_bitmask(k, mov, src.as_i64x4()))
+}
+
+/// Move packed 64-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mov_epi64&expand=3806)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa64))]
+pub unsafe fn _mm256_maskz_mov_epi64(k: __mmask8, a: __m256i) -> __m256i {
+ let mov = a.as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed 64-bit integers from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mov_epi64&expand=3803)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa64))]
+pub unsafe fn _mm_mask_mov_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let mov = a.as_i64x2();
+ transmute(simd_select_bitmask(k, mov, src.as_i64x2()))
+}
+
+/// Move packed 64-bit integers from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mov_epi64&expand=3804)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa64))]
+pub unsafe fn _mm_maskz_mov_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let mov = a.as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed single-precision (32-bit) floating-point elements from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mov_ps&expand=3825)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))]
+pub unsafe fn _mm512_mask_mov_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 {
+ let mov = a.as_f32x16();
+ transmute(simd_select_bitmask(k, mov, src.as_f32x16()))
+}
+
+/// Move packed single-precision (32-bit) floating-point elements from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mov_ps&expand=3826)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))]
+pub unsafe fn _mm512_maskz_mov_ps(k: __mmask16, a: __m512) -> __m512 {
+ let mov = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed single-precision (32-bit) floating-point elements from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mov_ps&expand=3823)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))]
+pub unsafe fn _mm256_mask_mov_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 {
+ let mov = a.as_f32x8();
+ transmute(simd_select_bitmask(k, mov, src.as_f32x8()))
+}
+
+/// Move packed single-precision (32-bit) floating-point elements from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mov_ps&expand=3824)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))]
+pub unsafe fn _mm256_maskz_mov_ps(k: __mmask8, a: __m256) -> __m256 {
+ let mov = a.as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed single-precision (32-bit) floating-point elements from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mov_ps&expand=3821)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))]
+pub unsafe fn _mm_mask_mov_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ let mov = a.as_f32x4();
+ transmute(simd_select_bitmask(k, mov, src.as_f32x4()))
+}
+
+/// Move packed single-precision (32-bit) floating-point elements from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mov_ps&expand=3822)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))]
+pub unsafe fn _mm_maskz_mov_ps(k: __mmask8, a: __m128) -> __m128 {
+ let mov = a.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed double-precision (64-bit) floating-point elements from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mov_pd&expand=3819)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovapd))]
+pub unsafe fn _mm512_mask_mov_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d {
+ let mov = a.as_f64x8();
+ transmute(simd_select_bitmask(k, mov, src.as_f64x8()))
+}
+
+/// Move packed double-precision (64-bit) floating-point elements from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mov_pd&expand=3820)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovapd))]
+pub unsafe fn _mm512_maskz_mov_pd(k: __mmask8, a: __m512d) -> __m512d {
+ let mov = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed double-precision (64-bit) floating-point elements from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mov_pd&expand=3817)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovapd))]
+pub unsafe fn _mm256_mask_mov_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d {
+ let mov = a.as_f64x4();
+ transmute(simd_select_bitmask(k, mov, src.as_f64x4()))
+}
+
+/// Move packed double-precision (64-bit) floating-point elements from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mov_pd&expand=3818)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovapd))]
+pub unsafe fn _mm256_maskz_mov_pd(k: __mmask8, a: __m256d) -> __m256d {
+ let mov = a.as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Move packed double-precision (64-bit) floating-point elements from a to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mov_pd&expand=3815)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovapd))]
+pub unsafe fn _mm_mask_mov_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d {
+ let mov = a.as_f64x2();
+ transmute(simd_select_bitmask(k, mov, src.as_f64x2()))
+}
+
+/// Move packed double-precision (64-bit) floating-point elements from a into dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mov_pd&expand=3816)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovapd))]
+pub unsafe fn _mm_maskz_mov_pd(k: __mmask8, a: __m128d) -> __m128d {
+ let mov = a.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Add packed 32-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_add_epi32&expand=100)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpaddd))]
+pub unsafe fn _mm512_add_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_add(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Add packed 32-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_add_epi32&expand=101)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpaddd))]
+pub unsafe fn _mm512_mask_add_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let add = _mm512_add_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, add, src.as_i32x16()))
+}
+
+/// Add packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_add_epi32&expand=102)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpaddd))]
+pub unsafe fn _mm512_maskz_add_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let add = _mm512_add_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed 32-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_add_epi32&expand=98)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddd))]
+pub unsafe fn _mm256_mask_add_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let add = _mm256_add_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, add, src.as_i32x8()))
+}
+
+/// Add packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_add_epi32&expand=99)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddd))]
+pub unsafe fn _mm256_maskz_add_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let add = _mm256_add_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed 32-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_add_epi32&expand=95)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddd))]
+pub unsafe fn _mm_mask_add_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let add = _mm_add_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, add, src.as_i32x4()))
+}
+
+/// Add packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_add_epi32&expand=96)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddd))]
+pub unsafe fn _mm_maskz_add_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let add = _mm_add_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed 64-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_add_epi64&expand=109)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpaddq))]
+pub unsafe fn _mm512_add_epi64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_add(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Add packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_add_epi64&expand=110)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpaddq))]
+pub unsafe fn _mm512_mask_add_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let add = _mm512_add_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, add, src.as_i64x8()))
+}
+
+/// Add packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_add_epi64&expand=111)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpaddq))]
+pub unsafe fn _mm512_maskz_add_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let add = _mm512_add_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_add_epi64&expand=107)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddq))]
+pub unsafe fn _mm256_mask_add_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let add = _mm256_add_epi64(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, add, src.as_i64x4()))
+}
+
+/// Add packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_add_epi64&expand=108)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddq))]
+pub unsafe fn _mm256_maskz_add_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let add = _mm256_add_epi64(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_add_epi64&expand=104)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddq))]
+pub unsafe fn _mm_mask_add_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let add = _mm_add_epi64(a, b).as_i64x2();
+ transmute(simd_select_bitmask(k, add, src.as_i64x2()))
+}
+
+/// Add packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_add_epi64&expand=105)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpaddq))]
+pub unsafe fn _mm_maskz_add_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let add = _mm_add_epi64(a, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_add_ps&expand=139)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddps))]
+pub unsafe fn _mm512_add_ps(a: __m512, b: __m512) -> __m512 {
+ transmute(simd_add(a.as_f32x16(), b.as_f32x16()))
+}
+
+/// Add packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_add_ps&expand=140)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddps))]
+pub unsafe fn _mm512_mask_add_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let add = _mm512_add_ps(a, b).as_f32x16();
+ transmute(simd_select_bitmask(k, add, src.as_f32x16()))
+}
+
+/// Add packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_add_ps&expand=141)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddps))]
+pub unsafe fn _mm512_maskz_add_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let add = _mm512_add_ps(a, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_add_ps&expand=137)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vaddps))]
+pub unsafe fn _mm256_mask_add_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let add = _mm256_add_ps(a, b).as_f32x8();
+ transmute(simd_select_bitmask(k, add, src.as_f32x8()))
+}
+
+/// Add packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_add_ps&expand=138)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vaddps))]
+pub unsafe fn _mm256_maskz_add_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let add = _mm256_add_ps(a, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_add_ps&expand=134)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vaddps))]
+pub unsafe fn _mm_mask_add_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let add = _mm_add_ps(a, b).as_f32x4();
+ transmute(simd_select_bitmask(k, add, src.as_f32x4()))
+}
+
+/// Add packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_add_ps&expand=135)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vaddps))]
+pub unsafe fn _mm_maskz_add_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let add = _mm_add_ps(a, b).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_add_pd&expand=127)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddpd))]
+pub unsafe fn _mm512_add_pd(a: __m512d, b: __m512d) -> __m512d {
+ transmute(simd_add(a.as_f64x8(), b.as_f64x8()))
+}
+
+/// Add packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_add_pd&expand=128)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddpd))]
+pub unsafe fn _mm512_mask_add_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let add = _mm512_add_pd(a, b).as_f64x8();
+ transmute(simd_select_bitmask(k, add, src.as_f64x8()))
+}
+
+/// Add packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_add_pd&expand=129)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddpd))]
+pub unsafe fn _mm512_maskz_add_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let add = _mm512_add_pd(a, b).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_add_pd&expand=125)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vaddpd))]
+pub unsafe fn _mm256_mask_add_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let add = _mm256_add_pd(a, b).as_f64x4();
+ transmute(simd_select_bitmask(k, add, src.as_f64x4()))
+}
+
+/// Add packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_add_pd&expand=126)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vaddpd))]
+pub unsafe fn _mm256_maskz_add_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let add = _mm256_add_pd(a, b).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Add packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_add_pd&expand=122)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vaddpd))]
+pub unsafe fn _mm_mask_add_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let add = _mm_add_pd(a, b).as_f64x2();
+ transmute(simd_select_bitmask(k, add, src.as_f64x2()))
+}
+
+/// Add packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_add_pd&expand=123)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vaddpd))]
+pub unsafe fn _mm_maskz_add_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let add = _mm_add_pd(a, b).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, add, zero))
+}
+
+/// Subtract packed 32-bit integers in b from packed 32-bit integers in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sub_epi32&expand=5694)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsubd))]
+pub unsafe fn _mm512_sub_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_sub(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Subtract packed 32-bit integers in b from packed 32-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sub_epi32&expand=5692)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsubd))]
+pub unsafe fn _mm512_mask_sub_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let sub = _mm512_sub_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, sub, src.as_i32x16()))
+}
+
+/// Subtract packed 32-bit integers in b from packed 32-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sub_epi32&expand=5693)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsubd))]
+pub unsafe fn _mm512_maskz_sub_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let sub = _mm512_sub_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed 32-bit integers in b from packed 32-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sub_epi32&expand=5689)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubd))]
+pub unsafe fn _mm256_mask_sub_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let sub = _mm256_sub_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, sub, src.as_i32x8()))
+}
+
+/// Subtract packed 32-bit integers in b from packed 32-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sub_epi32&expand=5690)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubd))]
+pub unsafe fn _mm256_maskz_sub_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let sub = _mm256_sub_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed 32-bit integers in b from packed 32-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sub_epi32&expand=5686)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubd))]
+pub unsafe fn _mm_mask_sub_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let sub = _mm_sub_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, sub, src.as_i32x4()))
+}
+
+/// Subtract packed 32-bit integers in b from packed 32-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sub_epi32&expand=5687)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubd))]
+pub unsafe fn _mm_maskz_sub_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let sub = _mm_sub_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed 64-bit integers in b from packed 64-bit integers in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sub_epi64&expand=5703)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsubq))]
+pub unsafe fn _mm512_sub_epi64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_sub(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Subtract packed 64-bit integers in b from packed 64-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sub_epi64&expand=5701)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsubq))]
+pub unsafe fn _mm512_mask_sub_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let sub = _mm512_sub_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, sub, src.as_i64x8()))
+}
+
+/// Subtract packed 64-bit integers in b from packed 64-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sub_epi64&expand=5702)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsubq))]
+pub unsafe fn _mm512_maskz_sub_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let sub = _mm512_sub_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed 64-bit integers in b from packed 64-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sub_epi64&expand=5698)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubq))]
+pub unsafe fn _mm256_mask_sub_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let sub = _mm256_sub_epi64(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, sub, src.as_i64x4()))
+}
+
+/// Subtract packed 64-bit integers in b from packed 64-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sub_epi64&expand=5699)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubq))]
+pub unsafe fn _mm256_maskz_sub_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let sub = _mm256_sub_epi64(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed 64-bit integers in b from packed 64-bit integers in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sub_epi64&expand=5695)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubq))]
+pub unsafe fn _mm_mask_sub_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let sub = _mm_sub_epi64(a, b).as_i64x2();
+ transmute(simd_select_bitmask(k, sub, src.as_i64x2()))
+}
+
+/// Subtract packed 64-bit integers in b from packed 64-bit integers in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sub_epi64&expand=5696)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsubq))]
+pub unsafe fn _mm_maskz_sub_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let sub = _mm_sub_epi64(a, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed single-precision (32-bit) floating-point elements in b from packed single-precision (32-bit) floating-point elements in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sub_ps&expand=5733)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubps))]
+pub unsafe fn _mm512_sub_ps(a: __m512, b: __m512) -> __m512 {
+ transmute(simd_sub(a.as_f32x16(), b.as_f32x16()))
+}
+
+/// Subtract packed single-precision (32-bit) floating-point elements in b from packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sub_ps&expand=5731)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubps))]
+pub unsafe fn _mm512_mask_sub_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let sub = _mm512_sub_ps(a, b).as_f32x16();
+ transmute(simd_select_bitmask(k, sub, src.as_f32x16()))
+}
+
+/// Subtract packed single-precision (32-bit) floating-point elements in b from packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sub_ps&expand=5732)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubps))]
+pub unsafe fn _mm512_maskz_sub_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let sub = _mm512_sub_ps(a, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed single-precision (32-bit) floating-point elements in b from packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sub_ps&expand=5728)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsubps))]
+pub unsafe fn _mm256_mask_sub_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let sub = _mm256_sub_ps(a, b).as_f32x8();
+ transmute(simd_select_bitmask(k, sub, src.as_f32x8()))
+}
+
+/// Subtract packed single-precision (32-bit) floating-point elements in b from packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sub_ps&expand=5729)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsubps))]
+pub unsafe fn _mm256_maskz_sub_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let sub = _mm256_sub_ps(a, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed single-precision (32-bit) floating-point elements in b from packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sub_ps&expand=5725)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsubps))]
+pub unsafe fn _mm_mask_sub_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let sub = _mm_sub_ps(a, b).as_f32x4();
+ transmute(simd_select_bitmask(k, sub, src.as_f32x4()))
+}
+
+/// Subtract packed single-precision (32-bit) floating-point elements in b from packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sub_ps&expand=5726)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsubps))]
+pub unsafe fn _mm_maskz_sub_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let sub = _mm_sub_ps(a, b).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in b from packed double-precision (64-bit) floating-point elements in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sub_pd&expand=5721)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubpd))]
+pub unsafe fn _mm512_sub_pd(a: __m512d, b: __m512d) -> __m512d {
+ transmute(simd_sub(a.as_f64x8(), b.as_f64x8()))
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in b from packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sub_pd&expand=5719)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubpd))]
+pub unsafe fn _mm512_mask_sub_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let sub = _mm512_sub_pd(a, b).as_f64x8();
+ transmute(simd_select_bitmask(k, sub, src.as_f64x8()))
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in b from packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sub_pd&expand=5720)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubpd))]
+pub unsafe fn _mm512_maskz_sub_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let sub = _mm512_sub_pd(a, b).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in b from packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sub_pd&expand=5716)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsubpd))]
+pub unsafe fn _mm256_mask_sub_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let sub = _mm256_sub_pd(a, b).as_f64x4();
+ transmute(simd_select_bitmask(k, sub, src.as_f64x4()))
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in b from packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sub_pd&expand=5717)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsubpd))]
+pub unsafe fn _mm256_maskz_sub_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let sub = _mm256_sub_pd(a, b).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in b from packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sub_pd&expand=5713)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsubpd))]
+pub unsafe fn _mm_mask_sub_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let sub = _mm_sub_pd(a, b).as_f64x2();
+ transmute(simd_select_bitmask(k, sub, src.as_f64x2()))
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in b from packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sub_pd&expand=5714)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsubpd))]
+pub unsafe fn _mm_maskz_sub_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let sub = _mm_sub_pd(a, b).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, sub, zero))
+}
+
+/// Multiply the low signed 32-bit integers from each packed 64-bit element in a and b, and store the signed 64-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mul_epi32&expand=3907)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmuldq))]
+pub unsafe fn _mm512_mul_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmuldq(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Multiply the low signed 32-bit integers from each packed 64-bit element in a and b, and store the signed 64-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mul_epi32&expand=3905)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmuldq))]
+pub unsafe fn _mm512_mask_mul_epi32(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let mul = _mm512_mul_epi32(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, mul, src.as_i64x8()))
+}
+
+/// Multiply the low signed 32-bit integers from each packed 64-bit element in a and b, and store the signed 64-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mul_epi32&expand=3906)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmuldq))]
+pub unsafe fn _mm512_maskz_mul_epi32(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let mul = _mm512_mul_epi32(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply the low signed 32-bit integers from each packed 64-bit element in a and b, and store the signed 64-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mul_epi32&expand=3902)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmuldq))]
+pub unsafe fn _mm256_mask_mul_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let mul = _mm256_mul_epi32(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, mul, src.as_i64x4()))
+}
+
+/// Multiply the low signed 32-bit integers from each packed 64-bit element in a and b, and store the signed 64-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mul_epi32&expand=3903)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmuldq))]
+pub unsafe fn _mm256_maskz_mul_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let mul = _mm256_mul_epi32(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply the low signed 32-bit integers from each packed 64-bit element in a and b, and store the signed 64-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mul_epi32&expand=3899)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmuldq))]
+pub unsafe fn _mm_mask_mul_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let mul = _mm_mul_epi32(a, b).as_i64x2();
+ transmute(simd_select_bitmask(k, mul, src.as_i64x2()))
+}
+
+/// Multiply the low signed 32-bit integers from each packed 64-bit element in a and b, and store the signed 64-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mul_epi32&expand=3900)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmuldq))]
+pub unsafe fn _mm_maskz_mul_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let mul = _mm_mul_epi32(a, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, and store the low 32 bits of the intermediate integers in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mullo_epi&expand=4005)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmulld))]
+pub unsafe fn _mm512_mullo_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_mul(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, and store the low 32 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mullo_epi32&expand=4003)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmulld))]
+pub unsafe fn _mm512_mask_mullo_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let mul = _mm512_mullo_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, mul, src.as_i32x16()))
+}
+
+/// Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, and store the low 32 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mullo_epi32&expand=4004)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmulld))]
+pub unsafe fn _mm512_maskz_mullo_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let mul = _mm512_mullo_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, and store the low 32 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mullo_epi32&expand=4000)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmulld))]
+pub unsafe fn _mm256_mask_mullo_epi32(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let mul = _mm256_mullo_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, mul, src.as_i32x8()))
+}
+
+/// Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, and store the low 32 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mullo_epi32&expand=4001)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmulld))]
+pub unsafe fn _mm256_maskz_mullo_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let mul = _mm256_mullo_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, and store the low 32 bits of the intermediate integers in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mullo_epi32&expand=3997)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmulld))]
+pub unsafe fn _mm_mask_mullo_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let mul = _mm_mullo_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, mul, src.as_i32x4()))
+}
+
+/// Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, and store the low 32 bits of the intermediate integers in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mullo_epi32&expand=3998)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmulld))]
+pub unsafe fn _mm_maskz_mullo_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let mul = _mm_mullo_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiplies elements in packed 64-bit integer vectors a and b together, storing the lower 64 bits of the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_mullox_epi64&expand=4017)
+///
+/// This intrinsic generates a sequence of instructions, which may perform worse than a native instruction. Consider the performance impact of this intrinsic.
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mullox_epi64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_mul(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Multiplies elements in packed 64-bit integer vectors a and b together, storing the lower 64 bits of the result in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_mask_mullox&expand=4016)
+///
+/// This intrinsic generates a sequence of instructions, which may perform worse than a native instruction. Consider the performance impact of this intrinsic.
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_mullox_epi64(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let mul = _mm512_mullox_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, mul, src.as_i64x8()))
+}
+
+/// Multiply the low unsigned 32-bit integers from each packed 64-bit element in a and b, and store the unsigned 64-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_mul_epu32&expand=3916)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmuludq))]
+pub unsafe fn _mm512_mul_epu32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmuludq(a.as_u32x16(), b.as_u32x16()))
+}
+
+/// Multiply the low unsigned 32-bit integers from each packed 64-bit element in a and b, and store the unsigned 64-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_mask_mul_epu32&expand=3914)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmuludq))]
+pub unsafe fn _mm512_mask_mul_epu32(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let mul = _mm512_mul_epu32(a, b).as_u64x8();
+ transmute(simd_select_bitmask(k, mul, src.as_u64x8()))
+}
+
+/// Multiply the low unsigned 32-bit integers from each packed 64-bit element in a and b, and store the unsigned 64-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_maskz_mul_epu32&expand=3915)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmuludq))]
+pub unsafe fn _mm512_maskz_mul_epu32(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let mul = _mm512_mul_epu32(a, b).as_u64x8();
+ let zero = _mm512_setzero_si512().as_u64x8();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply the low unsigned 32-bit integers from each packed 64-bit element in a and b, and store the unsigned 64-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mul_epu32&expand=3911)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmuludq))]
+pub unsafe fn _mm256_mask_mul_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let mul = _mm256_mul_epu32(a, b).as_u64x4();
+ transmute(simd_select_bitmask(k, mul, src.as_u64x4()))
+}
+
+/// Multiply the low unsigned 32-bit integers from each packed 64-bit element in a and b, and store the unsigned 64-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mul_epu32&expand=3912)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmuludq))]
+pub unsafe fn _mm256_maskz_mul_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let mul = _mm256_mul_epu32(a, b).as_u64x4();
+ let zero = _mm256_setzero_si256().as_u64x4();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply the low unsigned 32-bit integers from each packed 64-bit element in a and b, and store the unsigned 64-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mul_epu32&expand=3908)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmuludq))]
+pub unsafe fn _mm_mask_mul_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let mul = _mm_mul_epu32(a, b).as_u64x2();
+ transmute(simd_select_bitmask(k, mul, src.as_u64x2()))
+}
+
+/// Multiply the low unsigned 32-bit integers from each packed 64-bit element in a and b, and store the unsigned 64-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mul_epu32&expand=3909)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmuludq))]
+pub unsafe fn _mm_maskz_mul_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let mul = _mm_mul_epu32(a, b).as_u64x2();
+ let zero = _mm_setzero_si128().as_u64x2();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mul_ps&expand=3934)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulps))]
+pub unsafe fn _mm512_mul_ps(a: __m512, b: __m512) -> __m512 {
+ transmute(simd_mul(a.as_f32x16(), b.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mul_ps&expand=3932)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulps))]
+pub unsafe fn _mm512_mask_mul_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let mul = _mm512_mul_ps(a, b).as_f32x16();
+ transmute(simd_select_bitmask(k, mul, src.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mul_ps&expand=3933)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulps))]
+pub unsafe fn _mm512_maskz_mul_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let mul = _mm512_mul_ps(a, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mul_ps&expand=3929)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmulps))]
+pub unsafe fn _mm256_mask_mul_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let mul = _mm256_mul_ps(a, b).as_f32x8();
+ transmute(simd_select_bitmask(k, mul, src.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mul_ps&expand=3930)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmulps))]
+pub unsafe fn _mm256_maskz_mul_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let mul = _mm256_mul_ps(a, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mul_ps&expand=3926)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmulps))]
+pub unsafe fn _mm_mask_mul_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let mul = _mm_mul_ps(a, b).as_f32x4();
+ transmute(simd_select_bitmask(k, mul, src.as_f32x4()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mul_ps&expand=3927)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmulps))]
+pub unsafe fn _mm_maskz_mul_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let mul = _mm_mul_ps(a, b).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mul_pd&expand=3925)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulpd))]
+pub unsafe fn _mm512_mul_pd(a: __m512d, b: __m512d) -> __m512d {
+ transmute(simd_mul(a.as_f64x8(), b.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mul_pd&expand=3923)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulpd))]
+pub unsafe fn _mm512_mask_mul_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let mul = _mm512_mul_pd(a, b).as_f64x8();
+ transmute(simd_select_bitmask(k, mul, src.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mul_pd&expand=3924)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulpd))]
+pub unsafe fn _mm512_maskz_mul_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let mul = _mm512_mul_pd(a, b).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_mul_pd&expand=3920)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmulpd))]
+pub unsafe fn _mm256_mask_mul_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let mul = _mm256_mul_pd(a, b).as_f64x4();
+ transmute(simd_select_bitmask(k, mul, src.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_mul_pd&expand=3921)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmulpd))]
+pub unsafe fn _mm256_maskz_mul_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let mul = _mm256_mul_pd(a, b).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_mul_pd&expand=3917)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmulpd))]
+pub unsafe fn _mm_mask_mul_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let mul = _mm_mul_pd(a, b).as_f64x2();
+ transmute(simd_select_bitmask(k, mul, src.as_f64x2()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_mul_pd&expand=3918)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmulpd))]
+pub unsafe fn _mm_maskz_mul_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let mul = _mm_mul_pd(a, b).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, mul, zero))
+}
+
+/// Divide packed single-precision (32-bit) floating-point elements in a by packed elements in b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_div_ps&expand=2162)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivps))]
+pub unsafe fn _mm512_div_ps(a: __m512, b: __m512) -> __m512 {
+ transmute(simd_div(a.as_f32x16(), b.as_f32x16()))
+}
+
+/// Divide packed single-precision (32-bit) floating-point elements in a by packed elements in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_div_ps&expand=2163)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivps))]
+pub unsafe fn _mm512_mask_div_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let div = _mm512_div_ps(a, b).as_f32x16();
+ transmute(simd_select_bitmask(k, div, src.as_f32x16()))
+}
+
+/// Divide packed single-precision (32-bit) floating-point elements in a by packed elements in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_div_ps&expand=2164)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivps))]
+pub unsafe fn _mm512_maskz_div_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let div = _mm512_div_ps(a, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, div, zero))
+}
+
+/// Divide packed single-precision (32-bit) floating-point elements in a by packed elements in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_div_ps&expand=2160)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vdivps))]
+pub unsafe fn _mm256_mask_div_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let div = _mm256_div_ps(a, b).as_f32x8();
+ transmute(simd_select_bitmask(k, div, src.as_f32x8()))
+}
+
+/// Divide packed single-precision (32-bit) floating-point elements in a by packed elements in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_div_ps&expand=2161)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vdivps))]
+pub unsafe fn _mm256_maskz_div_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let div = _mm256_div_ps(a, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, div, zero))
+}
+
+/// Divide packed single-precision (32-bit) floating-point elements in a by packed elements in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_div_ps&expand=2157)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vdivps))]
+pub unsafe fn _mm_mask_div_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let div = _mm_div_ps(a, b).as_f32x4();
+ transmute(simd_select_bitmask(k, div, src.as_f32x4()))
+}
+
+/// Divide packed single-precision (32-bit) floating-point elements in a by packed elements in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_div_ps&expand=2158)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vdivps))]
+pub unsafe fn _mm_maskz_div_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let div = _mm_div_ps(a, b).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, div, zero))
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in a by packed elements in b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_div_pd&expand=2153)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivpd))]
+pub unsafe fn _mm512_div_pd(a: __m512d, b: __m512d) -> __m512d {
+ transmute(simd_div(a.as_f64x8(), b.as_f64x8()))
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in a by packed elements in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_div_pd&expand=2154)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivpd))]
+pub unsafe fn _mm512_mask_div_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let div = _mm512_div_pd(a, b).as_f64x8();
+ transmute(simd_select_bitmask(k, div, src.as_f64x8()))
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in a by packed elements in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_div_pd&expand=2155)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivpd))]
+pub unsafe fn _mm512_maskz_div_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let div = _mm512_div_pd(a, b).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, div, zero))
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in a by packed elements in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_div_pd&expand=2151)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vdivpd))]
+pub unsafe fn _mm256_mask_div_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let div = _mm256_div_pd(a, b).as_f64x4();
+ transmute(simd_select_bitmask(k, div, src.as_f64x4()))
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in a by packed elements in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_div_pd&expand=2152)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vdivpd))]
+pub unsafe fn _mm256_maskz_div_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let div = _mm256_div_pd(a, b).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, div, zero))
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in a by packed elements in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_div_pd&expand=2148)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vdivpd))]
+pub unsafe fn _mm_mask_div_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let div = _mm_div_pd(a, b).as_f64x2();
+ transmute(simd_select_bitmask(k, div, src.as_f64x2()))
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in a by packed elements in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_div_pd&expand=2149)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vdivpd))]
+pub unsafe fn _mm_maskz_div_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let div = _mm_div_pd(a, b).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, div, zero))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_epi32&expand=3582)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxsd))]
+pub unsafe fn _mm512_max_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmaxsd(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_epi32&expand=3580)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxsd))]
+pub unsafe fn _mm512_mask_max_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let max = _mm512_max_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, max, src.as_i32x16()))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_epi32&expand=3581)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxsd))]
+pub unsafe fn _mm512_maskz_max_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let max = _mm512_max_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_max_epi32&expand=3577)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxsd))]
+pub unsafe fn _mm256_mask_max_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let max = _mm256_max_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, max, src.as_i32x8()))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_max_epi32&expand=3578)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxsd))]
+pub unsafe fn _mm256_maskz_max_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let max = _mm256_max_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_max_epi32&expand=3574)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxsd))]
+pub unsafe fn _mm_mask_max_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let max = _mm_max_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, max, src.as_i32x4()))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_max_epi32&expand=3575)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxsd))]
+pub unsafe fn _mm_maskz_max_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let max = _mm_max_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_epi64&expand=3591)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxsq))]
+pub unsafe fn _mm512_max_epi64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmaxsq(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_epi64&expand=3589)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxsq))]
+pub unsafe fn _mm512_mask_max_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let max = _mm512_max_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, max, src.as_i64x8()))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_epi64&expand=3590)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxsq))]
+pub unsafe fn _mm512_maskz_max_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let max = _mm512_max_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_max_epi64&expand=3588)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxsq))]
+pub unsafe fn _mm256_max_epi64(a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpmaxsq256(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_max_epi64&expand=3586)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxsq))]
+pub unsafe fn _mm256_mask_max_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let max = _mm256_max_epi64(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, max, src.as_i64x4()))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_max_epi64&expand=3587)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxsq))]
+pub unsafe fn _mm256_maskz_max_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let max = _mm256_max_epi64(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_epi64&expand=3585)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxsq))]
+pub unsafe fn _mm_max_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpmaxsq128(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_max_epi64&expand=3583)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxsq))]
+pub unsafe fn _mm_mask_max_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let max = _mm_max_epi64(a, b).as_i64x2();
+ transmute(simd_select_bitmask(k, max, src.as_i64x2()))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_max_epi64&expand=3584)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxsq))]
+pub unsafe fn _mm_maskz_max_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let max = _mm_max_epi64(a, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_ps&expand=3655)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxps))]
+pub unsafe fn _mm512_max_ps(a: __m512, b: __m512) -> __m512 {
+ transmute(vmaxps(
+ a.as_f32x16(),
+ b.as_f32x16(),
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_ps&expand=3653)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxps))]
+pub unsafe fn _mm512_mask_max_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let max = _mm512_max_ps(a, b).as_f32x16();
+ transmute(simd_select_bitmask(k, max, src.as_f32x16()))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_ps&expand=3654)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxps))]
+pub unsafe fn _mm512_maskz_max_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let max = _mm512_max_ps(a, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_max_ps&expand=3650)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmaxps))]
+pub unsafe fn _mm256_mask_max_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let max = _mm256_max_ps(a, b).as_f32x8();
+ transmute(simd_select_bitmask(k, max, src.as_f32x8()))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_max_ps&expand=3651)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmaxps))]
+pub unsafe fn _mm256_maskz_max_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let max = _mm256_max_ps(a, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_max_ps&expand=3647)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmaxps))]
+pub unsafe fn _mm_mask_max_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let max = _mm_max_ps(a, b).as_f32x4();
+ transmute(simd_select_bitmask(k, max, src.as_f32x4()))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_max_ps&expand=3648)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmaxps))]
+pub unsafe fn _mm_maskz_max_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let max = _mm_max_ps(a, b).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_pd&expand=3645)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxpd))]
+pub unsafe fn _mm512_max_pd(a: __m512d, b: __m512d) -> __m512d {
+ transmute(vmaxpd(a.as_f64x8(), b.as_f64x8(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_pd&expand=3643)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxpd))]
+pub unsafe fn _mm512_mask_max_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let max = _mm512_max_pd(a, b).as_f64x8();
+ transmute(simd_select_bitmask(k, max, src.as_f64x8()))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_pd&expand=3644)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxpd))]
+pub unsafe fn _mm512_maskz_max_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let max = _mm512_max_pd(a, b).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_max_pd&expand=3640)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmaxpd))]
+pub unsafe fn _mm256_mask_max_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let max = _mm256_max_pd(a, b).as_f64x4();
+ transmute(simd_select_bitmask(k, max, src.as_f64x4()))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_max_pd&expand=3641)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmaxpd))]
+pub unsafe fn _mm256_maskz_max_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let max = _mm256_max_pd(a, b).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_max_pd&expand=3637)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmaxpd))]
+pub unsafe fn _mm_mask_max_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let max = _mm_max_pd(a, b).as_f64x2();
+ transmute(simd_select_bitmask(k, max, src.as_f64x2()))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_max_pd&expand=3638)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmaxpd))]
+pub unsafe fn _mm_maskz_max_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let max = _mm_max_pd(a, b).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_epu32&expand=3618)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxud))]
+pub unsafe fn _mm512_max_epu32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmaxud(a.as_u32x16(), b.as_u32x16()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_epu32&expand=3616)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxud))]
+pub unsafe fn _mm512_mask_max_epu32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let max = _mm512_max_epu32(a, b).as_u32x16();
+ transmute(simd_select_bitmask(k, max, src.as_u32x16()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_epu32&expand=3617)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxud))]
+pub unsafe fn _mm512_maskz_max_epu32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let max = _mm512_max_epu32(a, b).as_u32x16();
+ let zero = _mm512_setzero_si512().as_u32x16();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_max_epu32&expand=3613)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxud))]
+pub unsafe fn _mm256_mask_max_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let max = _mm256_max_epu32(a, b).as_u32x8();
+ transmute(simd_select_bitmask(k, max, src.as_u32x8()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_max_epu32&expand=3614)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxud))]
+pub unsafe fn _mm256_maskz_max_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let max = _mm256_max_epu32(a, b).as_u32x8();
+ let zero = _mm256_setzero_si256().as_u32x8();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_max_epu32&expand=3610)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxud))]
+pub unsafe fn _mm_mask_max_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let max = _mm_max_epu32(a, b).as_u32x4();
+ transmute(simd_select_bitmask(k, max, src.as_u32x4()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_max_epu32&expand=3611)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxud))]
+pub unsafe fn _mm_maskz_max_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let max = _mm_max_epu32(a, b).as_u32x4();
+ let zero = _mm_setzero_si128().as_u32x4();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_epu64&expand=3627)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxuq))]
+pub unsafe fn _mm512_max_epu64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmaxuq(a.as_u64x8(), b.as_u64x8()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_epu64&expand=3625)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxuq))]
+pub unsafe fn _mm512_mask_max_epu64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let max = _mm512_max_epu64(a, b).as_u64x8();
+ transmute(simd_select_bitmask(k, max, src.as_u64x8()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_epu&expand=3626)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmaxuq))]
+pub unsafe fn _mm512_maskz_max_epu64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let max = _mm512_max_epu64(a, b).as_u64x8();
+ let zero = _mm512_setzero_si512().as_u64x8();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_max_epu64&expand=3624)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxuq))]
+pub unsafe fn _mm256_max_epu64(a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpmaxuq256(a.as_u64x4(), b.as_u64x4()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_max_epu64&expand=3622)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxuq))]
+pub unsafe fn _mm256_mask_max_epu64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let max = _mm256_max_epu64(a, b).as_u64x4();
+ transmute(simd_select_bitmask(k, max, src.as_u64x4()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_max_epu64&expand=3623)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxuq))]
+pub unsafe fn _mm256_maskz_max_epu64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let max = _mm256_max_epu64(a, b).as_u64x4();
+ let zero = _mm256_setzero_si256().as_u64x4();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_epu64&expand=3621)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxuq))]
+pub unsafe fn _mm_max_epu64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpmaxuq128(a.as_u64x2(), b.as_u64x2()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_max_epu64&expand=3619)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxuq))]
+pub unsafe fn _mm_mask_max_epu64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let max = _mm_max_epu64(a, b).as_u64x2();
+ transmute(simd_select_bitmask(k, max, src.as_u64x2()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_max_epu64&expand=3620)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmaxuq))]
+pub unsafe fn _mm_maskz_max_epu64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let max = _mm_max_epu64(a, b).as_u64x2();
+ let zero = _mm_setzero_si128().as_u64x2();
+ transmute(simd_select_bitmask(k, max, zero))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_epi32&expand=3696)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminsd))]
+pub unsafe fn _mm512_min_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpminsd(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_epi32&expand=3694)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminsd))]
+pub unsafe fn _mm512_mask_min_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let min = _mm512_min_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, min, src.as_i32x16()))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_min_epi32&expand=3695)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminsd))]
+pub unsafe fn _mm512_maskz_min_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let min = _mm512_min_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_min_epi32&expand=3691)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminsd))]
+pub unsafe fn _mm256_mask_min_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let min = _mm256_min_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, min, src.as_i32x8()))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_min_epi32&expand=3692)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminsd))]
+pub unsafe fn _mm256_maskz_min_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let min = _mm256_min_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_min_epi32&expand=3688)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminsd))]
+pub unsafe fn _mm_mask_min_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let min = _mm_min_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, min, src.as_i32x4()))
+}
+
+/// Compare packed signed 32-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_min_epi32&expand=3689)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminsd))]
+pub unsafe fn _mm_maskz_min_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let min = _mm_min_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_epi64&expand=3705)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminsq))]
+pub unsafe fn _mm512_min_epi64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpminsq(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_epi64&expand=3703)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminsq))]
+pub unsafe fn _mm512_mask_min_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let min = _mm512_min_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, min, src.as_i64x8()))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_maskz_min_epi64&expand=3704)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminsq))]
+pub unsafe fn _mm512_maskz_min_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let min = _mm512_min_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_min_epi64&expand=3702)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminsq))]
+pub unsafe fn _mm256_min_epi64(a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpminsq256(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_min_epi64&expand=3700)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminsq))]
+pub unsafe fn _mm256_mask_min_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let min = _mm256_min_epi64(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, min, src.as_i64x4()))
+}
+
+/// Compare packed signed 64-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_min_epi64&expand=3701)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminsq))]
+pub unsafe fn _mm256_maskz_min_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let min = _mm256_min_epi64(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_ps&expand=3769)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminps))]
+pub unsafe fn _mm512_min_ps(a: __m512, b: __m512) -> __m512 {
+ transmute(vminps(
+ a.as_f32x16(),
+ b.as_f32x16(),
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_ps&expand=3767)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminps))]
+pub unsafe fn _mm512_mask_min_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let min = _mm512_min_ps(a, b).as_f32x16();
+ transmute(simd_select_bitmask(k, min, src.as_f32x16()))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_min_ps&expand=3768)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminps))]
+pub unsafe fn _mm512_maskz_min_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let min = _mm512_min_ps(a, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_min_ps&expand=3764)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vminps))]
+pub unsafe fn _mm256_mask_min_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let min = _mm256_min_ps(a, b).as_f32x8();
+ transmute(simd_select_bitmask(k, min, src.as_f32x8()))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_min_ps&expand=3765)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vminps))]
+pub unsafe fn _mm256_maskz_min_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let min = _mm256_min_ps(a, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_min_ps&expand=3761)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vminps))]
+pub unsafe fn _mm_mask_min_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let min = _mm_min_ps(a, b).as_f32x4();
+ transmute(simd_select_bitmask(k, min, src.as_f32x4()))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_min_ps&expand=3762)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vminps))]
+pub unsafe fn _mm_maskz_min_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let min = _mm_min_ps(a, b).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst.
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_min_pd&expand=3759)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminpd))]
+pub unsafe fn _mm512_min_pd(a: __m512d, b: __m512d) -> __m512d {
+ transmute(vminpd(a.as_f64x8(), b.as_f64x8(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_mask_min_pd&expand=3757)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminpd))]
+pub unsafe fn _mm512_mask_min_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let min = _mm512_min_pd(a, b).as_f64x8();
+ transmute(simd_select_bitmask(k, min, src.as_f64x8()))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_maskz_min_pd&expand=3758)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminpd))]
+pub unsafe fn _mm512_maskz_min_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let min = _mm512_min_pd(a, b).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_min_pd&expand=3754)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vminpd))]
+pub unsafe fn _mm256_mask_min_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let min = _mm256_min_pd(a, b).as_f64x4();
+ transmute(simd_select_bitmask(k, min, src.as_f64x4()))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_min_pd&expand=3755)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vminpd))]
+pub unsafe fn _mm256_maskz_min_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let min = _mm256_min_pd(a, b).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_min_pd&expand=3751)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vminpd))]
+pub unsafe fn _mm_mask_min_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let min = _mm_min_pd(a, b).as_f64x2();
+ transmute(simd_select_bitmask(k, min, src.as_f64x2()))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_min_pd&expand=3752)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vminpd))]
+pub unsafe fn _mm_maskz_min_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let min = _mm_min_pd(a, b).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_epu32&expand=3732)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminud))]
+pub unsafe fn _mm512_min_epu32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpminud(a.as_u32x16(), b.as_u32x16()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_epu32&expand=3730)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminud))]
+pub unsafe fn _mm512_mask_min_epu32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let min = _mm512_min_epu32(a, b).as_u32x16();
+ transmute(simd_select_bitmask(k, min, src.as_u32x16()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_min_epu32&expand=3731)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminud))]
+pub unsafe fn _mm512_maskz_min_epu32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let min = _mm512_min_epu32(a, b).as_u32x16();
+ let zero = _mm512_setzero_si512().as_u32x16();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_min_epu32&expand=3727)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminud))]
+pub unsafe fn _mm256_mask_min_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let min = _mm256_min_epu32(a, b).as_u32x8();
+ transmute(simd_select_bitmask(k, min, src.as_u32x8()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_min_epu32&expand=3728)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminud))]
+pub unsafe fn _mm256_maskz_min_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let min = _mm256_min_epu32(a, b).as_u32x8();
+ let zero = _mm256_setzero_si256().as_u32x8();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_min_epu32&expand=3724)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminud))]
+pub unsafe fn _mm_mask_min_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let min = _mm_min_epu32(a, b).as_u32x4();
+ transmute(simd_select_bitmask(k, min, src.as_u32x4()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_min_epu32&expand=3725)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminud))]
+pub unsafe fn _mm_maskz_min_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let min = _mm_min_epu32(a, b).as_u32x4();
+ let zero = _mm_setzero_si128().as_u32x4();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_epu64&expand=3741)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminuq))]
+pub unsafe fn _mm512_min_epu64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpminuq(a.as_u64x8(), b.as_u64x8()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_epu64&expand=3739)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminuq))]
+pub unsafe fn _mm512_mask_min_epu64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let min = _mm512_min_epu64(a, b).as_u64x8();
+ transmute(simd_select_bitmask(k, min, src.as_u64x8()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_min_epu64&expand=3740)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpminuq))]
+pub unsafe fn _mm512_maskz_min_epu64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let min = _mm512_min_epu64(a, b).as_u64x8();
+ let zero = _mm512_setzero_si512().as_u64x8();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_min_epu64&expand=3738)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminuq))]
+pub unsafe fn _mm256_min_epu64(a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpminuq256(a.as_u64x4(), b.as_u64x4()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_min_epu64&expand=3736)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminuq))]
+pub unsafe fn _mm256_mask_min_epu64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let min = _mm256_min_epu64(a, b).as_u64x4();
+ transmute(simd_select_bitmask(k, min, src.as_u64x4()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_min_epu64&expand=3737)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminuq))]
+pub unsafe fn _mm256_maskz_min_epu64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let min = _mm256_min_epu64(a, b).as_u64x4();
+ let zero = _mm256_setzero_si256().as_u64x4();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_epu64&expand=3735)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminuq))]
+pub unsafe fn _mm_min_epu64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpminuq128(a.as_u64x2(), b.as_u64x2()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_min_epu64&expand=3733)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminuq))]
+pub unsafe fn _mm_mask_min_epu64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let min = _mm_min_epu64(a, b).as_u64x2();
+ transmute(simd_select_bitmask(k, min, src.as_u64x2()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_min_epu64&expand=3734)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpminuq))]
+pub unsafe fn _mm_maskz_min_epu64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let min = _mm_min_epu64(a, b).as_u64x2();
+ let zero = _mm_setzero_si128().as_u64x2();
+ transmute(simd_select_bitmask(k, min, zero))
+}
+
+/// Compute the square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sqrt_ps&expand=5371)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtps))]
+pub unsafe fn _mm512_sqrt_ps(a: __m512) -> __m512 {
+ transmute(vsqrtps(a.as_f32x16(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Compute the square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sqrt_ps&expand=5369)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtps))]
+pub unsafe fn _mm512_mask_sqrt_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 {
+ let sqrt = _mm512_sqrt_ps(a).as_f32x16();
+ transmute(simd_select_bitmask(k, sqrt, src.as_f32x16()))
+}
+
+/// Compute the square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sqrt_ps&expand=5370)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtps))]
+pub unsafe fn _mm512_maskz_sqrt_ps(k: __mmask16, a: __m512) -> __m512 {
+ let sqrt = _mm512_sqrt_ps(a).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, sqrt, zero))
+}
+
+/// Compute the square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sqrt_ps&expand=5366)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsqrtps))]
+pub unsafe fn _mm256_mask_sqrt_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 {
+ let sqrt = _mm256_sqrt_ps(a).as_f32x8();
+ transmute(simd_select_bitmask(k, sqrt, src.as_f32x8()))
+}
+
+/// Compute the square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sqrt_ps&expand=5367)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsqrtps))]
+pub unsafe fn _mm256_maskz_sqrt_ps(k: __mmask8, a: __m256) -> __m256 {
+ let sqrt = _mm256_sqrt_ps(a).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, sqrt, zero))
+}
+
+/// Compute the square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sqrt_ps&expand=5363)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsqrtps))]
+pub unsafe fn _mm_mask_sqrt_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ let sqrt = _mm_sqrt_ps(a).as_f32x4();
+ transmute(simd_select_bitmask(k, sqrt, src.as_f32x4()))
+}
+
+/// Compute the square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sqrt_ps&expand=5364)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsqrtps))]
+pub unsafe fn _mm_maskz_sqrt_ps(k: __mmask8, a: __m128) -> __m128 {
+ let sqrt = _mm_sqrt_ps(a).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, sqrt, zero))
+}
+
+/// Compute the square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sqrt_pd&expand=5362)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtpd))]
+pub unsafe fn _mm512_sqrt_pd(a: __m512d) -> __m512d {
+ transmute(vsqrtpd(a.as_f64x8(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Compute the square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sqrt_pd&expand=5360)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtpd))]
+pub unsafe fn _mm512_mask_sqrt_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d {
+ let sqrt = _mm512_sqrt_pd(a).as_f64x8();
+ transmute(simd_select_bitmask(k, sqrt, src.as_f64x8()))
+}
+
+/// Compute the square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sqrt_pd&expand=5361)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtpd))]
+pub unsafe fn _mm512_maskz_sqrt_pd(k: __mmask8, a: __m512d) -> __m512d {
+ let sqrt = _mm512_sqrt_pd(a).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, sqrt, zero))
+}
+
+/// Compute the square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sqrt_pd&expand=5357)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsqrtpd))]
+pub unsafe fn _mm256_mask_sqrt_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d {
+ let sqrt = _mm256_sqrt_pd(a).as_f64x4();
+ transmute(simd_select_bitmask(k, sqrt, src.as_f64x4()))
+}
+
+/// Compute the square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sqrt_pd&expand=5358)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsqrtpd))]
+pub unsafe fn _mm256_maskz_sqrt_pd(k: __mmask8, a: __m256d) -> __m256d {
+ let sqrt = _mm256_sqrt_pd(a).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, sqrt, zero))
+}
+
+/// Compute the square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sqrt_pd&expand=5354)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsqrtpd))]
+pub unsafe fn _mm_mask_sqrt_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d {
+ let sqrt = _mm_sqrt_pd(a).as_f64x2();
+ transmute(simd_select_bitmask(k, sqrt, src.as_f64x2()))
+}
+
+/// Compute the square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sqrt_pd&expand=5355)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vsqrtpd))]
+pub unsafe fn _mm_maskz_sqrt_pd(k: __mmask8, a: __m128d) -> __m128d {
+ let sqrt = _mm_sqrt_pd(a).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, sqrt, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmadd_ps&expand=2557)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+pub unsafe fn _mm512_fmadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 {
+ transmute(vfmadd132ps(a.as_f32x16(), b.as_f32x16(), c.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmadd_ps&expand=2558)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+pub unsafe fn _mm512_mask_fmadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 {
+ let fmadd = _mm512_fmadd_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fmadd, a.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmadd_ps&expand=2560)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+pub unsafe fn _mm512_maskz_fmadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 {
+ let fmadd = _mm512_fmadd_ps(a, b, c).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, fmadd, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmadd_ps&expand=2559)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+pub unsafe fn _mm512_mask3_fmadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 {
+ let fmadd = _mm512_fmadd_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fmadd, c.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fmadd_ps&expand=2554)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+pub unsafe fn _mm256_mask_fmadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 {
+ let fmadd = _mm256_fmadd_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fmadd, a.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fmadd_ps&expand=2556)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+pub unsafe fn _mm256_maskz_fmadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 {
+ let fmadd = _mm256_fmadd_ps(a, b, c).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, fmadd, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fmadd_ps&expand=2555)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+pub unsafe fn _mm256_mask3_fmadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 {
+ let fmadd = _mm256_fmadd_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fmadd, c.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fmadd_ps&expand=2550)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+pub unsafe fn _mm_mask_fmadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 {
+ let fmadd = _mm_fmadd_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fmadd, a.as_f32x4()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fmadd_ps&expand=2552)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+pub unsafe fn _mm_maskz_fmadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 {
+ let fmadd = _mm_fmadd_ps(a, b, c).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, fmadd, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fmadd_ps&expand=2551)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+pub unsafe fn _mm_mask3_fmadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 {
+ let fmadd = _mm_fmadd_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fmadd, c.as_f32x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmadd_pd&expand=2545)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+pub unsafe fn _mm512_fmadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ transmute(vfmadd132pd(a.as_f64x8(), b.as_f64x8(), c.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmadd_pd&expand=2546)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+pub unsafe fn _mm512_mask_fmadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d {
+ let fmadd = _mm512_fmadd_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fmadd, a.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmadd_pd&expand=2548)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+pub unsafe fn _mm512_maskz_fmadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ let fmadd = _mm512_fmadd_pd(a, b, c).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, fmadd, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmadd_pd&expand=2547)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+pub unsafe fn _mm512_mask3_fmadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d {
+ let fmadd = _mm512_fmadd_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fmadd, c.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fmadd_pd&expand=2542)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+pub unsafe fn _mm256_mask_fmadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d {
+ let fmadd = _mm256_fmadd_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fmadd, a.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fmadd_pd&expand=2544)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+pub unsafe fn _mm256_maskz_fmadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ let fmadd = _mm256_fmadd_pd(a, b, c).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, fmadd, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fmadd_pd&expand=2543)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+pub unsafe fn _mm256_mask3_fmadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d {
+ let fmadd = _mm256_fmadd_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fmadd, c.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fmadd_pd&expand=2538)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+pub unsafe fn _mm_mask_fmadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d {
+ let fmadd = _mm_fmadd_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fmadd, a.as_f64x2()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fmadd_pd&expand=2540)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+pub unsafe fn _mm_maskz_fmadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ let fmadd = _mm_fmadd_pd(a, b, c).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, fmadd, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fmadd_pd&expand=2539)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+pub unsafe fn _mm_mask3_fmadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d {
+ let fmadd = _mm_fmadd_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fmadd, c.as_f64x2()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmsub_ps&expand=2643)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub
+pub unsafe fn _mm512_fmsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 {
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f32x16());
+ transmute(vfmadd132ps(a.as_f32x16(), b.as_f32x16(), sub))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmsub_ps&expand=2644)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub
+pub unsafe fn _mm512_mask_fmsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 {
+ let fmsub = _mm512_fmsub_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fmsub, a.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmsub_ps&expand=2646)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub
+pub unsafe fn _mm512_maskz_fmsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 {
+ let fmsub = _mm512_fmsub_ps(a, b, c).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, fmsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmsub_ps&expand=2645)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub
+pub unsafe fn _mm512_mask3_fmsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 {
+ let fmsub = _mm512_fmsub_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fmsub, c.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fmsub_ps&expand=2640)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub
+pub unsafe fn _mm256_mask_fmsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 {
+ let fmsub = _mm256_fmsub_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fmsub, a.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fmsub_ps&expand=2642)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub
+pub unsafe fn _mm256_maskz_fmsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 {
+ let fmsub = _mm256_fmsub_ps(a, b, c).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, fmsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fmsub_ps&expand=2641)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub
+pub unsafe fn _mm256_mask3_fmsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 {
+ let fmsub = _mm256_fmsub_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fmsub, c.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fmsub_ps&expand=2636)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub
+pub unsafe fn _mm_mask_fmsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 {
+ let fmsub = _mm_fmsub_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fmsub, a.as_f32x4()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fmsub_ps&expand=2638)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub
+pub unsafe fn _mm_maskz_fmsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 {
+ let fmsub = _mm_fmsub_ps(a, b, c).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, fmsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fmsub_ps&expand=2637)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub
+pub unsafe fn _mm_mask3_fmsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 {
+ let fmsub = _mm_fmsub_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fmsub, c.as_f32x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmsub_pd&expand=2631)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub
+pub unsafe fn _mm512_fmsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f64x8());
+ transmute(vfmadd132pd(a.as_f64x8(), b.as_f64x8(), sub))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmsub_pd&expand=2632)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub
+pub unsafe fn _mm512_mask_fmsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d {
+ let fmsub = _mm512_fmsub_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fmsub, a.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmsub_pd&expand=2634)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub
+pub unsafe fn _mm512_maskz_fmsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ let fmsub = _mm512_fmsub_pd(a, b, c).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, fmsub, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmsub_pd&expand=2633)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub
+pub unsafe fn _mm512_mask3_fmsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d {
+ let fmsub = _mm512_fmsub_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fmsub, c.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fmsub_pd&expand=2628)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub
+pub unsafe fn _mm256_mask_fmsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d {
+ let fmsub = _mm256_fmsub_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fmsub, a.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fmsub_pd&expand=2630)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub
+pub unsafe fn _mm256_maskz_fmsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ let fmsub = _mm256_fmsub_pd(a, b, c).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, fmsub, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fmsub_pd&expand=2629)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub
+pub unsafe fn _mm256_mask3_fmsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d {
+ let fmsub = _mm256_fmsub_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fmsub, c.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fmsub_pd&expand=2624)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub
+pub unsafe fn _mm_mask_fmsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d {
+ let fmsub = _mm_fmsub_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fmsub, a.as_f64x2()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fmsub_pd&expand=2626)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub
+pub unsafe fn _mm_maskz_fmsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ let fmsub = _mm_fmsub_pd(a, b, c).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, fmsub, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fmsub_pd&expand=2625)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub
+pub unsafe fn _mm_mask3_fmsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d {
+ let fmsub = _mm_fmsub_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fmsub, c.as_f64x2()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmaddsub_ps&expand=2611)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+pub unsafe fn _mm512_fmaddsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 {
+ transmute(vfmaddsub213ps(
+ a.as_f32x16(),
+ b.as_f32x16(),
+ c.as_f32x16(),
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmaddsub_ps&expand=2612)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+pub unsafe fn _mm512_mask_fmaddsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 {
+ let fmaddsub = _mm512_fmaddsub_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fmaddsub, a.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmaddsub_ps&expand=2614)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+pub unsafe fn _mm512_maskz_fmaddsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 {
+ let fmaddsub = _mm512_fmaddsub_ps(a, b, c).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, fmaddsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmaddsub_ps&expand=2613)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+pub unsafe fn _mm512_mask3_fmaddsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 {
+ let fmaddsub = _mm512_fmaddsub_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fmaddsub, c.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fmaddsub_ps&expand=2608)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+pub unsafe fn _mm256_mask_fmaddsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 {
+ let fmaddsub = _mm256_fmaddsub_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fmaddsub, a.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fmaddsub_ps&expand=2610)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+pub unsafe fn _mm256_maskz_fmaddsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 {
+ let fmaddsub = _mm256_fmaddsub_ps(a, b, c).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, fmaddsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fmaddsub_ps&expand=2609)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+pub unsafe fn _mm256_mask3_fmaddsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 {
+ let fmaddsub = _mm256_fmaddsub_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fmaddsub, c.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fmaddsub_ps&expand=2604)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+pub unsafe fn _mm_mask_fmaddsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 {
+ let fmaddsub = _mm_fmaddsub_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fmaddsub, a.as_f32x4()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/IntrinsicsGuide/#text=_mm_maskz_fmaddsub_ps&expand=2606)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+pub unsafe fn _mm_maskz_fmaddsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 {
+ let fmaddsub = _mm_fmaddsub_ps(a, b, c).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, fmaddsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fmaddsub_ps&expand=2605)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+pub unsafe fn _mm_mask3_fmaddsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 {
+ let fmaddsub = _mm_fmaddsub_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fmaddsub, c.as_f32x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmaddsub_pd&expand=2599)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+pub unsafe fn _mm512_fmaddsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ transmute(vfmaddsub213pd(
+ a.as_f64x8(),
+ b.as_f64x8(),
+ c.as_f64x8(),
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmaddsub_pd&expand=2600)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+pub unsafe fn _mm512_mask_fmaddsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d {
+ let fmaddsub = _mm512_fmaddsub_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fmaddsub, a.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmaddsub_pd&expand=2602)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+pub unsafe fn _mm512_maskz_fmaddsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ let fmaddsub = _mm512_fmaddsub_pd(a, b, c).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, fmaddsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmaddsub_ps&expand=2613)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+pub unsafe fn _mm512_mask3_fmaddsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d {
+ let fmaddsub = _mm512_fmaddsub_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fmaddsub, c.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fmaddsub_pd&expand=2596)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+pub unsafe fn _mm256_mask_fmaddsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d {
+ let fmaddsub = _mm256_fmaddsub_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fmaddsub, a.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fmaddsub_pd&expand=2598)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+pub unsafe fn _mm256_maskz_fmaddsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ let fmaddsub = _mm256_fmaddsub_pd(a, b, c).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, fmaddsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fmaddsub_pd&expand=2597)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+pub unsafe fn _mm256_mask3_fmaddsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d {
+ let fmaddsub = _mm256_fmaddsub_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fmaddsub, c.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fmaddsub_pd&expand=2592)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+pub unsafe fn _mm_mask_fmaddsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d {
+ let fmaddsub = _mm_fmaddsub_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fmaddsub, a.as_f64x2()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fmaddsub_pd&expand=2594)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+pub unsafe fn _mm_maskz_fmaddsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ let fmaddsub = _mm_fmaddsub_pd(a, b, c).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, fmaddsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fmaddsub_pd&expand=2593)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+pub unsafe fn _mm_mask3_fmaddsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d {
+ let fmaddsub = _mm_fmaddsub_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fmaddsub, c.as_f64x2()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmsubadd_ps&expand=2691)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+pub unsafe fn _mm512_fmsubadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 {
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f32x16());
+ transmute(vfmaddsub213ps(
+ a.as_f32x16(),
+ b.as_f32x16(),
+ sub,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmsubadd_ps&expand=2692)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+pub unsafe fn _mm512_mask_fmsubadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 {
+ let fmsubadd = _mm512_fmsubadd_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fmsubadd, a.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmsubadd_ps&expand=2694)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+pub unsafe fn _mm512_maskz_fmsubadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 {
+ let fmsubadd = _mm512_fmsubadd_ps(a, b, c).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, fmsubadd, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmsubadd_ps&expand=2693)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+pub unsafe fn _mm512_mask3_fmsubadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 {
+ let fmsubadd = _mm512_fmsubadd_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fmsubadd, c.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fmsubadd_ps&expand=2688)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+pub unsafe fn _mm256_mask_fmsubadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 {
+ let fmsubadd = _mm256_fmsubadd_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fmsubadd, a.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fmsubadd_ps&expand=2690)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+pub unsafe fn _mm256_maskz_fmsubadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 {
+ let fmsubadd = _mm256_fmsubadd_ps(a, b, c).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, fmsubadd, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fmsubadd_ps&expand=2689)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+pub unsafe fn _mm256_mask3_fmsubadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 {
+ let fmsubadd = _mm256_fmsubadd_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fmsubadd, c.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fmsubadd_ps&expand=2684)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+pub unsafe fn _mm_mask_fmsubadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 {
+ let fmsubadd = _mm_fmsubadd_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fmsubadd, a.as_f32x4()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fmsubadd_ps&expand=2686)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+pub unsafe fn _mm_maskz_fmsubadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 {
+ let fmsubadd = _mm_fmsubadd_ps(a, b, c).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, fmsubadd, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fmsubadd_ps&expand=2685)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+pub unsafe fn _mm_mask3_fmsubadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 {
+ let fmsubadd = _mm_fmsubadd_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fmsubadd, c.as_f32x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmsubadd_pd&expand=2679)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+pub unsafe fn _mm512_fmsubadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f64x8());
+ transmute(vfmaddsub213pd(
+ a.as_f64x8(),
+ b.as_f64x8(),
+ sub,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmsubadd_pd&expand=2680)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+pub unsafe fn _mm512_mask_fmsubadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d {
+ let fmsubadd = _mm512_fmsubadd_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fmsubadd, a.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmsubadd_pd&expand=2682)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+pub unsafe fn _mm512_maskz_fmsubadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ let fmsubadd = _mm512_fmsubadd_pd(a, b, c).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, fmsubadd, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmsubadd_pd&expand=2681)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+pub unsafe fn _mm512_mask3_fmsubadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d {
+ let fmsubadd = _mm512_fmsubadd_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fmsubadd, c.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fmsubadd_pd&expand=2676)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+pub unsafe fn _mm256_mask_fmsubadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d {
+ let fmsubadd = _mm256_fmsubadd_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fmsubadd, a.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fmsubadd_pd&expand=2678)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+pub unsafe fn _mm256_maskz_fmsubadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ let fmsubadd = _mm256_fmsubadd_pd(a, b, c).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, fmsubadd, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fmsubadd_pd&expand=2677)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+pub unsafe fn _mm256_mask3_fmsubadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d {
+ let fmsubadd = _mm256_fmsubadd_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fmsubadd, c.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fmsubadd_pd&expand=2672)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+pub unsafe fn _mm_mask_fmsubadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d {
+ let fmsubadd = _mm_fmsubadd_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fmsubadd, a.as_f64x2()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fmsubadd_pd&expand=2674)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+pub unsafe fn _mm_maskz_fmsubadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ let fmsubadd = _mm_fmsubadd_pd(a, b, c).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, fmsubadd, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fmsubadd_pd&expand=2673)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+pub unsafe fn _mm_mask3_fmsubadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d {
+ let fmsubadd = _mm_fmsubadd_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fmsubadd, c.as_f64x2()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fnmadd_ps&expand=2723)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+pub unsafe fn _mm512_fnmadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 {
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, a.as_f32x16());
+ transmute(vfmadd132ps(sub, b.as_f32x16(), c.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fnmadd_ps&expand=2724)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+pub unsafe fn _mm512_mask_fnmadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 {
+ let fnmadd = _mm512_fnmadd_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fnmadd, a.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fnmadd_ps&expand=2726)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+pub unsafe fn _mm512_maskz_fnmadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 {
+ let fnmadd = _mm512_fnmadd_ps(a, b, c).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, fnmadd, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fnmadd_ps&expand=2725)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+pub unsafe fn _mm512_mask3_fnmadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 {
+ let fnmadd = _mm512_fnmadd_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fnmadd, c.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fnmadd_ps&expand=2720)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+pub unsafe fn _mm256_mask_fnmadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 {
+ let fnmadd = _mm256_fnmadd_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fnmadd, a.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fnmadd_ps&expand=2722)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+pub unsafe fn _mm256_maskz_fnmadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 {
+ let fnmadd = _mm256_fnmadd_ps(a, b, c).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, fnmadd, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fnmadd_ps&expand=2721)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+pub unsafe fn _mm256_mask3_fnmadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 {
+ let fnmadd = _mm256_fnmadd_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fnmadd, c.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fnmadd_ps&expand=2716)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+pub unsafe fn _mm_mask_fnmadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 {
+ let fnmadd = _mm_fnmadd_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fnmadd, a.as_f32x4()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fnmadd_ps&expand=2718)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+pub unsafe fn _mm_maskz_fnmadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 {
+ let fnmadd = _mm_fnmadd_ps(a, b, c).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, fnmadd, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fnmadd_ps&expand=2717)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+pub unsafe fn _mm_mask3_fnmadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 {
+ let fnmadd = _mm_fnmadd_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fnmadd, c.as_f32x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fnmadd_pd&expand=2711)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+pub unsafe fn _mm512_fnmadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, a.as_f64x8());
+ transmute(vfmadd132pd(sub, b.as_f64x8(), c.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fnmadd_pd&expand=2712)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+pub unsafe fn _mm512_mask_fnmadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d {
+ let fnmadd = _mm512_fnmadd_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fnmadd, a.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fnmadd_pd&expand=2714)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+pub unsafe fn _mm512_maskz_fnmadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ let fnmadd = _mm512_fnmadd_pd(a, b, c).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, fnmadd, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fnmadd_pd&expand=2713)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+pub unsafe fn _mm512_mask3_fnmadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d {
+ let fnmadd = _mm512_fnmadd_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fnmadd, c.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fnmadd_pd&expand=2708)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+pub unsafe fn _mm256_mask_fnmadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d {
+ let fnmadd = _mm256_fnmadd_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fnmadd, a.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fnmadd_pd&expand=2710)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+pub unsafe fn _mm256_maskz_fnmadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ let fnmadd = _mm256_fnmadd_pd(a, b, c).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, fnmadd, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fnmadd_pd&expand=2709)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+pub unsafe fn _mm256_mask3_fnmadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d {
+ let fnmadd = _mm256_fnmadd_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fnmadd, c.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fnmadd_pd&expand=2704)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+pub unsafe fn _mm_mask_fnmadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d {
+ let fnmadd = _mm_fnmadd_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fnmadd, a.as_f64x2()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fnmadd_pd&expand=2706)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+pub unsafe fn _mm_maskz_fnmadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ let fnmadd = _mm_fnmadd_pd(a, b, c).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, fnmadd, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fnmadd_pd&expand=2705)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+pub unsafe fn _mm_mask3_fnmadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d {
+ let fnmadd = _mm_fnmadd_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fnmadd, c.as_f64x2()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fnmsub_ps&expand=2771)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+pub unsafe fn _mm512_fnmsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 {
+ let zero: f32x16 = mem::zeroed();
+ let suba = simd_sub(zero, a.as_f32x16());
+ let subc = simd_sub(zero, c.as_f32x16());
+ transmute(vfmadd132ps(suba, b.as_f32x16(), subc))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fnmsub_ps&expand=2772)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+pub unsafe fn _mm512_mask_fnmsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 {
+ let fnmsub = _mm512_fnmsub_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fnmsub, a.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fnmsub_ps&expand=2774)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+pub unsafe fn _mm512_maskz_fnmsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 {
+ let fnmsub = _mm512_fnmsub_ps(a, b, c).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, fnmsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fnmsub_ps&expand=2773)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+pub unsafe fn _mm512_mask3_fnmsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 {
+ let fnmsub = _mm512_fnmsub_ps(a, b, c).as_f32x16();
+ transmute(simd_select_bitmask(k, fnmsub, c.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fnmsub_ps&expand=2768)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+pub unsafe fn _mm256_mask_fnmsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 {
+ let fnmsub = _mm256_fnmsub_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fnmsub, a.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fnmsub_ps&expand=2770)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+pub unsafe fn _mm256_maskz_fnmsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 {
+ let fnmsub = _mm256_fnmsub_ps(a, b, c).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, fnmsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fnmsub_ps&expand=2769)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+pub unsafe fn _mm256_mask3_fnmsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 {
+ let fnmsub = _mm256_fnmsub_ps(a, b, c).as_f32x8();
+ transmute(simd_select_bitmask(k, fnmsub, c.as_f32x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fnmsub_ps&expand=2764)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+pub unsafe fn _mm_mask_fnmsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 {
+ let fnmsub = _mm_fnmsub_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fnmsub, a.as_f32x4()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fnmsub_ps&expand=2766)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+pub unsafe fn _mm_maskz_fnmsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 {
+ let fnmsub = _mm_fnmsub_ps(a, b, c).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, fnmsub, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fnmsub_ps&expand=2765)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+pub unsafe fn _mm_mask3_fnmsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 {
+ let fnmsub = _mm_fnmsub_ps(a, b, c).as_f32x4();
+ transmute(simd_select_bitmask(k, fnmsub, c.as_f32x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fnmsub_pd&expand=2759)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+pub unsafe fn _mm512_fnmsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ let zero: f64x8 = mem::zeroed();
+ let suba = simd_sub(zero, a.as_f64x8());
+ let subc = simd_sub(zero, c.as_f64x8());
+ transmute(vfmadd132pd(suba, b.as_f64x8(), subc))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fnmsub_pd&expand=2760)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+pub unsafe fn _mm512_mask_fnmsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d {
+ let fnmsub = _mm512_fnmsub_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fnmsub, a.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fnmsub_pd&expand=2762)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+pub unsafe fn _mm512_maskz_fnmsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d {
+ let fnmsub = _mm512_fnmsub_pd(a, b, c).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, fnmsub, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fnmsub_pd&expand=2761)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+pub unsafe fn _mm512_mask3_fnmsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d {
+ let fnmsub = _mm512_fnmsub_pd(a, b, c).as_f64x8();
+ transmute(simd_select_bitmask(k, fnmsub, c.as_f64x8()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fnmsub_pd&expand=2756)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+pub unsafe fn _mm256_mask_fnmsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d {
+ let fnmsub = _mm256_fnmsub_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fnmsub, a.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fnmsub_pd&expand=2758)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+pub unsafe fn _mm256_maskz_fnmsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ let fnmsub = _mm256_fnmsub_pd(a, b, c).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, fnmsub, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask3_fnmsub_pd&expand=2757)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+pub unsafe fn _mm256_mask3_fnmsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d {
+ let fnmsub = _mm256_fnmsub_pd(a, b, c).as_f64x4();
+ transmute(simd_select_bitmask(k, fnmsub, c.as_f64x4()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fnmsub_pd&expand=2752)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+pub unsafe fn _mm_mask_fnmsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d {
+ let fnmsub = _mm_fnmsub_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fnmsub, a.as_f64x2()))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fnmsub_pd&expand=2754)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+pub unsafe fn _mm_maskz_fnmsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ let fnmsub = _mm_fnmsub_pd(a, b, c).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, fnmsub, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask3_fnmsub_pd&expand=2753)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+pub unsafe fn _mm_mask3_fnmsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d {
+ let fnmsub = _mm_fnmsub_pd(a, b, c).as_f64x2();
+ transmute(simd_select_bitmask(k, fnmsub, c.as_f64x2()))
+}
+
+/// Compute the approximate reciprocal of packed single-precision (32-bit) floating-point elements in a, and store the results in dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_rcp14_ps&expand=4502)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14ps))]
+pub unsafe fn _mm512_rcp14_ps(a: __m512) -> __m512 {
+ transmute(vrcp14ps(
+ a.as_f32x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ 0b11111111_11111111,
+ ))
+}
+
+/// Compute the approximate reciprocal of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_rcp14_ps&expand=4500)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14ps))]
+pub unsafe fn _mm512_mask_rcp14_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 {
+ transmute(vrcp14ps(a.as_f32x16(), src.as_f32x16(), k))
+}
+
+/// Compute the approximate reciprocal of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_rcp14_ps&expand=4501)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14ps))]
+pub unsafe fn _mm512_maskz_rcp14_ps(k: __mmask16, a: __m512) -> __m512 {
+ transmute(vrcp14ps(a.as_f32x16(), _mm512_setzero_ps().as_f32x16(), k))
+}
+
+/// Compute the approximate reciprocal of packed single-precision (32-bit) floating-point elements in a, and store the results in dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_rcp14_ps&expand=4499)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14ps))]
+pub unsafe fn _mm256_rcp14_ps(a: __m256) -> __m256 {
+ transmute(vrcp14ps256(
+ a.as_f32x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ 0b11111111,
+ ))
+}
+
+/// Compute the approximate reciprocal of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_rcp14_ps&expand=4497)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14ps))]
+pub unsafe fn _mm256_mask_rcp14_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 {
+ transmute(vrcp14ps256(a.as_f32x8(), src.as_f32x8(), k))
+}
+
+/// Compute the approximate reciprocal of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_rcp14_ps&expand=4498)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14ps))]
+pub unsafe fn _mm256_maskz_rcp14_ps(k: __mmask8, a: __m256) -> __m256 {
+ transmute(vrcp14ps256(a.as_f32x8(), _mm256_setzero_ps().as_f32x8(), k))
+}
+
+/// Compute the approximate reciprocal of packed single-precision (32-bit) floating-point elements in a, and store the results in dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rcp14_ps&expand=4496)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14ps))]
+pub unsafe fn _mm_rcp14_ps(a: __m128) -> __m128 {
+ transmute(vrcp14ps128(
+ a.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ 0b00001111,
+ ))
+}
+
+/// Compute the approximate reciprocal of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_rcp14_ps&expand=4494)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14ps))]
+pub unsafe fn _mm_mask_rcp14_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ transmute(vrcp14ps128(a.as_f32x4(), src.as_f32x4(), k))
+}
+
+/// Compute the approximate reciprocal of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_rcp14_ps&expand=4495)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14ps))]
+pub unsafe fn _mm_maskz_rcp14_ps(k: __mmask8, a: __m128) -> __m128 {
+ transmute(vrcp14ps128(a.as_f32x4(), _mm_setzero_ps().as_f32x4(), k))
+}
+
+/// Compute the approximate reciprocal of packed double-precision (64-bit) floating-point elements in a, and store the results in dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_rcp14_pd&expand=4493)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14pd))]
+pub unsafe fn _mm512_rcp14_pd(a: __m512d) -> __m512d {
+ transmute(vrcp14pd(
+ a.as_f64x8(),
+ _mm512_setzero_pd().as_f64x8(),
+ 0b11111111,
+ ))
+}
+
+/// Compute the approximate reciprocal of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_rcp14_pd&expand=4491)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14pd))]
+pub unsafe fn _mm512_mask_rcp14_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d {
+ transmute(vrcp14pd(a.as_f64x8(), src.as_f64x8(), k))
+}
+
+/// Compute the approximate reciprocal of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_rcp14_pd&expand=4492)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14pd))]
+pub unsafe fn _mm512_maskz_rcp14_pd(k: __mmask8, a: __m512d) -> __m512d {
+ transmute(vrcp14pd(a.as_f64x8(), _mm512_setzero_pd().as_f64x8(), k))
+}
+
+/// Compute the approximate reciprocal of packed double-precision (64-bit) floating-point elements in a, and store the results in dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_rcp14_pd&expand=4490)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14pd))]
+pub unsafe fn _mm256_rcp14_pd(a: __m256d) -> __m256d {
+ transmute(vrcp14pd256(
+ a.as_f64x4(),
+ _mm256_setzero_pd().as_f64x4(),
+ 0b00001111,
+ ))
+}
+
+/// Compute the approximate reciprocal of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_rcp14_pd&expand=4488)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14pd))]
+pub unsafe fn _mm256_mask_rcp14_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d {
+ transmute(vrcp14pd256(a.as_f64x4(), src.as_f64x4(), k))
+}
+
+/// Compute the approximate reciprocal of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_rcp14_pd&expand=4489)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14pd))]
+pub unsafe fn _mm256_maskz_rcp14_pd(k: __mmask8, a: __m256d) -> __m256d {
+ transmute(vrcp14pd256(a.as_f64x4(), _mm256_setzero_pd().as_f64x4(), k))
+}
+
+/// Compute the approximate reciprocal of packed double-precision (64-bit) floating-point elements in a, and store the results in dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rcp14_pd&expand=4487)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14pd))]
+pub unsafe fn _mm_rcp14_pd(a: __m128d) -> __m128d {
+ transmute(vrcp14pd128(
+ a.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ 0b00000011,
+ ))
+}
+
+/// Compute the approximate reciprocal of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_rcp14_pd&expand=4485)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14pd))]
+pub unsafe fn _mm_mask_rcp14_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d {
+ transmute(vrcp14pd128(a.as_f64x2(), src.as_f64x2(), k))
+}
+
+/// Compute the approximate reciprocal of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_rcp14_pd&expand=4486)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrcp14pd))]
+pub unsafe fn _mm_maskz_rcp14_pd(k: __mmask8, a: __m128d) -> __m128d {
+ transmute(vrcp14pd128(a.as_f64x2(), _mm_setzero_pd().as_f64x2(), k))
+}
+
+/// Compute the approximate reciprocal square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_rsqrt14_ps&expand=4819)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14ps))]
+pub unsafe fn _mm512_rsqrt14_ps(a: __m512) -> __m512 {
+ transmute(vrsqrt14ps(
+ a.as_f32x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ 0b11111111_11111111,
+ ))
+}
+
+/// Compute the approximate reciprocal square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_rsqrt14_ps&expand=4817)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14ps))]
+pub unsafe fn _mm512_mask_rsqrt14_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 {
+ transmute(vrsqrt14ps(a.as_f32x16(), src.as_f32x16(), k))
+}
+
+/// Compute the approximate reciprocal square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_rsqrt14_ps&expand=4818)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14ps))]
+pub unsafe fn _mm512_maskz_rsqrt14_ps(k: __mmask16, a: __m512) -> __m512 {
+ transmute(vrsqrt14ps(
+ a.as_f32x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ k,
+ ))
+}
+
+/// Compute the approximate reciprocal square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_rsqrt14_ps&expand=4815)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrsqrt14ps))]
+pub unsafe fn _mm256_mask_rsqrt14_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 {
+ transmute(vrsqrt14ps256(a.as_f32x8(), src.as_f32x8(), k))
+}
+
+/// Compute the approximate reciprocal square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_rsqrt14_ps&expand=4816)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrsqrt14ps))]
+pub unsafe fn _mm256_maskz_rsqrt14_ps(k: __mmask8, a: __m256) -> __m256 {
+ transmute(vrsqrt14ps256(
+ a.as_f32x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ k,
+ ))
+}
+
+/// Compute the approximate reciprocal square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_rsqrt14_ps&expand=4813)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrsqrt14ps))]
+pub unsafe fn _mm_mask_rsqrt14_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ transmute(vrsqrt14ps128(a.as_f32x4(), src.as_f32x4(), k))
+}
+
+/// Compute the approximate reciprocal square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_rsqrt14_ps&expand=4814)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrsqrt14ps))]
+pub unsafe fn _mm_maskz_rsqrt14_ps(k: __mmask8, a: __m128) -> __m128 {
+ transmute(vrsqrt14ps128(a.as_f32x4(), _mm_setzero_ps().as_f32x4(), k))
+}
+
+/// Compute the approximate reciprocal square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_rsqrt14_pd&expand=4812)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14pd))]
+pub unsafe fn _mm512_rsqrt14_pd(a: __m512d) -> __m512d {
+ transmute(vrsqrt14pd(
+ a.as_f64x8(),
+ _mm512_setzero_pd().as_f64x8(),
+ 0b11111111,
+ ))
+}
+
+/// Compute the approximate reciprocal square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_rsqrt14_pd&expand=4810)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14pd))]
+pub unsafe fn _mm512_mask_rsqrt14_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d {
+ transmute(vrsqrt14pd(a.as_f64x8(), src.as_f64x8(), k))
+}
+
+/// Compute the approximate reciprocal square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_rsqrt14_pd&expand=4811)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14pd))]
+pub unsafe fn _mm512_maskz_rsqrt14_pd(k: __mmask8, a: __m512d) -> __m512d {
+ transmute(vrsqrt14pd(a.as_f64x8(), _mm512_setzero_pd().as_f64x8(), k))
+}
+
+/// Compute the approximate reciprocal square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_rsqrt14_pd&expand=4808)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrsqrt14pd))]
+pub unsafe fn _mm256_mask_rsqrt14_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d {
+ transmute(vrsqrt14pd256(a.as_f64x4(), src.as_f64x4(), k))
+}
+
+/// Compute the approximate reciprocal square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_rsqrt14_pd&expand=4809)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrsqrt14pd))]
+pub unsafe fn _mm256_maskz_rsqrt14_pd(k: __mmask8, a: __m256d) -> __m256d {
+ transmute(vrsqrt14pd256(
+ a.as_f64x4(),
+ _mm256_setzero_pd().as_f64x4(),
+ k,
+ ))
+}
+
+/// Compute the approximate reciprocal square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_rsqrt14_pd&expand=4806)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrsqrt14pd))]
+pub unsafe fn _mm_mask_rsqrt14_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d {
+ transmute(vrsqrt14pd128(a.as_f64x2(), src.as_f64x2(), k))
+}
+
+/// Compute the approximate reciprocal square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_rsqrt14_pd&expand=4807)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrsqrt14pd))]
+pub unsafe fn _mm_maskz_rsqrt14_pd(k: __mmask8, a: __m128d) -> __m128d {
+ transmute(vrsqrt14pd128(a.as_f64x2(), _mm_setzero_pd().as_f64x2(), k))
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst. This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_getexp_ps&expand=2844)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpps))]
+pub unsafe fn _mm512_getexp_ps(a: __m512) -> __m512 {
+ transmute(vgetexpps(
+ a.as_f32x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ 0b11111111_11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_getexp_ps&expand=2845)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpps))]
+pub unsafe fn _mm512_mask_getexp_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 {
+ transmute(vgetexpps(
+ a.as_f32x16(),
+ src.as_f32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_getexp_ps&expand=2846)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpps))]
+pub unsafe fn _mm512_maskz_getexp_ps(k: __mmask16, a: __m512) -> __m512 {
+ transmute(vgetexpps(
+ a.as_f32x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst. This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_getexp_ps&expand=2841)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexpps))]
+pub unsafe fn _mm256_getexp_ps(a: __m256) -> __m256 {
+ transmute(vgetexpps256(
+ a.as_f32x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_getexp_ps&expand=2842)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexpps))]
+pub unsafe fn _mm256_mask_getexp_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 {
+ transmute(vgetexpps256(a.as_f32x8(), src.as_f32x8(), k))
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_getexp_ps&expand=2843)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexpps))]
+pub unsafe fn _mm256_maskz_getexp_ps(k: __mmask8, a: __m256) -> __m256 {
+ transmute(vgetexpps256(
+ a.as_f32x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ k,
+ ))
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst. This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_getexp_ps&expand=2838)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexpps))]
+pub unsafe fn _mm_getexp_ps(a: __m128) -> __m128 {
+ transmute(vgetexpps128(
+ a.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ 0b00001111,
+ ))
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_getexp_ps&expand=2839)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexpps))]
+pub unsafe fn _mm_mask_getexp_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ transmute(vgetexpps128(a.as_f32x4(), src.as_f32x4(), k))
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_getexp_ps&expand=2840)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexpps))]
+pub unsafe fn _mm_maskz_getexp_ps(k: __mmask8, a: __m128) -> __m128 {
+ transmute(vgetexpps128(a.as_f32x4(), _mm_setzero_ps().as_f32x4(), k))
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst. This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_getexp_pd&expand=2835)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexppd))]
+pub unsafe fn _mm512_getexp_pd(a: __m512d) -> __m512d {
+ transmute(vgetexppd(
+ a.as_f64x8(),
+ _mm512_setzero_pd().as_f64x8(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_getexp_pd&expand=2836)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexppd))]
+pub unsafe fn _mm512_mask_getexp_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d {
+ transmute(vgetexppd(
+ a.as_f64x8(),
+ src.as_f64x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_getexp_pd&expand=2837)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexppd))]
+pub unsafe fn _mm512_maskz_getexp_pd(k: __mmask8, a: __m512d) -> __m512d {
+ transmute(vgetexppd(
+ a.as_f64x8(),
+ _mm512_setzero_pd().as_f64x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst. This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_getexp_pd&expand=2832)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexppd))]
+pub unsafe fn _mm256_getexp_pd(a: __m256d) -> __m256d {
+ transmute(vgetexppd256(
+ a.as_f64x4(),
+ _mm256_setzero_pd().as_f64x4(),
+ 0b00001111,
+ ))
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_getexp_pd&expand=2833)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexppd))]
+pub unsafe fn _mm256_mask_getexp_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d {
+ transmute(vgetexppd256(a.as_f64x4(), src.as_f64x4(), k))
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_getexp_pd&expand=2834)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexppd))]
+pub unsafe fn _mm256_maskz_getexp_pd(k: __mmask8, a: __m256d) -> __m256d {
+ transmute(vgetexppd256(
+ a.as_f64x4(),
+ _mm256_setzero_pd().as_f64x4(),
+ k,
+ ))
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst. This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_getexp_pd&expand=2829)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexppd))]
+pub unsafe fn _mm_getexp_pd(a: __m128d) -> __m128d {
+ transmute(vgetexppd128(
+ a.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ 0b00000011,
+ ))
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_getexp_pd&expand=2830)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexppd))]
+pub unsafe fn _mm_mask_getexp_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d {
+ transmute(vgetexppd128(a.as_f64x2(), src.as_f64x2(), k))
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_getexp_pd&expand=2831)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetexppd))]
+pub unsafe fn _mm_maskz_getexp_pd(k: __mmask8, a: __m128d) -> __m128d {
+ transmute(vgetexppd128(a.as_f64x2(), _mm_setzero_pd().as_f64x2(), k))
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_roundscale_ps&expand=4784)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 0))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_roundscale_ps<const IMM8: i32>(a: __m512) -> __m512 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vrndscaleps(a, IMM8, zero, 0b11111111_11111111, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_roundscale_ps&expand=4782)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_roundscale_ps<const IMM8: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+) -> __m512 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x16();
+ let src = src.as_f32x16();
+ let r = vrndscaleps(a, IMM8, src, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_roundscale_ps&expand=4783)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_roundscale_ps<const IMM8: i32>(k: __mmask16, a: __m512) -> __m512 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vrndscaleps(a, IMM8, zero, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_roundscale_ps&expand=4781)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 250))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_roundscale_ps<const IMM8: i32>(a: __m256) -> __m256 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ let r = vrndscaleps256(a, IMM8, zero, 0b11111111);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_roundscale_ps&expand=4779)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_roundscale_ps<const IMM8: i32>(
+ src: __m256,
+ k: __mmask8,
+ a: __m256,
+) -> __m256 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x8();
+ let src = src.as_f32x8();
+ let r = vrndscaleps256(a, IMM8, src, k);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_roundscale_ps&expand=4780)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_roundscale_ps<const IMM8: i32>(k: __mmask8, a: __m256) -> __m256 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ let r = vrndscaleps256(a, IMM8, zero, k);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_roundscale_ps&expand=4778)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 250))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_roundscale_ps<const IMM8: i32>(a: __m128) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vrndscaleps128(a, IMM8, zero, 0b00001111);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_roundscale_ps&expand=4776)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_roundscale_ps<const IMM8: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vrndscaleps128(a, IMM8, src, k);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_roundscale_ps&expand=4777)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_roundscale_ps<const IMM8: i32>(k: __mmask8, a: __m128) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vrndscaleps128(a, IMM8, zero, k);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_roundscale_pd&expand=4775)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_roundscale_pd<const IMM8: i32>(a: __m512d) -> __m512d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vrndscalepd(a, IMM8, zero, 0b11111111, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_roundscale_pd&expand=4773)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_roundscale_pd<const IMM8: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x8();
+ let src = src.as_f64x8();
+ let r = vrndscalepd(a, IMM8, src, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_roundscale_pd&expand=4774)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_roundscale_pd<const IMM8: i32>(k: __mmask8, a: __m512d) -> __m512d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vrndscalepd(a, IMM8, zero, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_roundscale_pd&expand=4772)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_roundscale_pd<const IMM8: i32>(a: __m256d) -> __m256d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ let r = vrndscalepd256(a, IMM8, zero, 0b00001111);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_roundscale_pd&expand=4770)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_roundscale_pd<const IMM8: i32>(
+ src: __m256d,
+ k: __mmask8,
+ a: __m256d,
+) -> __m256d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x4();
+ let src = src.as_f64x4();
+ let r = vrndscalepd256(a, IMM8, src, k);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_roundscale_pd&expand=4771)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_roundscale_pd<const IMM8: i32>(k: __mmask8, a: __m256d) -> __m256d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ let r = vrndscalepd256(a, IMM8, zero, k);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_roundscale_pd&expand=4769)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_roundscale_pd<const IMM8: i32>(a: __m128d) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vrndscalepd128(a, IMM8, zero, 0b00000011);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_roundscale_pd&expand=4767)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_roundscale_pd<const IMM8: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vrndscalepd128(a, IMM8, src, k);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_roundscale_pd&expand=4768)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_roundscale_pd<const IMM8: i32>(k: __mmask8, a: __m128d) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vrndscalepd128(a, IMM8, zero, k);
+ transmute(r)
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_scalef_ps&expand=4883)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefps))]
+pub unsafe fn _mm512_scalef_ps(a: __m512, b: __m512) -> __m512 {
+ transmute(vscalefps(
+ a.as_f32x16(),
+ b.as_f32x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ 0b11111111_11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_scalef_ps&expand=4881)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefps))]
+pub unsafe fn _mm512_mask_scalef_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ transmute(vscalefps(
+ a.as_f32x16(),
+ b.as_f32x16(),
+ src.as_f32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_scalef_ps&expand=4882)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefps))]
+pub unsafe fn _mm512_maskz_scalef_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ transmute(vscalefps(
+ a.as_f32x16(),
+ b.as_f32x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_scalef_ps&expand=4880)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefps))]
+pub unsafe fn _mm256_scalef_ps(a: __m256, b: __m256) -> __m256 {
+ transmute(vscalefps256(
+ a.as_f32x8(),
+ b.as_f32x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ 0b11111111,
+ ))
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_scalef_ps&expand=4878)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefps))]
+pub unsafe fn _mm256_mask_scalef_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ transmute(vscalefps256(a.as_f32x8(), b.as_f32x8(), src.as_f32x8(), k))
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_scalef_ps&expand=4879)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefps))]
+pub unsafe fn _mm256_maskz_scalef_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ transmute(vscalefps256(
+ a.as_f32x8(),
+ b.as_f32x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ k,
+ ))
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_scalef_ps&expand=4877)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefps))]
+pub unsafe fn _mm_scalef_ps(a: __m128, b: __m128) -> __m128 {
+ transmute(vscalefps128(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ 0b00001111,
+ ))
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_scalef_ps&expand=4875)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefps))]
+pub unsafe fn _mm_mask_scalef_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vscalefps128(a.as_f32x4(), b.as_f32x4(), src.as_f32x4(), k))
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_scalef_ps&expand=4876)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefps))]
+pub unsafe fn _mm_maskz_scalef_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vscalefps128(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ k,
+ ))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_scalef_pd&expand=4874)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefpd))]
+pub unsafe fn _mm512_scalef_pd(a: __m512d, b: __m512d) -> __m512d {
+ transmute(vscalefpd(
+ a.as_f64x8(),
+ b.as_f64x8(),
+ _mm512_setzero_pd().as_f64x8(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_scalef_pd&expand=4872)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefpd))]
+pub unsafe fn _mm512_mask_scalef_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ transmute(vscalefpd(
+ a.as_f64x8(),
+ b.as_f64x8(),
+ src.as_f64x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_scalef_pd&expand=4873)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefpd))]
+pub unsafe fn _mm512_maskz_scalef_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ transmute(vscalefpd(
+ a.as_f64x8(),
+ b.as_f64x8(),
+ _mm512_setzero_pd().as_f64x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_scalef_pd&expand=4871)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefpd))]
+pub unsafe fn _mm256_scalef_pd(a: __m256d, b: __m256d) -> __m256d {
+ transmute(vscalefpd256(
+ a.as_f64x4(),
+ b.as_f64x4(),
+ _mm256_setzero_pd().as_f64x4(),
+ 0b00001111,
+ ))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_scalef_pd&expand=4869)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefpd))]
+pub unsafe fn _mm256_mask_scalef_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ transmute(vscalefpd256(a.as_f64x4(), b.as_f64x4(), src.as_f64x4(), k))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_scalef_pd&expand=4870)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefpd))]
+pub unsafe fn _mm256_maskz_scalef_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ transmute(vscalefpd256(
+ a.as_f64x4(),
+ b.as_f64x4(),
+ _mm256_setzero_pd().as_f64x4(),
+ k,
+ ))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_scalef_pd&expand=4868)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefpd))]
+pub unsafe fn _mm_scalef_pd(a: __m128d, b: __m128d) -> __m128d {
+ transmute(vscalefpd128(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ 0b00000011,
+ ))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_scalef_pd&expand=4866)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefpd))]
+pub unsafe fn _mm_mask_scalef_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vscalefpd128(a.as_f64x2(), b.as_f64x2(), src.as_f64x2(), k))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_scalef_pd&expand=4867)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vscalefpd))]
+pub unsafe fn _mm_maskz_scalef_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vscalefpd128(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ k,
+ ))
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fixupimm_ps&expand=2499)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fixupimm_ps<const IMM8: i32>(a: __m512, b: __m512, c: __m512i) -> __m512 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_i32x16();
+ let r = vfixupimmps(a, b, c, IMM8, 0b11111111_11111111, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fixupimm_ps&expand=2500)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fixupimm_ps<const IMM8: i32>(
+ a: __m512,
+ k: __mmask16,
+ b: __m512,
+ c: __m512i,
+) -> __m512 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_i32x16();
+ let r = vfixupimmps(a, b, c, IMM8, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fixupimm_ps&expand=2501)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fixupimm_ps<const IMM8: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+ c: __m512i,
+) -> __m512 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_i32x16();
+ let r = vfixupimmpsz(a, b, c, IMM8, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fixupimm_ps&expand=2496)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_fixupimm_ps<const IMM8: i32>(a: __m256, b: __m256, c: __m256i) -> __m256 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x8();
+ let b = b.as_f32x8();
+ let c = c.as_i32x8();
+ let r = vfixupimmps256(a, b, c, IMM8, 0b11111111);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fixupimm_ps&expand=2497)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_fixupimm_ps<const IMM8: i32>(
+ a: __m256,
+ k: __mmask8,
+ b: __m256,
+ c: __m256i,
+) -> __m256 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x8();
+ let b = b.as_f32x8();
+ let c = c.as_i32x8();
+ let r = vfixupimmps256(a, b, c, IMM8, k);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fixupimm_ps&expand=2498)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_maskz_fixupimm_ps<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256,
+ b: __m256,
+ c: __m256i,
+) -> __m256 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x8();
+ let b = b.as_f32x8();
+ let c = c.as_i32x8();
+ let r = vfixupimmpsz256(a, b, c, IMM8, k);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fixupimm_ps&expand=2493)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fixupimm_ps<const IMM8: i32>(a: __m128, b: __m128, c: __m128i) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let c = c.as_i32x4();
+ let r = vfixupimmps128(a, b, c, IMM8, 0b00001111);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fixupimm_ps&expand=2494)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fixupimm_ps<const IMM8: i32>(
+ a: __m128,
+ k: __mmask8,
+ b: __m128,
+ c: __m128i,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let c = c.as_i32x4();
+ let r = vfixupimmps128(a, b, c, IMM8, k);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fixupimm_ps&expand=2495)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fixupimm_ps<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+ c: __m128i,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let c = c.as_i32x4();
+ let r = vfixupimmpsz128(a, b, c, IMM8, k);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fixupimm_pd&expand=2490)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fixupimm_pd<const IMM8: i32>(a: __m512d, b: __m512d, c: __m512i) -> __m512d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_i64x8();
+ let r = vfixupimmpd(a, b, c, IMM8, 0b11111111, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fixupimm_pd&expand=2491)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fixupimm_pd<const IMM8: i32>(
+ a: __m512d,
+ k: __mmask8,
+ b: __m512d,
+ c: __m512i,
+) -> __m512d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_i64x8();
+ let r = vfixupimmpd(a, b, c, IMM8, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fixupimm_pd&expand=2492)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fixupimm_pd<const IMM8: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+ c: __m512i,
+) -> __m512d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_i64x8();
+ let r = vfixupimmpdz(a, b, c, IMM8, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fixupimm_pd&expand=2487)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_fixupimm_pd<const IMM8: i32>(a: __m256d, b: __m256d, c: __m256i) -> __m256d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x4();
+ let b = b.as_f64x4();
+ let c = c.as_i64x4();
+ let r = vfixupimmpd256(a, b, c, IMM8, 0b00001111);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_fixupimm_pd&expand=2488)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_fixupimm_pd<const IMM8: i32>(
+ a: __m256d,
+ k: __mmask8,
+ b: __m256d,
+ c: __m256i,
+) -> __m256d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x4();
+ let b = b.as_f64x4();
+ let c = c.as_i64x4();
+ let r = vfixupimmpd256(a, b, c, IMM8, k);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_fixupimm_pd&expand=2489)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_maskz_fixupimm_pd<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256d,
+ b: __m256d,
+ c: __m256i,
+) -> __m256d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x4();
+ let b = b.as_f64x4();
+ let c = c.as_i64x4();
+ let r = vfixupimmpdz256(a, b, c, IMM8, k);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fixupimm_pd&expand=2484)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fixupimm_pd<const IMM8: i32>(a: __m128d, b: __m128d, c: __m128i) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let c = c.as_i64x2();
+ let r = vfixupimmpd128(a, b, c, IMM8, 0b00000011);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_fixupimm_pd&expand=2485)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fixupimm_pd<const IMM8: i32>(
+ a: __m128d,
+ k: __mmask8,
+ b: __m128d,
+ c: __m128i,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let c = c.as_i64x2();
+ let r = vfixupimmpd128(a, b, c, IMM8, k);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_fixupimm_pd&expand=2486)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fixupimm_pd<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+ c: __m128i,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let c = c.as_i64x2();
+ let r = vfixupimmpdz128(a, b, c, IMM8, k);
+ transmute(r)
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 32-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_ternarylogic_epi32&expand=5867)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpternlogd, IMM8 = 114))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_ternarylogic_epi32<const IMM8: i32>(
+ a: __m512i,
+ b: __m512i,
+ c: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ let c = c.as_i32x16();
+ let r = vpternlogd(a, b, c, IMM8);
+ transmute(r)
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 32-bit integer, the corresponding bit from src, a, and b are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using writemask k at 32-bit granularity (32-bit elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_ternarylogic_epi32&expand=5865)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpternlogd, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_ternarylogic_epi32<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let src = src.as_i32x16();
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ let r = vpternlogd(src, a, b, IMM8);
+ transmute(simd_select_bitmask(k, r, src))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 32-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using zeromask k at 32-bit granularity (32-bit elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_ternarylogic_epi32&expand=5866)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpternlogd, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_ternarylogic_epi32<const IMM8: i32>(
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+ c: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ let c = c.as_i32x16();
+ let r = vpternlogd(a, b, c, IMM8);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 32-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_ternarylogic_epi32&expand=5864)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogd, IMM8 = 114))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_ternarylogic_epi32<const IMM8: i32>(
+ a: __m256i,
+ b: __m256i,
+ c: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x8();
+ let b = b.as_i32x8();
+ let c = c.as_i32x8();
+ let r = vpternlogd256(a, b, c, IMM8);
+ transmute(r)
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 32-bit integer, the corresponding bit from src, a, and b are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using writemask k at 32-bit granularity (32-bit elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_ternarylogic_epi32&expand=5862)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogd, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_ternarylogic_epi32<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let src = src.as_i32x8();
+ let a = a.as_i32x8();
+ let b = b.as_i32x8();
+ let r = vpternlogd256(src, a, b, IMM8);
+ transmute(simd_select_bitmask(k, r, src))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 32-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using zeromask k at 32-bit granularity (32-bit elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_ternarylogic_epi32&expand=5863)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogd, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_maskz_ternarylogic_epi32<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+ c: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x8();
+ let b = b.as_i32x8();
+ let c = c.as_i32x8();
+ let r = vpternlogd256(a, b, c, IMM8);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 32-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ternarylogic_epi32&expand=5861)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogd, IMM8 = 114))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_ternarylogic_epi32<const IMM8: i32>(
+ a: __m128i,
+ b: __m128i,
+ c: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ let c = c.as_i32x4();
+ let r = vpternlogd128(a, b, c, IMM8);
+ transmute(r)
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 32-bit integer, the corresponding bit from src, a, and b are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using writemask k at 32-bit granularity (32-bit elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_ternarylogic_epi32&expand=5859)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogd, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_ternarylogic_epi32<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let src = src.as_i32x4();
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ let r = vpternlogd128(src, a, b, IMM8);
+ transmute(simd_select_bitmask(k, r, src))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 32-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using zeromask k at 32-bit granularity (32-bit elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_ternarylogic_epi32&expand=5860)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogd, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_ternarylogic_epi32<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+ c: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ let c = c.as_i32x4();
+ let r = vpternlogd128(a, b, c, IMM8);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 64-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_ternarylogic_epi64&expand=5876)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpternlogq, IMM8 = 114))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_ternarylogic_epi64<const IMM8: i32>(
+ a: __m512i,
+ b: __m512i,
+ c: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x8();
+ let b = b.as_i64x8();
+ let c = c.as_i64x8();
+ let r = vpternlogq(a, b, c, IMM8);
+ transmute(r)
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 64-bit integer, the corresponding bit from src, a, and b are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using writemask k at 64-bit granularity (64-bit elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_ternarylogic_epi64&expand=5874)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpternlogq, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_ternarylogic_epi64<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let src = src.as_i64x8();
+ let a = a.as_i64x8();
+ let b = b.as_i64x8();
+ let r = vpternlogq(src, a, b, IMM8);
+ transmute(simd_select_bitmask(k, r, src))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 64-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using zeromask k at 64-bit granularity (64-bit elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_ternarylogic_epi64&expand=5875)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpternlogq, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_ternarylogic_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+ c: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x8();
+ let b = b.as_i64x8();
+ let c = c.as_i64x8();
+ let r = vpternlogq(a, b, c, IMM8);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 64-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_ternarylogic_epi64&expand=5873)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogq, IMM8 = 114))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_ternarylogic_epi64<const IMM8: i32>(
+ a: __m256i,
+ b: __m256i,
+ c: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x4();
+ let b = b.as_i64x4();
+ let c = c.as_i64x4();
+ let r = vpternlogq256(a, b, c, IMM8);
+ transmute(r)
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 64-bit integer, the corresponding bit from src, a, and b are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using writemask k at 64-bit granularity (64-bit elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_ternarylogic_epi64&expand=5871)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogq, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_ternarylogic_epi64<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let src = src.as_i64x4();
+ let a = a.as_i64x4();
+ let b = b.as_i64x4();
+ let r = vpternlogq256(src, a, b, IMM8);
+ transmute(simd_select_bitmask(k, r, src))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 64-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using zeromask k at 64-bit granularity (64-bit elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_ternarylogic_epi64&expand=5872)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogq, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_maskz_ternarylogic_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+ c: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x4();
+ let b = b.as_i64x4();
+ let c = c.as_i64x4();
+ let r = vpternlogq256(a, b, c, IMM8);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 64-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ternarylogic_epi64&expand=5870)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogq, IMM8 = 114))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_ternarylogic_epi64<const IMM8: i32>(
+ a: __m128i,
+ b: __m128i,
+ c: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x2();
+ let b = b.as_i64x2();
+ let c = c.as_i64x2();
+ let r = vpternlogq128(a, b, c, IMM8);
+ transmute(r)
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 64-bit integer, the corresponding bit from src, a, and b are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using writemask k at 64-bit granularity (64-bit elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_ternarylogic_epi64&expand=5868)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogq, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_ternarylogic_epi64<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let src = src.as_i64x2();
+ let a = a.as_i64x2();
+ let b = b.as_i64x2();
+ let r = vpternlogq128(src, a, b, IMM8);
+ transmute(simd_select_bitmask(k, r, src))
+}
+
+/// Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in imm8. For each bit in each packed 64-bit integer, the corresponding bit from a, b, and c are used to form a 3 bit index into imm8, and the value at that bit in imm8 is written to the corresponding bit in dst using zeromask k at 64-bit granularity (64-bit elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_ternarylogic_epi64&expand=5869)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpternlogq, IMM8 = 114))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_ternarylogic_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+ c: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x2();
+ let b = b.as_i64x2();
+ let c = c.as_i64x2();
+ let r = vpternlogq128(a, b, c, IMM8);
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:
+/// _MM_MANT_NORM_1_2 // interval [1, 2)
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)
+/// The sign is determined by sc which can take the following values:
+/// _MM_MANT_SIGN_src // sign = sign(src)
+/// _MM_MANT_SIGN_zero // sign = 0
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_getmant_ps&expand=2880)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(1, 2)]
+pub unsafe fn _mm512_getmant_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ a: __m512,
+) -> __m512 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vgetmantps(
+ a,
+ SIGN << 2 | NORM,
+ zero,
+ 0b11111111_11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ );
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_getmant_ps&expand=2881)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm512_mask_getmant_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+) -> __m512 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x16();
+ let src = src.as_f32x16();
+ let r = vgetmantps(a, SIGN << 2 | NORM, src, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_getmant_ps&expand=2882)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm512_maskz_getmant_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ k: __mmask16,
+ a: __m512,
+) -> __m512 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vgetmantps(a, SIGN << 2 | NORM, zero, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:
+/// _MM_MANT_NORM_1_2 // interval [1, 2)
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)
+/// The sign is determined by sc which can take the following values:
+/// _MM_MANT_SIGN_src // sign = sign(src)
+/// _MM_MANT_SIGN_zero // sign = 0
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_getmant_ps&expand=2877)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(1, 2)]
+pub unsafe fn _mm256_getmant_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ a: __m256,
+) -> __m256 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ let r = vgetmantps256(a, SIGN << 2 | NORM, zero, 0b11111111);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_getmant_ps&expand=2878)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm256_mask_getmant_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ src: __m256,
+ k: __mmask8,
+ a: __m256,
+) -> __m256 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x8();
+ let src = src.as_f32x8();
+ let r = vgetmantps256(a, SIGN << 2 | NORM, src, k);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_getmant_ps&expand=2879)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm256_maskz_getmant_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ k: __mmask8,
+ a: __m256,
+) -> __m256 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ let r = vgetmantps256(a, SIGN << 2 | NORM, zero, k);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:
+/// _MM_MANT_NORM_1_2 // interval [1, 2)
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)
+/// The sign is determined by sc which can take the following values:
+/// _MM_MANT_SIGN_src // sign = sign(src)
+/// _MM_MANT_SIGN_zero // sign = 0
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_getmant_ps&expand=2874)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(1, 2)]
+pub unsafe fn _mm_getmant_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ a: __m128,
+) -> __m128 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vgetmantps128(a, SIGN << 2 | NORM, zero, 0b00001111);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_getmant_ps&expand=2875)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm_mask_getmant_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+) -> __m128 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vgetmantps128(a, SIGN << 2 | NORM, src, k);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_getmant_ps&expand=2876)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm_maskz_getmant_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ k: __mmask8,
+ a: __m128,
+) -> __m128 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vgetmantps128(a, SIGN << 2 | NORM, zero, k);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_getmant_pd&expand=2871)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(1, 2)]
+pub unsafe fn _mm512_getmant_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ a: __m512d,
+) -> __m512d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vgetmantpd(
+ a,
+ SIGN << 2 | NORM,
+ zero,
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ );
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_getmant_pd&expand=2872)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm512_mask_getmant_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x8();
+ let src = src.as_f64x8();
+ let r = vgetmantpd(a, SIGN << 2 | NORM, src, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_getmant_pd&expand=2873)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm512_maskz_getmant_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vgetmantpd(a, SIGN << 2 | NORM, zero, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_getmant_pd&expand=2868)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(1, 2)]
+pub unsafe fn _mm256_getmant_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ a: __m256d,
+) -> __m256d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ let r = vgetmantpd256(a, SIGN << 2 | NORM, zero, 0b00001111);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_getmant_pd&expand=2869)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm256_mask_getmant_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ src: __m256d,
+ k: __mmask8,
+ a: __m256d,
+) -> __m256d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x4();
+ let src = src.as_f64x4();
+ let r = vgetmantpd256(a, SIGN << 2 | NORM, src, k);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_getmant_pd&expand=2870)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm256_maskz_getmant_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ k: __mmask8,
+ a: __m256d,
+) -> __m256d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ let r = vgetmantpd256(a, SIGN << 2 | NORM, zero, k);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_getmant_pd&expand=2865)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(1, 2)]
+pub unsafe fn _mm_getmant_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ a: __m128d,
+) -> __m128d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vgetmantpd128(a, SIGN << 2 | NORM, zero, 0b00000011);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_getmant_pd&expand=2866)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm_mask_getmant_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+) -> __m128d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vgetmantpd128(a, SIGN << 2 | NORM, src, k);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_getmant_pd&expand=2867)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm_maskz_getmant_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ k: __mmask8,
+ a: __m128d,
+) -> __m128d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vgetmantpd128(a, SIGN << 2 | NORM, zero, k);
+ transmute(r)
+}
+
+/// Add packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_add_round_ps&expand=145)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_add_round_ps<const ROUNDING: i32>(a: __m512, b: __m512) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vaddps(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Add packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_add_round_ps&expand=146)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_add_round_ps<const ROUNDING: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vaddps(a, b, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f32x16()))
+}
+
+/// Add packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_add_round_ps&expand=147)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_add_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vaddps(a, b, ROUNDING);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Add packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_add_round_pd&expand=142)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_add_round_pd<const ROUNDING: i32>(a: __m512d, b: __m512d) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vaddpd(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Add packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_add_round_pd&expand=143)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_add_round_pd<const ROUNDING: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vaddpd(a, b, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f64x8()))
+}
+
+/// Add packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_add_round_pd&expand=144)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_add_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vaddpd(a, b, ROUNDING);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Subtract packed single-precision (32-bit) floating-point elements in b from packed single-precision (32-bit) floating-point elements in a, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sub_round_ps&expand=5739)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_sub_round_ps<const ROUNDING: i32>(a: __m512, b: __m512) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vsubps(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Subtract packed single-precision (32-bit) floating-point elements in b from packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sub_round_ps&expand=5737)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_sub_round_ps<const ROUNDING: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vsubps(a, b, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f32x16()))
+}
+
+/// Subtract packed single-precision (32-bit) floating-point elements in b from packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sub_round_ps&expand=5738)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_sub_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vsubps(a, b, ROUNDING);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in b from packed double-precision (64-bit) floating-point elements in a, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sub_round_pd&expand=5736)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_sub_round_pd<const ROUNDING: i32>(a: __m512d, b: __m512d) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vsubpd(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in b from packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sub_round_pd&expand=5734)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_sub_round_pd<const ROUNDING: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vsubpd(a, b, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f64x8()))
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in b from packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sub_round_pd&expand=5735)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_sub_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vsubpd(a, b, ROUNDING);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mul_round_ps&expand=3940)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_mul_round_ps<const ROUNDING: i32>(a: __m512, b: __m512) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vmulps(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mul_round_ps&expand=3938)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_mul_round_ps<const ROUNDING: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vmulps(a, b, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mul_round_ps&expand=3939)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_mul_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vmulps(a, b, ROUNDING);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mul_round_pd&expand=3937)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_mul_round_pd<const ROUNDING: i32>(a: __m512d, b: __m512d) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vmulpd(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_mul_round_pd&expand=3935)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_mul_round_pd<const ROUNDING: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vmulpd(a, b, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f64x8()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_mul_round_ps&expand=3939)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_mul_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vmulpd(a, b, ROUNDING);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Divide packed single-precision (32-bit) floating-point elements in a by packed elements in b, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_div_round_ps&expand=2168)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_div_round_ps<const ROUNDING: i32>(a: __m512, b: __m512) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vdivps(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Divide packed single-precision (32-bit) floating-point elements in a by packed elements in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_div_round_ps&expand=2169)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_div_round_ps<const ROUNDING: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vdivps(a, b, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f32x16()))
+}
+
+/// Divide packed single-precision (32-bit) floating-point elements in a by packed elements in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_div_round_ps&expand=2170)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_div_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vdivps(a, b, ROUNDING);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in a by packed elements in b, =and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_div_round_pd&expand=2165)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_div_round_pd<const ROUNDING: i32>(a: __m512d, b: __m512d) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vdivpd(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in a by packed elements in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_div_round_pd&expand=2166)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_div_round_pd<const ROUNDING: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vdivpd(a, b, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f64x8()))
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in a by packed elements in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_div_round_pd&expand=2167)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_div_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vdivpd(a, b, ROUNDING);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Compute the square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sqrt_round_ps&expand=5377)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_sqrt_round_ps<const ROUNDING: i32>(a: __m512) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let r = vsqrtps(a, ROUNDING);
+ transmute(r)
+}
+
+/// Compute the square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sqrt_round_ps&expand=5375)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_sqrt_round_ps<const ROUNDING: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let r = vsqrtps(a, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f32x16()))
+}
+
+/// Compute the square root of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sqrt_round_ps&expand=5376)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_sqrt_round_ps<const ROUNDING: i32>(k: __mmask16, a: __m512) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let r = vsqrtps(a, ROUNDING);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Compute the square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sqrt_round_pd&expand=5374)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_sqrt_round_pd<const ROUNDING: i32>(a: __m512d) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let r = vsqrtpd(a, ROUNDING);
+ transmute(r)
+}
+
+/// Compute the square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sqrt_round_pd&expand=5372)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_sqrt_round_pd<const ROUNDING: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let r = vsqrtpd(a, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f64x8()))
+}
+
+/// Compute the square root of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sqrt_round_pd&expand=5373)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_sqrt_round_pd<const ROUNDING: i32>(k: __mmask8, a: __m512d) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let r = vsqrtpd(a, ROUNDING);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmadd_round_ps&expand=2565)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fmadd_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmadd132psround(a, b, c, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmadd_round_ps&expand=2566)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fmadd_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ k: __mmask16,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmadd132psround(a, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in a using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmadd_round_ps&expand=2568)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fmadd_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmadd132psround(a, b, c, ROUNDING);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmadd_round_ps&expand=2567)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmadd132ps or vfmadd213ps or vfmadd231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fmadd_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+ k: __mmask16,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmadd132psround(a, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmadd_round_pd&expand=2561)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fmadd_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmadd132pdround(a, b, c, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmadd_round_pd&expand=2562)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fmadd_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ k: __mmask8,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmadd132pdround(a, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmadd_round_pd&expand=2564)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fmadd_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmadd132pdround(a, b, c, ROUNDING);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmadd_round_pd&expand=2563)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmadd132pd or vfmadd213pd or vfmadd231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fmadd_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+ k: __mmask8,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmadd132pdround(a, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmsub_round_ps&expand=2651)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generates vfmadd, gcc generates vfmsub
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fmsub_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f32x16());
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vfmadd132psround(a, b, sub, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmsub_round_ps&expand=2652)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generates vfmadd, gcc generates vfmsub
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fmsub_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ k: __mmask16,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f32x16());
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vfmadd132psround(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmsub_round_ps&expand=2654)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generates vfmadd, gcc generates vfmsub
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fmsub_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f32x16());
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vfmadd132psround(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmsub_round_ps&expand=2653)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generates vfmadd, gcc generates vfmsub
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fmsub_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+ k: __mmask16,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let c = c.as_f32x16();
+ let sub = simd_sub(zero, c);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vfmadd132psround(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmsub_round_pd&expand=2647)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang generates fmadd, gcc generates fmsub
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fmsub_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f64x8());
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vfmadd132pdround(a, b, sub, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmsub_round_pd&expand=2648)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang generates fmadd, gcc generates fmsub
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fmsub_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ k: __mmask8,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f64x8());
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vfmadd132pdround(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmsub_round_pd&expand=2650)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang generates fmadd, gcc generates fmsub
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fmsub_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f64x8());
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vfmadd132pdround(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmsub_round_pd&expand=2649)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang generates fmadd, gcc generates fmsub
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fmsub_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+ k: __mmask8,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let c = c.as_f64x8();
+ let sub = simd_sub(zero, c);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vfmadd132pdround(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmaddsub_round_ps&expand=2619)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fmaddsub_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmaddsub213ps(a, b, c, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmaddsub_round_ps&expand=2620)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fmaddsub_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ k: __mmask16,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmaddsub213ps(a, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmaddsub_round_ps&expand=2622)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fmaddsub_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmaddsub213ps(a, b, c, ROUNDING);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmaddsub_round_ps&expand=2621)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fmaddsub_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+ k: __mmask16,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmaddsub213ps(a, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmaddsub_round_pd&expand=2615)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fmaddsub_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmaddsub213pd(a, b, c, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmaddsub_round_pd&expand=2616)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fmaddsub_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ k: __mmask8,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmaddsub213pd(a, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmaddsub_round_pd&expand=2618)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fmaddsub_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmaddsub213pd(a, b, c, ROUNDING);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmaddsub_round_pd&expand=2617)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fmaddsub_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+ k: __mmask8,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmaddsub213pd(a, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmsubadd_round_ps&expand=2699)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fmsubadd_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f32x16());
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vfmaddsub213ps(a, b, sub, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmsubadd_round_ps&expand=2700)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fmsubadd_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ k: __mmask16,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f32x16());
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vfmaddsub213ps(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmsubadd_round_ps&expand=2702)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fmsubadd_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f32x16());
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vfmaddsub213ps(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmsubadd_round_ps&expand=2701)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fmsubadd_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+ k: __mmask16,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let c = c.as_f32x16();
+ let sub = simd_sub(zero, c);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vfmaddsub213ps(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fmsubadd_round_pd&expand=2695)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fmsubadd_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f64x8());
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vfmaddsub213pd(a, b, sub, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fmsubadd_round_pd&expand=2696)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fmsubadd_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ k: __mmask8,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f64x8());
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vfmaddsub213pd(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively add and subtract packed elements in c to/from the intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fmsubadd_round_pd&expand=2698)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fmsubadd_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, c.as_f64x8());
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vfmaddsub213pd(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, alternatively subtract and add packed elements in c from/to the intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fmsubadd_round_pd&expand=2697)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fmsubadd_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+ k: __mmask8,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let c = c.as_f64x8();
+ let sub = simd_sub(zero, c);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vfmaddsub213pd(a, b, sub, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fnmadd_round_ps&expand=2731)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fnmadd_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, a.as_f32x16());
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmadd132psround(sub, b, c, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fnmadd_round_ps&expand=2732)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fnmadd_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ k: __mmask16,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, a.as_f32x16());
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmadd132psround(sub, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a.as_f32x16()))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fnmadd_round_ps&expand=2734)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fnmadd_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, a.as_f32x16());
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmadd132psround(sub, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fnmadd_round_ps&expand=2733)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fnmadd_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+ k: __mmask16,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let sub = simd_sub(zero, a.as_f32x16());
+ let b = b.as_f32x16();
+ let c = c.as_f32x16();
+ let r = vfmadd132psround(sub, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fnmadd_pd&expand=2711)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fnmadd_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, a.as_f64x8());
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmadd132pdround(sub, b, c, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fnmadd_round_pd&expand=2728)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fnmadd_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ k: __mmask8,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let a = a.as_f64x8();
+ let sub = simd_sub(zero, a);
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmadd132pdround(sub, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fnmadd_round_pd&expand=2730)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fnmadd_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, a.as_f64x8());
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmadd132pdround(sub, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, add the negated intermediate result to packed elements in c, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fnmadd_round_pd&expand=2729)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fnmadd_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+ k: __mmask8,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let sub = simd_sub(zero, a.as_f64x8());
+ let b = b.as_f64x8();
+ let c = c.as_f64x8();
+ let r = vfmadd132pdround(sub, b, c, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fnmsub_round_ps&expand=2779)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fnmsub_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let suba = simd_sub(zero, a.as_f32x16());
+ let subc = simd_sub(zero, c.as_f32x16());
+ let b = b.as_f32x16();
+ let r = vfmadd132psround(suba, b, subc, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fnmsub_round_ps&expand=2780)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fnmsub_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ k: __mmask16,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let a = a.as_f32x16();
+ let suba = simd_sub(zero, a);
+ let subc = simd_sub(zero, c.as_f32x16());
+ let b = b.as_f32x16();
+ let r = vfmadd132psround(suba, b, subc, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fnmsub_round_ps&expand=2782)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fnmsub_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+ c: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let suba = simd_sub(zero, a.as_f32x16());
+ let subc = simd_sub(zero, c.as_f32x16());
+ let b = b.as_f32x16();
+ let r = vfmadd132psround(suba, b, subc, ROUNDING);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed single-precision (32-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fnmsub_round_ps&expand=2781)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fnmsub_round_ps<const ROUNDING: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512,
+ k: __mmask16,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let zero: f32x16 = mem::zeroed();
+ let suba = simd_sub(zero, a.as_f32x16());
+ let c = c.as_f32x16();
+ let subc = simd_sub(zero, c);
+ let b = b.as_f32x16();
+ let r = vfmadd132psround(suba, b, subc, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fnmsub_round_pd&expand=2775)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_fnmsub_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let suba = simd_sub(zero, a.as_f64x8());
+ let subc = simd_sub(zero, c.as_f64x8());
+ let b = b.as_f64x8();
+ let r = vfmadd132pdround(suba, b, subc, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fnmsub_round_pd&expand=2776)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_fnmsub_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ k: __mmask8,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let a = a.as_f64x8();
+ let suba = simd_sub(zero, a);
+ let subc = simd_sub(zero, c.as_f64x8());
+ let b = b.as_f64x8();
+ let r = vfmadd132pdround(suba, b, subc, ROUNDING);
+ transmute(simd_select_bitmask(k, r, a))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fnmsub_round_pd&expand=2778)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_maskz_fnmsub_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let suba = simd_sub(zero, a.as_f64x8());
+ let subc = simd_sub(zero, c.as_f64x8());
+ let b = b.as_f64x8();
+ let r = vfmadd132pdround(suba, b, subc, ROUNDING);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Multiply packed double-precision (64-bit) floating-point elements in a and b, subtract packed elements in c from the negated intermediate result, and store the results in dst using writemask k (elements are copied from c when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask3_fnmsub_round_pd&expand=2777)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask3_fnmsub_round_pd<const ROUNDING: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512d,
+ k: __mmask8,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let zero: f64x8 = mem::zeroed();
+ let suba = simd_sub(zero, a.as_f64x8());
+ let c = c.as_f64x8();
+ let subc = simd_sub(zero, c);
+ let b = b.as_f64x8();
+ let r = vfmadd132pdround(suba, b, subc, ROUNDING);
+ transmute(simd_select_bitmask(k, r, c))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed maximum values in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_round_ps&expand=3662)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxps, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_max_round_ps<const SAE: i32>(a: __m512, b: __m512) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vmaxps(a, b, SAE);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_round_ps&expand=3660)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxps, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_max_round_ps<const SAE: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vmaxps(a, b, SAE);
+ transmute(simd_select_bitmask(k, r, src.as_f32x16()))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_round_ps&expand=3661)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxps, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_max_round_ps<const SAE: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vmaxps(a, b, SAE);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed maximum values in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_max_round_pd&expand=3659)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxpd, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_max_round_pd<const SAE: i32>(a: __m512d, b: __m512d) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vmaxpd(a, b, SAE);
+ transmute(r)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_max_round_pd&expand=3657)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxpd, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_max_round_pd<const SAE: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vmaxpd(a, b, SAE);
+ transmute(simd_select_bitmask(k, r, src.as_f64x8()))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed maximum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_max_round_pd&expand=3658)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxpd, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_max_round_pd<const SAE: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vmaxpd(a, b, SAE);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed minimum values in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_round_ps&expand=3776)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminps, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_min_round_ps<const SAE: i32>(a: __m512, b: __m512) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vminps(a, b, SAE);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_round_ps&expand=3774)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminps, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_min_round_ps<const SAE: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vminps(a, b, SAE);
+ transmute(simd_select_bitmask(k, r, src.as_f32x16()))
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_min_round_ps&expand=3775)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminps, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_min_round_ps<const SAE: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vminps(a, b, SAE);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_min_round_pd&expand=3773)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminpd, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_min_round_pd<const SAE: i32>(a: __m512d, b: __m512d) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vminpd(a, b, SAE);
+ transmute(r)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_min_round_pd&expand=3771)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminpd, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_min_round_pd<const SAE: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vminpd(a, b, SAE);
+ transmute(simd_select_bitmask(k, r, src.as_f64x8()))
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b, and store packed minimum values in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_min_round_pd&expand=3772)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminpd, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_min_round_pd<const SAE: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vminpd(a, b, SAE);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst. This intrinsic essentially calculates floor(log2(x)) for each element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_getexp_round_ps&expand=2850)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpps, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_getexp_round_ps<const SAE: i32>(a: __m512) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vgetexpps(a, zero, 0b11111111_11111111, SAE);
+ transmute(r)
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_getexp_round_ps&expand=2851)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpps, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_getexp_round_ps<const SAE: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let src = src.as_f32x16();
+ let r = vgetexpps(a, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert the exponent of each packed single-precision (32-bit) floating-point element in a to a single-precision (32-bit) floating-point number representing the integer exponent, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_getexp_round_ps&expand=2852)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpps, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_getexp_round_ps<const SAE: i32>(k: __mmask16, a: __m512) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vgetexpps(a, zero, k, SAE);
+ transmute(r)
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst. This intrinsic essentially calculates floor(log2(x)) for each element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_getexp_round_pd&expand=2847)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexppd, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_getexp_round_pd<const SAE: i32>(a: __m512d) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vgetexppd(a, zero, 0b11111111, SAE);
+ transmute(r)
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_getexp_round_pd&expand=2848)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexppd, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_getexp_round_pd<const SAE: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let src = src.as_f64x8();
+ let r = vgetexppd(a, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert the exponent of each packed double-precision (64-bit) floating-point element in a to a double-precision (64-bit) floating-point number representing the integer exponent, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates floor(log2(x)) for each element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_getexp_round_pd&expand=2849)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexppd, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_getexp_round_pd<const SAE: i32>(k: __mmask8, a: __m512d) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vgetexppd(a, zero, k, SAE);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_roundscale_round_ps&expand=4790)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(1, 2)]
+pub unsafe fn _mm512_roundscale_round_ps<const IMM8: i32, const SAE: i32>(a: __m512) -> __m512 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vrndscaleps(a, IMM8, zero, 0b11111111_11111111, SAE);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_roundscale_round_ps&expand=4788)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm512_mask_roundscale_round_ps<const IMM8: i32, const SAE: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+) -> __m512 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x16();
+ let src = src.as_f32x16();
+ let r = vrndscaleps(a, IMM8, src, k, SAE);
+ transmute(r)
+}
+
+/// Round packed single-precision (32-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_roundscale_round_ps&expand=4789)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaleps, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm512_maskz_roundscale_round_ps<const IMM8: i32, const SAE: i32>(
+ k: __mmask16,
+ a: __m512,
+) -> __m512 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vrndscaleps(a, IMM8, zero, k, SAE);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_roundscale_round_pd&expand=4787)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(1, 2)]
+pub unsafe fn _mm512_roundscale_round_pd<const IMM8: i32, const SAE: i32>(a: __m512d) -> __m512d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vrndscalepd(a, IMM8, zero, 0b11111111, SAE);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_roundscale_round_pd&expand=4785)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm512_mask_roundscale_round_pd<const IMM8: i32, const SAE: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x8();
+ let src = src.as_f64x8();
+ let r = vrndscalepd(a, IMM8, src, k, SAE);
+ transmute(r)
+}
+
+/// Round packed double-precision (64-bit) floating-point elements in a to the number of fraction bits specified by imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_roundscale_round_pd&expand=4786)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalepd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm512_maskz_roundscale_round_pd<const IMM8: i32, const SAE: i32>(
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vrndscalepd(a, IMM8, zero, k, SAE);
+ transmute(r)
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_scalef_round_ps&expand=4889)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_scalef_round_ps<const ROUNDING: i32>(a: __m512, b: __m512) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vscalefps(a, b, zero, 0b11111111_11111111, ROUNDING);
+ transmute(r)
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_scalef_round_ps&expand=4887)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_scalef_round_ps<const ROUNDING: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let src = src.as_f32x16();
+ let r = vscalefps(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_scalef_round_ps&expand=4888)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_scalef_round_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vscalefps(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_scalef_round_pd&expand=4886)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_scalef_round_pd<const ROUNDING: i32>(a: __m512d, b: __m512d) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vscalefpd(a, b, zero, 0b11111111, ROUNDING);
+ transmute(r)
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_scalef_round_pd&expand=4884)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_scalef_round_pd<const ROUNDING: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let src = src.as_f64x8();
+ let r = vscalefpd(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_scalef_round_pd&expand=4885)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefpd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_scalef_round_pd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vscalefpd(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst. imm8 is used to set the required flags reporting.\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fixupimm_round_ps&expand=2505)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm512_fixupimm_round_ps<const IMM8: i32, const SAE: i32>(
+ a: __m512,
+ b: __m512,
+ c: __m512i,
+) -> __m512 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_i32x16();
+ let r = vfixupimmps(a, b, c, IMM8, 0b11111111_11111111, SAE);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fixupimm_round_ps&expand=2506)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm512_mask_fixupimm_round_ps<const IMM8: i32, const SAE: i32>(
+ a: __m512,
+ k: __mmask16,
+ b: __m512,
+ c: __m512i,
+) -> __m512 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_i32x16();
+ let r = vfixupimmps(a, b, c, IMM8, k, SAE);
+ transmute(r)
+}
+
+/// Fix up packed single-precision (32-bit) floating-point elements in a and b using packed 32-bit integers in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fixupimm_round_ps&expand=2507)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmps, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm512_maskz_fixupimm_round_ps<const IMM8: i32, const SAE: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+ c: __m512i,
+) -> __m512 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let c = c.as_i32x16();
+ let r = vfixupimmpsz(a, b, c, IMM8, k, SAE);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst. imm8 is used to set the required flags reporting.\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_fixupimm_round_pd&expand=2502)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm512_fixupimm_round_pd<const IMM8: i32, const SAE: i32>(
+ a: __m512d,
+ b: __m512d,
+ c: __m512i,
+) -> __m512d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_i64x8();
+ let r = vfixupimmpd(a, b, c, IMM8, 0b11111111, SAE);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_fixupimm_round_pd&expand=2503)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm512_mask_fixupimm_round_pd<const IMM8: i32, const SAE: i32>(
+ a: __m512d,
+ k: __mmask8,
+ b: __m512d,
+ c: __m512i,
+) -> __m512d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_i64x8();
+ let r = vfixupimmpd(a, b, c, IMM8, k, SAE);
+ transmute(r)
+}
+
+/// Fix up packed double-precision (64-bit) floating-point elements in a and b using packed 64-bit integers in c, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). imm8 is used to set the required flags reporting.\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_fixupimm_round_pd&expand=2504)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmpd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm512_maskz_fixupimm_round_pd<const IMM8: i32, const SAE: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+ c: __m512i,
+) -> __m512d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let c = c.as_i64x8();
+ let r = vfixupimmpdz(a, b, c, IMM8, k, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_getmant_round_ps&expand=2886)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(1, 2, 3)]
+pub unsafe fn _mm512_getmant_round_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ a: __m512,
+) -> __m512 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vgetmantps(a, SIGN << 2 | NORM, zero, 0b11111111_11111111, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_getmant_round_ps&expand=2887)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(3, 4, 5)]
+pub unsafe fn _mm512_mask_getmant_round_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+) -> __m512 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x16();
+ let src = src.as_f32x16();
+ let r = vgetmantps(a, SIGN << 2 | NORM, src, k, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed single-precision (32-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_getmant_round_ps&expand=2888)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantps, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(2, 3, 4)]
+pub unsafe fn _mm512_maskz_getmant_round_ps<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ k: __mmask16,
+ a: __m512,
+) -> __m512 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vgetmantps(a, SIGN << 2 | NORM, zero, k, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_getmant_round_pd&expand=2883)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(1, 2, 3)]
+pub unsafe fn _mm512_getmant_round_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ a: __m512d,
+) -> __m512d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vgetmantpd(a, SIGN << 2 | NORM, zero, 0b11111111, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_getmant_round_pd&expand=2884)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(3, 4, 5)]
+pub unsafe fn _mm512_mask_getmant_round_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x8();
+ let src = src.as_f64x8();
+ let r = vgetmantpd(a, SIGN << 2 | NORM, src, k, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of packed double-precision (64-bit) floating-point elements in a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_512_maskz_getmant_round_pd&expand=2885)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantpd, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(2, 3, 4)]
+pub unsafe fn _mm512_maskz_getmant_round_pd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vgetmantpd(a, SIGN << 2 | NORM, zero, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtps_epi32&expand=1737)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2dq))]
+pub unsafe fn _mm512_cvtps_epi32(a: __m512) -> __m512i {
+ transmute(vcvtps2dq(
+ a.as_f32x16(),
+ _mm512_setzero_si512().as_i32x16(),
+ 0b11111111_11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtps_epi32&expand=1738)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2dq))]
+pub unsafe fn _mm512_mask_cvtps_epi32(src: __m512i, k: __mmask16, a: __m512) -> __m512i {
+ transmute(vcvtps2dq(
+ a.as_f32x16(),
+ src.as_i32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtps_epi32&expand=1739)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2dq))]
+pub unsafe fn _mm512_maskz_cvtps_epi32(k: __mmask16, a: __m512) -> __m512i {
+ transmute(vcvtps2dq(
+ a.as_f32x16(),
+ _mm512_setzero_si512().as_i32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtps_epi32&expand=1735)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2dq))]
+pub unsafe fn _mm256_mask_cvtps_epi32(src: __m256i, k: __mmask8, a: __m256) -> __m256i {
+ let convert = _mm256_cvtps_epi32(a);
+ transmute(simd_select_bitmask(k, convert.as_i32x8(), src.as_i32x8()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtps_epi32&expand=1736)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2dq))]
+pub unsafe fn _mm256_maskz_cvtps_epi32(k: __mmask8, a: __m256) -> __m256i {
+ let convert = _mm256_cvtps_epi32(a);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, convert.as_i32x8(), zero))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtps_epi32&expand=1732)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2dq))]
+pub unsafe fn _mm_mask_cvtps_epi32(src: __m128i, k: __mmask8, a: __m128) -> __m128i {
+ let convert = _mm_cvtps_epi32(a);
+ transmute(simd_select_bitmask(k, convert.as_i32x4(), src.as_i32x4()))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtps_epi32&expand=1733)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2dq))]
+pub unsafe fn _mm_maskz_cvtps_epi32(k: __mmask8, a: __m128) -> __m128i {
+ let convert = _mm_cvtps_epi32(a);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, convert.as_i32x4(), zero))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtps_epu32&expand=1755)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2udq))]
+pub unsafe fn _mm512_cvtps_epu32(a: __m512) -> __m512i {
+ transmute(vcvtps2udq(
+ a.as_f32x16(),
+ _mm512_setzero_si512().as_u32x16(),
+ 0b11111111_11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtps_epu32&expand=1756)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2udq))]
+pub unsafe fn _mm512_mask_cvtps_epu32(src: __m512i, k: __mmask16, a: __m512) -> __m512i {
+ transmute(vcvtps2udq(
+ a.as_f32x16(),
+ src.as_u32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundps_epu32&expand=1343)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2udq))]
+pub unsafe fn _mm512_maskz_cvtps_epu32(k: __mmask16, a: __m512) -> __m512i {
+ transmute(vcvtps2udq(
+ a.as_f32x16(),
+ _mm512_setzero_si512().as_u32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtps_epu32&expand=1752)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2udq))]
+pub unsafe fn _mm256_cvtps_epu32(a: __m256) -> __m256i {
+ transmute(vcvtps2udq256(
+ a.as_f32x8(),
+ _mm256_setzero_si256().as_u32x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtps_epu32&expand=1753)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2udq))]
+pub unsafe fn _mm256_mask_cvtps_epu32(src: __m256i, k: __mmask8, a: __m256) -> __m256i {
+ transmute(vcvtps2udq256(a.as_f32x8(), src.as_u32x8(), k))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtps_epu32&expand=1754)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2udq))]
+pub unsafe fn _mm256_maskz_cvtps_epu32(k: __mmask8, a: __m256) -> __m256i {
+ transmute(vcvtps2udq256(
+ a.as_f32x8(),
+ _mm256_setzero_si256().as_u32x8(),
+ k,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtps_epu32&expand=1749)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2udq))]
+pub unsafe fn _mm_cvtps_epu32(a: __m128) -> __m128i {
+ transmute(vcvtps2udq128(
+ a.as_f32x4(),
+ _mm_setzero_si128().as_u32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtps_epu32&expand=1750)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2udq))]
+pub unsafe fn _mm_mask_cvtps_epu32(src: __m128i, k: __mmask8, a: __m128) -> __m128i {
+ transmute(vcvtps2udq128(a.as_f32x4(), src.as_u32x4(), k))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtps_epu32&expand=1751)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2udq))]
+pub unsafe fn _mm_maskz_cvtps_epu32(k: __mmask8, a: __m128) -> __m128i {
+ transmute(vcvtps2udq128(
+ a.as_f32x4(),
+ _mm_setzero_si128().as_u32x4(),
+ k,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed double-precision (64-bit) floating-point elements, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtps_pd&expand=1769)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2pd))]
+pub unsafe fn _mm512_cvtps_pd(a: __m256) -> __m512d {
+ transmute(vcvtps2pd(
+ a.as_f32x8(),
+ _mm512_setzero_pd().as_f64x8(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtps_pd&expand=1770)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2pd))]
+pub unsafe fn _mm512_mask_cvtps_pd(src: __m512d, k: __mmask8, a: __m256) -> __m512d {
+ transmute(vcvtps2pd(
+ a.as_f32x8(),
+ src.as_f64x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtps_pd&expand=1771)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2pd))]
+pub unsafe fn _mm512_maskz_cvtps_pd(k: __mmask8, a: __m256) -> __m512d {
+ transmute(vcvtps2pd(
+ a.as_f32x8(),
+ _mm512_setzero_pd().as_f64x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Performs element-by-element conversion of the lower half of packed single-precision (32-bit) floating-point elements in v2 to packed double-precision (64-bit) floating-point elements, storing the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtpslo_pd&expand=1784)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2pd))]
+pub unsafe fn _mm512_cvtpslo_pd(v2: __m512) -> __m512d {
+ transmute(vcvtps2pd(
+ _mm512_castps512_ps256(v2).as_f32x8(),
+ _mm512_setzero_pd().as_f64x8(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Performs element-by-element conversion of the lower half of packed single-precision (32-bit) floating-point elements in v2 to packed double-precision (64-bit) floating-point elements, storing the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtpslo_pd&expand=1785)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2pd))]
+pub unsafe fn _mm512_mask_cvtpslo_pd(src: __m512d, k: __mmask8, v2: __m512) -> __m512d {
+ transmute(vcvtps2pd(
+ _mm512_castps512_ps256(v2).as_f32x8(),
+ src.as_f64x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtpd_ps&expand=1712)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps))]
+pub unsafe fn _mm512_cvtpd_ps(a: __m512d) -> __m256 {
+ transmute(vcvtpd2ps(
+ a.as_f64x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtpd_ps&expand=1713)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps))]
+pub unsafe fn _mm512_mask_cvtpd_ps(src: __m256, k: __mmask8, a: __m512d) -> __m256 {
+ transmute(vcvtpd2ps(
+ a.as_f64x8(),
+ src.as_f32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtpd_ps&expand=1714)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps))]
+pub unsafe fn _mm512_maskz_cvtpd_ps(k: __mmask8, a: __m512d) -> __m256 {
+ transmute(vcvtpd2ps(
+ a.as_f64x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtpd_ps&expand=1710)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps))]
+pub unsafe fn _mm256_mask_cvtpd_ps(src: __m128, k: __mmask8, a: __m256d) -> __m128 {
+ let convert = _mm256_cvtpd_ps(a);
+ transmute(simd_select_bitmask(k, convert.as_f32x4(), src.as_f32x4()))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtpd_ps&expand=1711)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps))]
+pub unsafe fn _mm256_maskz_cvtpd_ps(k: __mmask8, a: __m256d) -> __m128 {
+ let convert = _mm256_cvtpd_ps(a);
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, convert.as_f32x4(), zero))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtpd_ps&expand=1707)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps))]
+pub unsafe fn _mm_mask_cvtpd_ps(src: __m128, k: __mmask8, a: __m128d) -> __m128 {
+ let convert = _mm_cvtpd_ps(a);
+ transmute(simd_select_bitmask(k, convert.as_f32x4(), src.as_f32x4()))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtpd_ps&expand=1708)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps))]
+pub unsafe fn _mm_maskz_cvtpd_ps(k: __mmask8, a: __m128d) -> __m128 {
+ let convert = _mm_cvtpd_ps(a);
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, convert.as_f32x4(), zero))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtpd_epi32&expand=1675)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq))]
+pub unsafe fn _mm512_cvtpd_epi32(a: __m512d) -> __m256i {
+ transmute(vcvtpd2dq(
+ a.as_f64x8(),
+ _mm256_setzero_si256().as_i32x8(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtpd_epi32&expand=1676)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq))]
+pub unsafe fn _mm512_mask_cvtpd_epi32(src: __m256i, k: __mmask8, a: __m512d) -> __m256i {
+ transmute(vcvtpd2dq(
+ a.as_f64x8(),
+ src.as_i32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtpd_epi32&expand=1677)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq))]
+pub unsafe fn _mm512_maskz_cvtpd_epi32(k: __mmask8, a: __m512d) -> __m256i {
+ transmute(vcvtpd2dq(
+ a.as_f64x8(),
+ _mm256_setzero_si256().as_i32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtpd_epi32&expand=1673)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq))]
+pub unsafe fn _mm256_mask_cvtpd_epi32(src: __m128i, k: __mmask8, a: __m256d) -> __m128i {
+ let convert = _mm256_cvtpd_epi32(a);
+ transmute(simd_select_bitmask(k, convert.as_i32x4(), src.as_i32x4()))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtpd_epi32&expand=1674)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq))]
+pub unsafe fn _mm256_maskz_cvtpd_epi32(k: __mmask8, a: __m256d) -> __m128i {
+ let convert = _mm256_cvtpd_epi32(a);
+ transmute(simd_select_bitmask(
+ k,
+ convert.as_i32x4(),
+ _mm_setzero_si128().as_i32x4(),
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtpd_epi32&expand=1670)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq))]
+pub unsafe fn _mm_mask_cvtpd_epi32(src: __m128i, k: __mmask8, a: __m128d) -> __m128i {
+ let convert = _mm_cvtpd_epi32(a);
+ transmute(simd_select_bitmask(k, convert.as_i32x4(), src.as_i32x4()))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtpd_epi32&expand=1671)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq))]
+pub unsafe fn _mm_maskz_cvtpd_epi32(k: __mmask8, a: __m128d) -> __m128i {
+ let convert = _mm_cvtpd_epi32(a);
+ transmute(simd_select_bitmask(
+ k,
+ convert.as_i32x4(),
+ _mm_setzero_si128().as_i32x4(),
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtpd_epu32&expand=1693)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq))]
+pub unsafe fn _mm512_cvtpd_epu32(a: __m512d) -> __m256i {
+ transmute(vcvtpd2udq(
+ a.as_f64x8(),
+ _mm256_setzero_si256().as_u32x8(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtpd_epu32&expand=1694)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq))]
+pub unsafe fn _mm512_mask_cvtpd_epu32(src: __m256i, k: __mmask8, a: __m512d) -> __m256i {
+ transmute(vcvtpd2udq(
+ a.as_f64x8(),
+ src.as_u32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtpd_epu32&expand=1695)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq))]
+pub unsafe fn _mm512_maskz_cvtpd_epu32(k: __mmask8, a: __m512d) -> __m256i {
+ transmute(vcvtpd2udq(
+ a.as_f64x8(),
+ _mm256_setzero_si256().as_u32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtpd_epu32&expand=1690)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq))]
+pub unsafe fn _mm256_cvtpd_epu32(a: __m256d) -> __m128i {
+ transmute(vcvtpd2udq256(
+ a.as_f64x4(),
+ _mm_setzero_si128().as_u32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtpd_epu32&expand=1691)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq))]
+pub unsafe fn _mm256_mask_cvtpd_epu32(src: __m128i, k: __mmask8, a: __m256d) -> __m128i {
+ transmute(vcvtpd2udq256(a.as_f64x4(), src.as_u32x4(), k))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtpd_epu32&expand=1692)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq))]
+pub unsafe fn _mm256_maskz_cvtpd_epu32(k: __mmask8, a: __m256d) -> __m128i {
+ transmute(vcvtpd2udq256(
+ a.as_f64x4(),
+ _mm_setzero_si128().as_u32x4(),
+ k,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtpd_epu32&expand=1687)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq))]
+pub unsafe fn _mm_cvtpd_epu32(a: __m128d) -> __m128i {
+ transmute(vcvtpd2udq128(
+ a.as_f64x2(),
+ _mm_setzero_si128().as_u32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtpd_epu32&expand=1688)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq))]
+pub unsafe fn _mm_mask_cvtpd_epu32(src: __m128i, k: __mmask8, a: __m128d) -> __m128i {
+ transmute(vcvtpd2udq128(a.as_f64x2(), src.as_u32x4(), k))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtpd_epu32&expand=1689)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq))]
+pub unsafe fn _mm_maskz_cvtpd_epu32(k: __mmask8, a: __m128d) -> __m128i {
+ transmute(vcvtpd2udq128(
+ a.as_f64x2(),
+ _mm_setzero_si128().as_u32x4(),
+ k,
+ ))
+}
+
+/// Performs an element-by-element conversion of packed double-precision (64-bit) floating-point elements in v2 to single-precision (32-bit) floating-point elements and stores them in dst. The elements are stored in the lower half of the results vector, while the remaining upper half locations are set to 0.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtpd_pslo&expand=1715)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps))]
+pub unsafe fn _mm512_cvtpd_pslo(v2: __m512d) -> __m512 {
+ let r: f32x8 = vcvtpd2ps(
+ v2.as_f64x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ );
+ simd_shuffle16!(
+ r,
+ _mm256_setzero_ps().as_f32x8(),
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8],
+ )
+}
+
+/// Performs an element-by-element conversion of packed double-precision (64-bit) floating-point elements in v2 to single-precision (32-bit) floating-point elements and stores them in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). The elements are stored in the lower half of the results vector, while the remaining upper half locations are set to 0.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtpd_pslo&expand=1716)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps))]
+pub unsafe fn _mm512_mask_cvtpd_pslo(src: __m512, k: __mmask8, v2: __m512d) -> __m512 {
+ let r: f32x8 = vcvtpd2ps(
+ v2.as_f64x8(),
+ _mm512_castps512_ps256(src).as_f32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ );
+ simd_shuffle16!(
+ r,
+ _mm256_setzero_ps().as_f32x8(),
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8],
+ )
+}
+
+/// Sign extend packed 8-bit integers in a to packed 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi8_epi32&expand=1535)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxbd))]
+pub unsafe fn _mm512_cvtepi8_epi32(a: __m128i) -> __m512i {
+ let a = a.as_i8x16();
+ transmute::<i32x16, _>(simd_cast(a))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi8_epi32&expand=1536)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxbd))]
+pub unsafe fn _mm512_mask_cvtepi8_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepi8_epi32(a).as_i32x16();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x16()))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi8_epi32&expand=1537)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxbd))]
+pub unsafe fn _mm512_maskz_cvtepi8_epi32(k: __mmask16, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepi8_epi32(a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi8_epi32&expand=1533)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxbd))]
+pub unsafe fn _mm256_mask_cvtepi8_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepi8_epi32(a).as_i32x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x8()))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi8_epi32&expand=1534)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxbd))]
+pub unsafe fn _mm256_maskz_cvtepi8_epi32(k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepi8_epi32(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi8_epi32&expand=1530)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxbd))]
+pub unsafe fn _mm_mask_cvtepi8_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepi8_epi32(a).as_i32x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x4()))
+}
+
+/// Sign extend packed 8-bit integers in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi8_epi32&expand=1531)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxbd))]
+pub unsafe fn _mm_maskz_cvtepi8_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepi8_epi32(a).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 8-bit integers in the low 8 bytes of a to packed 64-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi8_epi64&expand=1544)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxbq))]
+pub unsafe fn _mm512_cvtepi8_epi64(a: __m128i) -> __m512i {
+ let a = a.as_i8x16();
+ let v64: i8x8 = simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]);
+ transmute::<i64x8, _>(simd_cast(v64))
+}
+
+/// Sign extend packed 8-bit integers in the low 8 bytes of a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi8_epi64&expand=1545)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxbq))]
+pub unsafe fn _mm512_mask_cvtepi8_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepi8_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x8()))
+}
+
+/// Sign extend packed 8-bit integers in the low 8 bytes of a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi8_epi64&expand=1546)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxbq))]
+pub unsafe fn _mm512_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepi8_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 8-bit integers in the low 4 bytes of a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi8_epi64&expand=1542)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxbq))]
+pub unsafe fn _mm256_mask_cvtepi8_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepi8_epi64(a).as_i64x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x4()))
+}
+
+/// Sign extend packed 8-bit integers in the low 4 bytes of a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi8_epi64&expand=1543)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxbq))]
+pub unsafe fn _mm256_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepi8_epi64(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 8-bit integers in the low 2 bytes of a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi8_epi64&expand=1539)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxbq))]
+pub unsafe fn _mm_mask_cvtepi8_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepi8_epi64(a).as_i64x2();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x2()))
+}
+
+/// Sign extend packed 8-bit integers in the low 2 bytes of a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi8_epi64&expand=1540)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxbq))]
+pub unsafe fn _mm_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepi8_epi64(a).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 8-bit integers in a to packed 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepu8_epi32&expand=1621)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxbd))]
+pub unsafe fn _mm512_cvtepu8_epi32(a: __m128i) -> __m512i {
+ let a = a.as_u8x16();
+ transmute::<i32x16, _>(simd_cast(a))
+}
+
+/// Zero extend packed unsigned 8-bit integers in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepu8_epi32&expand=1622)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxbd))]
+pub unsafe fn _mm512_mask_cvtepu8_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepu8_epi32(a).as_i32x16();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x16()))
+}
+
+/// Zero extend packed unsigned 8-bit integers in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepu8_epi32&expand=1623)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxbd))]
+pub unsafe fn _mm512_maskz_cvtepu8_epi32(k: __mmask16, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepu8_epi32(a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 8-bit integers in the low 8 bytes of a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepu8_epi32&expand=1619)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxbd))]
+pub unsafe fn _mm256_mask_cvtepu8_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepu8_epi32(a).as_i32x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x8()))
+}
+
+/// Zero extend packed unsigned 8-bit integers in the low 8 bytes of a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/IntrinsicsGuide/#text=_mm256_maskz_cvtepu8_epi32&expand=1620)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxbd))]
+pub unsafe fn _mm256_maskz_cvtepu8_epi32(k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepu8_epi32(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 8-bit integers in the low 4 bytes of a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepu8_epi32&expand=1616)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxbd))]
+pub unsafe fn _mm_mask_cvtepu8_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepu8_epi32(a).as_i32x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x4()))
+}
+
+/// Zero extend packed unsigned 8-bit integers in th elow 4 bytes of a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/IntrinsicsGuide/#text=_mm_maskz_cvtepu8_epi32&expand=1617)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxbd))]
+pub unsafe fn _mm_maskz_cvtepu8_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepu8_epi32(a).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 8-bit integers in the low 8 byte sof a to packed 64-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepu8_epi64&expand=1630)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxbq))]
+pub unsafe fn _mm512_cvtepu8_epi64(a: __m128i) -> __m512i {
+ let a = a.as_u8x16();
+ let v64: u8x8 = simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]);
+ transmute::<i64x8, _>(simd_cast(v64))
+}
+
+/// Zero extend packed unsigned 8-bit integers in the low 8 bytes of a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepu8_epi64&expand=1631)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxbq))]
+pub unsafe fn _mm512_mask_cvtepu8_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepu8_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x8()))
+}
+
+/// Zero extend packed unsigned 8-bit integers in the low 8 bytes of a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepu8_epi64&expand=1632)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxbq))]
+pub unsafe fn _mm512_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepu8_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 8-bit integers in the low 4 bytes of a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepu8_epi64&expand=1628)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxbq))]
+pub unsafe fn _mm256_mask_cvtepu8_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepu8_epi64(a).as_i64x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x4()))
+}
+
+/// Zero extend packed unsigned 8-bit integers in the low 4 bytes of a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepu8_epi64&expand=1629)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxbq))]
+pub unsafe fn _mm256_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepu8_epi64(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 8-bit integers in the low 2 bytes of a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepu8_epi64&expand=1625)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxbq))]
+pub unsafe fn _mm_mask_cvtepu8_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepu8_epi64(a).as_i64x2();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x2()))
+}
+
+/// Zero extend packed unsigned 8-bit integers in the low 2 bytes of a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepu8_epi64&expand=1626)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxbq))]
+pub unsafe fn _mm_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepu8_epi64(a).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi16_epi32&expand=1389)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxwd))]
+pub unsafe fn _mm512_cvtepi16_epi32(a: __m256i) -> __m512i {
+ let a = a.as_i16x16();
+ transmute::<i32x16, _>(simd_cast(a))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi16_epi32&expand=1390)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxwd))]
+pub unsafe fn _mm512_mask_cvtepi16_epi32(src: __m512i, k: __mmask16, a: __m256i) -> __m512i {
+ let convert = _mm512_cvtepi16_epi32(a).as_i32x16();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x16()))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi16_epi32&expand=1391)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxwd))]
+pub unsafe fn _mm512_maskz_cvtepi16_epi32(k: __mmask16, a: __m256i) -> __m512i {
+ let convert = _mm512_cvtepi16_epi32(a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi16_epi32&expand=1387)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxwd))]
+pub unsafe fn _mm256_mask_cvtepi16_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepi16_epi32(a).as_i32x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x8()))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi16_epi32&expand=1388)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxwd))]
+pub unsafe fn _mm256_maskz_cvtepi16_epi32(k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepi16_epi32(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi16_epi32&expand=1384)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxwd))]
+pub unsafe fn _mm_mask_cvtepi16_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepi16_epi32(a).as_i32x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x4()))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi16_epi32&expand=1385)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxwd))]
+pub unsafe fn _mm_maskz_cvtepi16_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepi16_epi32(a).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 64-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi16_epi64&expand=1398)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxwq))]
+pub unsafe fn _mm512_cvtepi16_epi64(a: __m128i) -> __m512i {
+ let a = a.as_i16x8();
+ transmute::<i64x8, _>(simd_cast(a))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi16_epi64&expand=1399)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxwq))]
+pub unsafe fn _mm512_mask_cvtepi16_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepi16_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x8()))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi16_epi64&expand=1400)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxwq))]
+pub unsafe fn _mm512_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepi16_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi16_epi64&expand=1396)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxwq))]
+pub unsafe fn _mm256_mask_cvtepi16_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepi16_epi64(a).as_i64x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x4()))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi16_epi64&expand=1397)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxwq))]
+pub unsafe fn _mm256_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepi16_epi64(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi16_epi64&expand=1393)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxwq))]
+pub unsafe fn _mm_mask_cvtepi16_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepi16_epi64(a).as_i64x2();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x2()))
+}
+
+/// Sign extend packed 16-bit integers in a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi16_epi64&expand=1394)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxwq))]
+pub unsafe fn _mm_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepi16_epi64(a).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 16-bit integers in a to packed 32-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepu16_epi32&expand=1553)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxwd))]
+pub unsafe fn _mm512_cvtepu16_epi32(a: __m256i) -> __m512i {
+ let a = a.as_u16x16();
+ transmute::<i32x16, _>(simd_cast(a))
+}
+
+/// Zero extend packed unsigned 16-bit integers in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepu16_epi32&expand=1554)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxwd))]
+pub unsafe fn _mm512_mask_cvtepu16_epi32(src: __m512i, k: __mmask16, a: __m256i) -> __m512i {
+ let convert = _mm512_cvtepu16_epi32(a).as_i32x16();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x16()))
+}
+
+/// Zero extend packed unsigned 16-bit integers in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepu16_epi32&expand=1555)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxwd))]
+pub unsafe fn _mm512_maskz_cvtepu16_epi32(k: __mmask16, a: __m256i) -> __m512i {
+ let convert = _mm512_cvtepu16_epi32(a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 16-bit integers in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepu16_epi32&expand=1551)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxwd))]
+pub unsafe fn _mm256_mask_cvtepu16_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepu16_epi32(a).as_i32x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x8()))
+}
+
+/// Zero extend packed unsigned 16-bit integers in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepu16_epi32&expand=1552)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxwd))]
+pub unsafe fn _mm256_maskz_cvtepu16_epi32(k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepu16_epi32(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 16-bit integers in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepu16_epi32&expand=1548)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxwd))]
+pub unsafe fn _mm_mask_cvtepu16_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepu16_epi32(a).as_i32x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x4()))
+}
+
+/// Zero extend packed unsigned 16-bit integers in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepu16_epi32&expand=1549)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxwd))]
+pub unsafe fn _mm_maskz_cvtepu16_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepu16_epi32(a).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 16-bit integers in a to packed 64-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepu16_epi64&expand=1562)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxwq))]
+pub unsafe fn _mm512_cvtepu16_epi64(a: __m128i) -> __m512i {
+ let a = a.as_u16x8();
+ transmute::<i64x8, _>(simd_cast(a))
+}
+
+/// Zero extend packed unsigned 16-bit integers in a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepu16_epi64&expand=1563)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxwq))]
+pub unsafe fn _mm512_mask_cvtepu16_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepu16_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x8()))
+}
+
+/// Zero extend packed unsigned 16-bit integers in a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepu16_epi64&expand=1564)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxwq))]
+pub unsafe fn _mm512_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m512i {
+ let convert = _mm512_cvtepu16_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 16-bit integers in the low 8 bytes of a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepu16_epi64&expand=1560)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxwq))]
+pub unsafe fn _mm256_mask_cvtepu16_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepu16_epi64(a).as_i64x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x4()))
+}
+
+/// Zero extend packed unsigned 16-bit integers in the low 8 bytes of a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepu16_epi64&expand=1561)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxwq))]
+pub unsafe fn _mm256_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepu16_epi64(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 16-bit integers in the low 4 bytes of a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepu16_epi64&expand=1557)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxwq))]
+pub unsafe fn _mm_mask_cvtepu16_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepu16_epi64(a).as_i64x2();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x2()))
+}
+
+/// Zero extend packed unsigned 16-bit integers in the low 4 bytes of a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepu16_epi64&expand=1558)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxwq))]
+pub unsafe fn _mm_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepu16_epi64(a).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 32-bit integers in a to packed 64-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi32_epi64&expand=1428)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxdq))]
+pub unsafe fn _mm512_cvtepi32_epi64(a: __m256i) -> __m512i {
+ let a = a.as_i32x8();
+ transmute::<i64x8, _>(simd_cast(a))
+}
+
+/// Sign extend packed 32-bit integers in a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi32_epi64&expand=1429)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxdq))]
+pub unsafe fn _mm512_mask_cvtepi32_epi64(src: __m512i, k: __mmask8, a: __m256i) -> __m512i {
+ let convert = _mm512_cvtepi32_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x8()))
+}
+
+/// Sign extend packed 32-bit integers in a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi32_epi64&expand=1430)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsxdq))]
+pub unsafe fn _mm512_maskz_cvtepi32_epi64(k: __mmask8, a: __m256i) -> __m512i {
+ let convert = _mm512_cvtepi32_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 32-bit integers in a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi32_epi64&expand=1426)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxdq))]
+pub unsafe fn _mm256_mask_cvtepi32_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepi32_epi64(a).as_i64x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x4()))
+}
+
+/// Sign extend packed 32-bit integers in a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi32_epi64&expand=1427)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxdq))]
+pub unsafe fn _mm256_maskz_cvtepi32_epi64(k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepi32_epi64(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Sign extend packed 32-bit integers in a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi32_epi64&expand=1423)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxdq))]
+pub unsafe fn _mm_mask_cvtepi32_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepi32_epi64(a).as_i64x2();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x2()))
+}
+
+/// Sign extend packed 32-bit integers in a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi32_epi64&expand=1424)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsxdq))]
+pub unsafe fn _mm_maskz_cvtepi32_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepi32_epi64(a).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 32-bit integers in a to packed 64-bit integers, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepu32_epi64&expand=1571)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxdq))]
+pub unsafe fn _mm512_cvtepu32_epi64(a: __m256i) -> __m512i {
+ let a = a.as_u32x8();
+ transmute::<i64x8, _>(simd_cast(a))
+}
+
+/// Zero extend packed unsigned 32-bit integers in a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepu32_epi64&expand=1572)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxdq))]
+pub unsafe fn _mm512_mask_cvtepu32_epi64(src: __m512i, k: __mmask8, a: __m256i) -> __m512i {
+ let convert = _mm512_cvtepu32_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x8()))
+}
+
+/// Zero extend packed unsigned 32-bit integers in a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepu32_epi64&expand=1573)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovzxdq))]
+pub unsafe fn _mm512_maskz_cvtepu32_epi64(k: __mmask8, a: __m256i) -> __m512i {
+ let convert = _mm512_cvtepu32_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 32-bit integers in a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepu32_epi64&expand=1569)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxdq))]
+pub unsafe fn _mm256_mask_cvtepu32_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepu32_epi64(a).as_i64x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x4()))
+}
+
+/// Zero extend packed unsigned 32-bit integers in a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepu32_epi64&expand=1570)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxdq))]
+pub unsafe fn _mm256_maskz_cvtepu32_epi64(k: __mmask8, a: __m128i) -> __m256i {
+ let convert = _mm256_cvtepu32_epi64(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Zero extend packed unsigned 32-bit integers in a to packed 64-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepu32_epi64&expand=1566)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxdq))]
+pub unsafe fn _mm_mask_cvtepu32_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepu32_epi64(a).as_i64x2();
+ transmute(simd_select_bitmask(k, convert, src.as_i64x2()))
+}
+
+/// Zero extend packed unsigned 32-bit integers in a to packed 64-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepu32_epi64&expand=1567)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovzxdq))]
+pub unsafe fn _mm_maskz_cvtepu32_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let convert = _mm_cvtepu32_epi64(a).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed signed 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi32_ps&expand=1455)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps))]
+pub unsafe fn _mm512_cvtepi32_ps(a: __m512i) -> __m512 {
+ let a = a.as_i32x16();
+ transmute::<f32x16, _>(simd_cast(a))
+}
+
+/// Convert packed signed 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi32_ps&expand=1456)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps))]
+pub unsafe fn _mm512_mask_cvtepi32_ps(src: __m512, k: __mmask16, a: __m512i) -> __m512 {
+ let convert = _mm512_cvtepi32_ps(a).as_f32x16();
+ transmute(simd_select_bitmask(k, convert, src.as_f32x16()))
+}
+
+/// Convert packed signed 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi32_ps&expand=1457)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps))]
+pub unsafe fn _mm512_maskz_cvtepi32_ps(k: __mmask16, a: __m512i) -> __m512 {
+ let convert = _mm512_cvtepi32_ps(a).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed signed 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi32_ps&expand=1453)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps))]
+pub unsafe fn _mm256_mask_cvtepi32_ps(src: __m256, k: __mmask8, a: __m256i) -> __m256 {
+ let convert = _mm256_cvtepi32_ps(a).as_f32x8();
+ transmute(simd_select_bitmask(k, convert, src.as_f32x8()))
+}
+
+/// Convert packed signed 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi32_ps&expand=1454)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps))]
+pub unsafe fn _mm256_maskz_cvtepi32_ps(k: __mmask8, a: __m256i) -> __m256 {
+ let convert = _mm256_cvtepi32_ps(a).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed signed 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi32_ps&expand=1450)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps))]
+pub unsafe fn _mm_mask_cvtepi32_ps(src: __m128, k: __mmask8, a: __m128i) -> __m128 {
+ let convert = _mm_cvtepi32_ps(a).as_f32x4();
+ transmute(simd_select_bitmask(k, convert, src.as_f32x4()))
+}
+
+/// Convert packed signed 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi32_ps&expand=1451)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps))]
+pub unsafe fn _mm_maskz_cvtepi32_ps(k: __mmask8, a: __m128i) -> __m128 {
+ let convert = _mm_cvtepi32_ps(a).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed signed 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi32_pd&expand=1446)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2pd))]
+pub unsafe fn _mm512_cvtepi32_pd(a: __m256i) -> __m512d {
+ let a = a.as_i32x8();
+ transmute::<f64x8, _>(simd_cast(a))
+}
+
+/// Convert packed signed 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi32_pd&expand=1447)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2pd))]
+pub unsafe fn _mm512_mask_cvtepi32_pd(src: __m512d, k: __mmask8, a: __m256i) -> __m512d {
+ let convert = _mm512_cvtepi32_pd(a).as_f64x8();
+ transmute(simd_select_bitmask(k, convert, src.as_f64x8()))
+}
+
+/// Convert packed signed 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi32_pd&expand=1448)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2pd))]
+pub unsafe fn _mm512_maskz_cvtepi32_pd(k: __mmask8, a: __m256i) -> __m512d {
+ let convert = _mm512_cvtepi32_pd(a).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed signed 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi32_pd&expand=1444)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtdq2pd))]
+pub unsafe fn _mm256_mask_cvtepi32_pd(src: __m256d, k: __mmask8, a: __m128i) -> __m256d {
+ let convert = _mm256_cvtepi32_pd(a).as_f64x4();
+ transmute(simd_select_bitmask(k, convert, src.as_f64x4()))
+}
+
+/// Convert packed signed 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi32_pd&expand=1445)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtdq2pd))]
+pub unsafe fn _mm256_maskz_cvtepi32_pd(k: __mmask8, a: __m128i) -> __m256d {
+ let convert = _mm256_cvtepi32_pd(a).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed signed 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi32_pd&expand=1441)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtdq2pd))]
+pub unsafe fn _mm_mask_cvtepi32_pd(src: __m128d, k: __mmask8, a: __m128i) -> __m128d {
+ let convert = _mm_cvtepi32_pd(a).as_f64x2();
+ transmute(simd_select_bitmask(k, convert, src.as_f64x2()))
+}
+
+/// Convert packed signed 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi32_pd&expand=1442)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtdq2pd))]
+pub unsafe fn _mm_maskz_cvtepi32_pd(k: __mmask8, a: __m128i) -> __m128d {
+ let convert = _mm_cvtepi32_pd(a).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepu32_ps&expand=1583)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2ps))]
+pub unsafe fn _mm512_cvtepu32_ps(a: __m512i) -> __m512 {
+ let a = a.as_u32x16();
+ transmute::<f32x16, _>(simd_cast(a))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepu32_ps&expand=1584)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2ps))]
+pub unsafe fn _mm512_mask_cvtepu32_ps(src: __m512, k: __mmask16, a: __m512i) -> __m512 {
+ let convert = _mm512_cvtepu32_ps(a).as_f32x16();
+ transmute(simd_select_bitmask(k, convert, src.as_f32x16()))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepu32_ps&expand=1585)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2ps))]
+pub unsafe fn _mm512_maskz_cvtepu32_ps(k: __mmask16, a: __m512i) -> __m512 {
+ let convert = _mm512_cvtepu32_ps(a).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepu32_pd&expand=1580)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm512_cvtepu32_pd(a: __m256i) -> __m512d {
+ let a = a.as_u32x8();
+ transmute::<f64x8, _>(simd_cast(a))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepu32_pd&expand=1581)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm512_mask_cvtepu32_pd(src: __m512d, k: __mmask8, a: __m256i) -> __m512d {
+ let convert = _mm512_cvtepu32_pd(a).as_f64x8();
+ transmute(simd_select_bitmask(k, convert, src.as_f64x8()))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepu32_pd&expand=1582)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm512_maskz_cvtepu32_pd(k: __mmask8, a: __m256i) -> __m512d {
+ let convert = _mm512_cvtepu32_pd(a).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepu32_pd&expand=1577)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm256_cvtepu32_pd(a: __m128i) -> __m256d {
+ let a = a.as_u32x4();
+ transmute::<f64x4, _>(simd_cast(a))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepu32_pd&expand=1578)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm256_mask_cvtepu32_pd(src: __m256d, k: __mmask8, a: __m128i) -> __m256d {
+ let convert = _mm256_cvtepu32_pd(a).as_f64x4();
+ transmute(simd_select_bitmask(k, convert, src.as_f64x4()))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepu32_pd&expand=1579)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm256_maskz_cvtepu32_pd(k: __mmask8, a: __m128i) -> __m256d {
+ let convert = _mm256_cvtepu32_pd(a).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepu32_pd&expand=1574)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm_cvtepu32_pd(a: __m128i) -> __m128d {
+ let a = a.as_u32x4();
+ let u64: u32x2 = simd_shuffle2!(a, a, [0, 1]);
+ transmute::<f64x2, _>(simd_cast(u64))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepu32_pd&expand=1575)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm_mask_cvtepu32_pd(src: __m128d, k: __mmask8, a: __m128i) -> __m128d {
+ let convert = _mm_cvtepu32_pd(a).as_f64x2();
+ transmute(simd_select_bitmask(k, convert, src.as_f64x2()))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepu32_pd&expand=1576)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm_maskz_cvtepu32_pd(k: __mmask8, a: __m128i) -> __m128d {
+ let convert = _mm_cvtepu32_pd(a).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Performs element-by-element conversion of the lower half of packed 32-bit integer elements in v2 to packed double-precision (64-bit) floating-point elements, storing the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi32lo_pd&expand=1464)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2pd))]
+pub unsafe fn _mm512_cvtepi32lo_pd(v2: __m512i) -> __m512d {
+ let v2 = v2.as_i32x16();
+ let v256: i32x8 = simd_shuffle8!(v2, v2, [0, 1, 2, 3, 4, 5, 6, 7]);
+ transmute::<f64x8, _>(simd_cast(v256))
+}
+
+/// Performs element-by-element conversion of the lower half of packed 32-bit integer elements in v2 to packed double-precision (64-bit) floating-point elements, storing the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi32lo_pd&expand=1465)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2pd))]
+pub unsafe fn _mm512_mask_cvtepi32lo_pd(src: __m512d, k: __mmask8, v2: __m512i) -> __m512d {
+ let convert = _mm512_cvtepi32lo_pd(v2).as_f64x8();
+ transmute(simd_select_bitmask(k, convert, src.as_f64x8()))
+}
+
+/// Performs element-by-element conversion of the lower half of packed 32-bit unsigned integer elements in v2 to packed double-precision (64-bit) floating-point elements, storing the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepu32lo_pd&expand=1586)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm512_cvtepu32lo_pd(v2: __m512i) -> __m512d {
+ let v2 = v2.as_u32x16();
+ let v256: u32x8 = simd_shuffle8!(v2, v2, [0, 1, 2, 3, 4, 5, 6, 7]);
+ transmute::<f64x8, _>(simd_cast(v256))
+}
+
+/// Performs element-by-element conversion of the lower half of 32-bit unsigned integer elements in v2 to packed double-precision (64-bit) floating-point elements, storing the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepu32lo_pd&expand=1587)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2pd))]
+pub unsafe fn _mm512_mask_cvtepu32lo_pd(src: __m512d, k: __mmask8, v2: __m512i) -> __m512d {
+ let convert = _mm512_cvtepu32lo_pd(v2).as_f64x8();
+ transmute(simd_select_bitmask(k, convert, src.as_f64x8()))
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi32_epi16&expand=1419)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm512_cvtepi32_epi16(a: __m512i) -> __m256i {
+ let a = a.as_i32x16();
+ transmute::<i16x16, _>(simd_cast(a))
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi32_epi16&expand=1420)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm512_mask_cvtepi32_epi16(src: __m256i, k: __mmask16, a: __m512i) -> __m256i {
+ let convert = _mm512_cvtepi32_epi16(a).as_i16x16();
+ transmute(simd_select_bitmask(k, convert, src.as_i16x16()))
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi32_epi16&expand=1421)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm512_maskz_cvtepi32_epi16(k: __mmask16, a: __m512i) -> __m256i {
+ let convert = _mm512_cvtepi32_epi16(a).as_i16x16();
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi32_epi16&expand=1416)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm256_cvtepi32_epi16(a: __m256i) -> __m128i {
+ let a = a.as_i32x8();
+ transmute::<i16x8, _>(simd_cast(a))
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi32_epi16&expand=1417)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm256_mask_cvtepi32_epi16(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ let convert = _mm256_cvtepi32_epi16(a).as_i16x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i16x8()))
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi32_epi16&expand=1418)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm256_maskz_cvtepi32_epi16(k: __mmask8, a: __m256i) -> __m128i {
+ let convert = _mm256_cvtepi32_epi16(a).as_i16x8();
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi32_epi16&expand=1413)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm_cvtepi32_epi16(a: __m128i) -> __m128i {
+ transmute(vpmovdw128(
+ a.as_i32x4(),
+ _mm_setzero_si128().as_i16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi32_epi16&expand=1414)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm_mask_cvtepi32_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovdw128(a.as_i32x4(), src.as_i16x8(), k))
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi32_epi16&expand=1415)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm_maskz_cvtepi32_epi16(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovdw128(a.as_i32x4(), _mm_setzero_si128().as_i16x8(), k))
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi32_epi8&expand=1437)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm512_cvtepi32_epi8(a: __m512i) -> __m128i {
+ let a = a.as_i32x16();
+ transmute::<i8x16, _>(simd_cast(a))
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi32_epi8&expand=1438)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm512_mask_cvtepi32_epi8(src: __m128i, k: __mmask16, a: __m512i) -> __m128i {
+ let convert = _mm512_cvtepi32_epi8(a).as_i8x16();
+ transmute(simd_select_bitmask(k, convert, src.as_i8x16()))
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi32_epi8&expand=1439)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm512_maskz_cvtepi32_epi8(k: __mmask16, a: __m512i) -> __m128i {
+ let convert = _mm512_cvtepi32_epi8(a).as_i8x16();
+ let zero = _mm_setzero_si128().as_i8x16();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi32_epi8&expand=1434)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm256_cvtepi32_epi8(a: __m256i) -> __m128i {
+ transmute(vpmovdb256(
+ a.as_i32x8(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi32_epi8&expand=1435)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm256_mask_cvtepi32_epi8(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovdb256(a.as_i32x8(), src.as_i8x16(), k))
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi32_epi8&expand=1436)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm256_maskz_cvtepi32_epi8(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovdb256(a.as_i32x8(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi32_epi8&expand=1431)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm_cvtepi32_epi8(a: __m128i) -> __m128i {
+ transmute(vpmovdb128(
+ a.as_i32x4(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi32_epi8&expand=1432)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm_mask_cvtepi32_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovdb128(a.as_i32x4(), src.as_i8x16(), k))
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi32_epi8&expand=1433)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm_maskz_cvtepi32_epi8(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovdb128(a.as_i32x4(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi64_epi32&expand=1481)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm512_cvtepi64_epi32(a: __m512i) -> __m256i {
+ let a = a.as_i64x8();
+ transmute::<i32x8, _>(simd_cast(a))
+}
+
+/// Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi64_epi32&expand=1482)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm512_mask_cvtepi64_epi32(src: __m256i, k: __mmask8, a: __m512i) -> __m256i {
+ let convert = _mm512_cvtepi64_epi32(a).as_i32x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x8()))
+}
+
+/// Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi64_epi32&expand=1483)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm512_maskz_cvtepi64_epi32(k: __mmask8, a: __m512i) -> __m256i {
+ let convert = _mm512_cvtepi64_epi32(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi64_epi32&expand=1478)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm256_cvtepi64_epi32(a: __m256i) -> __m128i {
+ let a = a.as_i64x4();
+ transmute::<i32x4, _>(simd_cast(a))
+}
+
+/// Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi64_epi32&expand=1479)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm256_mask_cvtepi64_epi32(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ let convert = _mm256_cvtepi64_epi32(a).as_i32x4();
+ transmute(simd_select_bitmask(k, convert, src.as_i32x4()))
+}
+
+/// Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi64_epi32&expand=1480)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm256_maskz_cvtepi64_epi32(k: __mmask8, a: __m256i) -> __m128i {
+ let convert = _mm256_cvtepi64_epi32(a).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi64_epi32&expand=1475)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm_cvtepi64_epi32(a: __m128i) -> __m128i {
+ transmute(vpmovqd128(
+ a.as_i64x2(),
+ _mm_setzero_si128().as_i32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi64_epi32&expand=1476)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm_mask_cvtepi64_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovqd128(a.as_i64x2(), src.as_i32x4(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi64_epi32&expand=1477)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm_maskz_cvtepi64_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovqd128(a.as_i64x2(), _mm_setzero_si128().as_i32x4(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi64_epi16&expand=1472)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm512_cvtepi64_epi16(a: __m512i) -> __m128i {
+ let a = a.as_i64x8();
+ transmute::<i16x8, _>(simd_cast(a))
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi64_epi16&expand=1473)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm512_mask_cvtepi64_epi16(src: __m128i, k: __mmask8, a: __m512i) -> __m128i {
+ let convert = _mm512_cvtepi64_epi16(a).as_i16x8();
+ transmute(simd_select_bitmask(k, convert, src.as_i16x8()))
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi64_epi16&expand=1474)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm512_maskz_cvtepi64_epi16(k: __mmask8, a: __m512i) -> __m128i {
+ let convert = _mm512_cvtepi64_epi16(a).as_i16x8();
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, convert, zero))
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi64_epi16&expand=1469)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm256_cvtepi64_epi16(a: __m256i) -> __m128i {
+ transmute(vpmovqw256(
+ a.as_i64x4(),
+ _mm_setzero_si128().as_i16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi64_epi16&expand=1470)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm256_mask_cvtepi64_epi16(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovqw256(a.as_i64x4(), src.as_i16x8(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi64_epi16&expand=1471)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm256_maskz_cvtepi64_epi16(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovqw256(a.as_i64x4(), _mm_setzero_si128().as_i16x8(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi64_epi16&expand=1466)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm_cvtepi64_epi16(a: __m128i) -> __m128i {
+ transmute(vpmovqw128(
+ a.as_i64x2(),
+ _mm_setzero_si128().as_i16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi64_epi16&expand=1467)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm_mask_cvtepi64_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovqw128(a.as_i64x2(), src.as_i16x8(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi64_epi16&expand=1468)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm_maskz_cvtepi64_epi16(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovqw128(a.as_i64x2(), _mm_setzero_si128().as_i16x8(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtepi64_epi8&expand=1490)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm512_cvtepi64_epi8(a: __m512i) -> __m128i {
+ transmute(vpmovqb(
+ a.as_i64x8(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi64_epi8&expand=1491)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm512_mask_cvtepi64_epi8(src: __m128i, k: __mmask8, a: __m512i) -> __m128i {
+ transmute(vpmovqb(a.as_i64x8(), src.as_i8x16(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtepi64_epi8&expand=1492)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm512_maskz_cvtepi64_epi8(k: __mmask8, a: __m512i) -> __m128i {
+ transmute(vpmovqb(a.as_i64x8(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtepi64_epi8&expand=1487)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm256_cvtepi64_epi8(a: __m256i) -> __m128i {
+ transmute(vpmovqb256(
+ a.as_i64x4(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi64_epi8&expand=1488)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm256_mask_cvtepi64_epi8(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovqb256(a.as_i64x4(), src.as_i8x16(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtepi64_epi8&expand=1489)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm256_maskz_cvtepi64_epi8(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovqb256(a.as_i64x4(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi64_epi8&expand=1484)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm_cvtepi64_epi8(a: __m128i) -> __m128i {
+ transmute(vpmovqb128(
+ a.as_i64x2(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi64_epi8&expand=1485)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm_mask_cvtepi64_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovqb128(a.as_i64x2(), src.as_i8x16(), k))
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtepi64_epi8&expand=1486)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm_maskz_cvtepi64_epi8(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovqb128(a.as_i64x2(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtsepi32_epi16&expand=1819)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm512_cvtsepi32_epi16(a: __m512i) -> __m256i {
+ transmute(vpmovsdw(
+ a.as_i32x16(),
+ _mm256_setzero_si256().as_i16x16(),
+ 0b11111111_11111111,
+ ))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi32_epi16&expand=1820)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm512_mask_cvtsepi32_epi16(src: __m256i, k: __mmask16, a: __m512i) -> __m256i {
+ transmute(vpmovsdw(a.as_i32x16(), src.as_i16x16(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtsepi32_epi16&expand=1819)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm512_maskz_cvtsepi32_epi16(k: __mmask16, a: __m512i) -> __m256i {
+ transmute(vpmovsdw(
+ a.as_i32x16(),
+ _mm256_setzero_si256().as_i16x16(),
+ k,
+ ))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtsepi32_epi16&expand=1816)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm256_cvtsepi32_epi16(a: __m256i) -> __m128i {
+ transmute(vpmovsdw256(
+ a.as_i32x8(),
+ _mm_setzero_si128().as_i16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi32_epi16&expand=1817)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm256_mask_cvtsepi32_epi16(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovsdw256(a.as_i32x8(), src.as_i16x8(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtsepi32_epi16&expand=1818)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm256_maskz_cvtsepi32_epi16(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovsdw256(a.as_i32x8(), _mm_setzero_si128().as_i16x8(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsepi32_epi16&expand=1813)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm_cvtsepi32_epi16(a: __m128i) -> __m128i {
+ transmute(vpmovsdw128(
+ a.as_i32x4(),
+ _mm_setzero_si128().as_i16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi32_epi16&expand=1814)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm_mask_cvtsepi32_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovsdw128(a.as_i32x4(), src.as_i16x8(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtsepi32_epi16&expand=1815)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm_maskz_cvtsepi32_epi16(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovsdw128(a.as_i32x4(), _mm_setzero_si128().as_i16x8(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtsepi32_epi8&expand=1828)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm512_cvtsepi32_epi8(a: __m512i) -> __m128i {
+ transmute(vpmovsdb(
+ a.as_i32x16(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111_11111111,
+ ))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi32_epi8&expand=1829)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm512_mask_cvtsepi32_epi8(src: __m128i, k: __mmask16, a: __m512i) -> __m128i {
+ transmute(vpmovsdb(a.as_i32x16(), src.as_i8x16(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtsepi32_epi8&expand=1830)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm512_maskz_cvtsepi32_epi8(k: __mmask16, a: __m512i) -> __m128i {
+ transmute(vpmovsdb(a.as_i32x16(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtsepi32_epi8&expand=1825)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm256_cvtsepi32_epi8(a: __m256i) -> __m128i {
+ transmute(vpmovsdb256(
+ a.as_i32x8(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi32_epi8&expand=1826)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm256_mask_cvtsepi32_epi8(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovsdb256(a.as_i32x8(), src.as_i8x16(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtsepi32_epi8&expand=1827)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm256_maskz_cvtsepi32_epi8(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovsdb256(a.as_i32x8(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsepi32_epi8&expand=1822)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm_cvtsepi32_epi8(a: __m128i) -> __m128i {
+ transmute(vpmovsdb128(
+ a.as_i32x4(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi32_epi8&expand=1823)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm_mask_cvtsepi32_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovsdb128(a.as_i32x4(), src.as_i8x16(), k))
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtsepi32_epi8&expand=1824)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm_maskz_cvtsepi32_epi8(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovsdb128(a.as_i32x4(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtsepi64_epi32&expand=1852)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm512_cvtsepi64_epi32(a: __m512i) -> __m256i {
+ transmute(vpmovsqd(
+ a.as_i64x8(),
+ _mm256_setzero_si256().as_i32x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi64_epi32&expand=1853)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm512_mask_cvtsepi64_epi32(src: __m256i, k: __mmask8, a: __m512i) -> __m256i {
+ transmute(vpmovsqd(a.as_i64x8(), src.as_i32x8(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtsepi64_epi32&expand=1854)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm512_maskz_cvtsepi64_epi32(k: __mmask8, a: __m512i) -> __m256i {
+ transmute(vpmovsqd(a.as_i64x8(), _mm256_setzero_si256().as_i32x8(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtsepi64_epi32&expand=1849)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm256_cvtsepi64_epi32(a: __m256i) -> __m128i {
+ transmute(vpmovsqd256(
+ a.as_i64x4(),
+ _mm_setzero_si128().as_i32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi64_epi32&expand=1850)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm256_mask_cvtsepi64_epi32(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovsqd256(a.as_i64x4(), src.as_i32x4(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtsepi64_epi32&expand=1851)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm256_maskz_cvtsepi64_epi32(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovsqd256(a.as_i64x4(), _mm_setzero_si128().as_i32x4(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsepi64_epi32&expand=1846)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm_cvtsepi64_epi32(a: __m128i) -> __m128i {
+ transmute(vpmovsqd128(
+ a.as_i64x2(),
+ _mm_setzero_si128().as_i32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi64_epi32&expand=1847)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm_mask_cvtsepi64_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovsqd128(a.as_i64x2(), src.as_i32x4(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtsepi64_epi32&expand=1848)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm_maskz_cvtsepi64_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovsqd128(a.as_i64x2(), _mm_setzero_si128().as_i32x4(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtsepi64_epi16&expand=1843)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm512_cvtsepi64_epi16(a: __m512i) -> __m128i {
+ transmute(vpmovsqw(
+ a.as_i64x8(),
+ _mm_setzero_si128().as_i16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi64_epi16&expand=1844)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm512_mask_cvtsepi64_epi16(src: __m128i, k: __mmask8, a: __m512i) -> __m128i {
+ transmute(vpmovsqw(a.as_i64x8(), src.as_i16x8(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtsepi64_epi16&expand=1845)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm512_maskz_cvtsepi64_epi16(k: __mmask8, a: __m512i) -> __m128i {
+ transmute(vpmovsqw(a.as_i64x8(), _mm_setzero_si128().as_i16x8(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtsepi64_epi16&expand=1840)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm256_cvtsepi64_epi16(a: __m256i) -> __m128i {
+ transmute(vpmovsqw256(
+ a.as_i64x4(),
+ _mm_setzero_si128().as_i16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi64_epi16&expand=1841)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm256_mask_cvtsepi64_epi16(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovsqw256(a.as_i64x4(), src.as_i16x8(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtsepi64_epi16&expand=1842)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm256_maskz_cvtsepi64_epi16(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovsqw256(a.as_i64x4(), _mm_setzero_si128().as_i16x8(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsepi64_epi16&expand=1837)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm_cvtsepi64_epi16(a: __m128i) -> __m128i {
+ transmute(vpmovsqw128(
+ a.as_i64x2(),
+ _mm_setzero_si128().as_i16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi64_epi16&expand=1838)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm_mask_cvtsepi64_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovsqw128(a.as_i64x2(), src.as_i16x8(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtsepi64_epi16&expand=1839)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm_maskz_cvtsepi64_epi16(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovsqw128(a.as_i64x2(), _mm_setzero_si128().as_i16x8(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtsepi64_epi8&expand=1861)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm512_cvtsepi64_epi8(a: __m512i) -> __m128i {
+ transmute(vpmovsqb(
+ a.as_i64x8(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi64_epi8&expand=1862)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm512_mask_cvtsepi64_epi8(src: __m128i, k: __mmask8, a: __m512i) -> __m128i {
+ transmute(vpmovsqb(a.as_i64x8(), src.as_i8x16(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtsepi64_epi8&expand=1863)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm512_maskz_cvtsepi64_epi8(k: __mmask8, a: __m512i) -> __m128i {
+ transmute(vpmovsqb(a.as_i64x8(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtsepi64_epi8&expand=1858)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm256_cvtsepi64_epi8(a: __m256i) -> __m128i {
+ transmute(vpmovsqb256(
+ a.as_i64x4(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi64_epi8&expand=1859)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm256_mask_cvtsepi64_epi8(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovsqb256(a.as_i64x4(), src.as_i8x16(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtsepi64_epi8&expand=1860)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm256_maskz_cvtsepi64_epi8(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovsqb256(a.as_i64x4(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsepi64_epi8&expand=1855)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm_cvtsepi64_epi8(a: __m128i) -> __m128i {
+ transmute(vpmovsqb128(
+ a.as_i64x2(),
+ _mm_setzero_si128().as_i8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi64_epi8&expand=1856)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm_mask_cvtsepi64_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovsqb128(a.as_i64x2(), src.as_i8x16(), k))
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtsepi64_epi8&expand=1857)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm_maskz_cvtsepi64_epi8(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovsqb128(a.as_i64x2(), _mm_setzero_si128().as_i8x16(), k))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtusepi32_epi16&expand=2054)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm512_cvtusepi32_epi16(a: __m512i) -> __m256i {
+ transmute(vpmovusdw(
+ a.as_u32x16(),
+ _mm256_setzero_si256().as_u16x16(),
+ 0b11111111_11111111,
+ ))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi32_epi16&expand=2055)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm512_mask_cvtusepi32_epi16(src: __m256i, k: __mmask16, a: __m512i) -> __m256i {
+ transmute(vpmovusdw(a.as_u32x16(), src.as_u16x16(), k))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtusepi32_epi16&expand=2056)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm512_maskz_cvtusepi32_epi16(k: __mmask16, a: __m512i) -> __m256i {
+ transmute(vpmovusdw(
+ a.as_u32x16(),
+ _mm256_setzero_si256().as_u16x16(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtusepi32_epi16&expand=2051)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm256_cvtusepi32_epi16(a: __m256i) -> __m128i {
+ transmute(vpmovusdw256(
+ a.as_u32x8(),
+ _mm_setzero_si128().as_u16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi32_epi16&expand=2052)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm256_mask_cvtusepi32_epi16(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovusdw256(a.as_u32x8(), src.as_u16x8(), k))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtusepi32_epi16&expand=2053)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm256_maskz_cvtusepi32_epi16(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovusdw256(
+ a.as_u32x8(),
+ _mm_setzero_si128().as_u16x8(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtusepi32_epi16&expand=2048)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm_cvtusepi32_epi16(a: __m128i) -> __m128i {
+ transmute(vpmovusdw128(
+ a.as_u32x4(),
+ _mm_setzero_si128().as_u16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi32_epi16&expand=2049)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm_mask_cvtusepi32_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovusdw128(a.as_u32x4(), src.as_u16x8(), k))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtusepi32_epi16&expand=2050)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm_maskz_cvtusepi32_epi16(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovusdw128(
+ a.as_u32x4(),
+ _mm_setzero_si128().as_u16x8(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtusepi32_epi8&expand=2063)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm512_cvtusepi32_epi8(a: __m512i) -> __m128i {
+ transmute(vpmovusdb(
+ a.as_u32x16(),
+ _mm_setzero_si128().as_u8x16(),
+ 0b11111111_11111111,
+ ))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi32_epi8&expand=2064)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm512_mask_cvtusepi32_epi8(src: __m128i, k: __mmask16, a: __m512i) -> __m128i {
+ transmute(vpmovusdb(a.as_u32x16(), src.as_u8x16(), k))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtusepi32_epi8&expand=2065)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm512_maskz_cvtusepi32_epi8(k: __mmask16, a: __m512i) -> __m128i {
+ transmute(vpmovusdb(a.as_u32x16(), _mm_setzero_si128().as_u8x16(), k))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtusepi32_epi8&expand=2060)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm256_cvtusepi32_epi8(a: __m256i) -> __m128i {
+ transmute(vpmovusdb256(
+ a.as_u32x8(),
+ _mm_setzero_si128().as_u8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi32_epi8&expand=2061)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm256_mask_cvtusepi32_epi8(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovusdb256(a.as_u32x8(), src.as_u8x16(), k))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtusepi32_epi8&expand=2062)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm256_maskz_cvtusepi32_epi8(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovusdb256(
+ a.as_u32x8(),
+ _mm_setzero_si128().as_u8x16(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtusepi32_epi8&expand=2057)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm_cvtusepi32_epi8(a: __m128i) -> __m128i {
+ transmute(vpmovusdb128(
+ a.as_u32x4(),
+ _mm_setzero_si128().as_u8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi32_epi8&expand=2058)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm_mask_cvtusepi32_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovusdb128(a.as_u32x4(), src.as_u8x16(), k))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtusepi32_epi8&expand=2059)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm_maskz_cvtusepi32_epi8(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovusdb128(
+ a.as_u32x4(),
+ _mm_setzero_si128().as_u8x16(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 32-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtusepi64_epi32&expand=2087)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm512_cvtusepi64_epi32(a: __m512i) -> __m256i {
+ transmute(vpmovusqd(
+ a.as_u64x8(),
+ _mm256_setzero_si256().as_u32x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 32-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi64_epi32&expand=2088)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm512_mask_cvtusepi64_epi32(src: __m256i, k: __mmask8, a: __m512i) -> __m256i {
+ transmute(vpmovusqd(a.as_u64x8(), src.as_u32x8(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 32-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtusepi64_epi32&expand=2089)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm512_maskz_cvtusepi64_epi32(k: __mmask8, a: __m512i) -> __m256i {
+ transmute(vpmovusqd(
+ a.as_u64x8(),
+ _mm256_setzero_si256().as_u32x8(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 32-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtusepi64_epi32&expand=2084)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm256_cvtusepi64_epi32(a: __m256i) -> __m128i {
+ transmute(vpmovusqd256(
+ a.as_u64x4(),
+ _mm_setzero_si128().as_u32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 32-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi64_epi32&expand=2085)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm256_mask_cvtusepi64_epi32(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovusqd256(a.as_u64x4(), src.as_u32x4(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 32-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtusepi64_epi32&expand=2086)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm256_maskz_cvtusepi64_epi32(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovusqd256(
+ a.as_u64x4(),
+ _mm_setzero_si128().as_u32x4(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 32-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtusepi64_epi32&expand=2081)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm_cvtusepi64_epi32(a: __m128i) -> __m128i {
+ transmute(vpmovusqd128(
+ a.as_u64x2(),
+ _mm_setzero_si128().as_u32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 32-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi64_epi32&expand=2082)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm_mask_cvtusepi64_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovusqd128(a.as_u64x2(), src.as_u32x4(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 32-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtusepi64_epi32&expand=2083)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm_maskz_cvtusepi64_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovusqd128(
+ a.as_u64x2(),
+ _mm_setzero_si128().as_u32x4(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtusepi64_epi16&expand=2078)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm512_cvtusepi64_epi16(a: __m512i) -> __m128i {
+ transmute(vpmovusqw(
+ a.as_u64x8(),
+ _mm_setzero_si128().as_u16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi64_epi16&expand=2079)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm512_mask_cvtusepi64_epi16(src: __m128i, k: __mmask8, a: __m512i) -> __m128i {
+ transmute(vpmovusqw(a.as_u64x8(), src.as_u16x8(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtusepi64_epi16&expand=2080)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm512_maskz_cvtusepi64_epi16(k: __mmask8, a: __m512i) -> __m128i {
+ transmute(vpmovusqw(a.as_u64x8(), _mm_setzero_si128().as_u16x8(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtusepi64_epi16&expand=2075)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm256_cvtusepi64_epi16(a: __m256i) -> __m128i {
+ transmute(vpmovusqw256(
+ a.as_u64x4(),
+ _mm_setzero_si128().as_u16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi64_epi16&expand=2076)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm256_mask_cvtusepi64_epi16(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovusqw256(a.as_u64x4(), src.as_u16x8(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtusepi64_epi16&expand=2077)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm256_maskz_cvtusepi64_epi16(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovusqw256(
+ a.as_u64x4(),
+ _mm_setzero_si128().as_u16x8(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtusepi64_epi16&expand=2072)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm_cvtusepi64_epi16(a: __m128i) -> __m128i {
+ transmute(vpmovusqw128(
+ a.as_u64x2(),
+ _mm_setzero_si128().as_u16x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi64_epi16&expand=2073)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm_mask_cvtusepi64_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovusqw128(a.as_u64x2(), src.as_u16x8(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtusepi64_epi16&expand=2074)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm_maskz_cvtusepi64_epi16(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovusqw128(
+ a.as_u64x2(),
+ _mm_setzero_si128().as_u16x8(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtusepi64_epi8&expand=2096)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm512_cvtusepi64_epi8(a: __m512i) -> __m128i {
+ transmute(vpmovusqb(
+ a.as_u64x8(),
+ _mm_setzero_si128().as_u8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi64_epi8&expand=2097)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm512_mask_cvtusepi64_epi8(src: __m128i, k: __mmask8, a: __m512i) -> __m128i {
+ transmute(vpmovusqb(a.as_u64x8(), src.as_u8x16(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtusepi64_epi8&expand=2098)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm512_maskz_cvtusepi64_epi8(k: __mmask8, a: __m512i) -> __m128i {
+ transmute(vpmovusqb(a.as_u64x8(), _mm_setzero_si128().as_u8x16(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtusepi64_epi8&expand=2093)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm256_cvtusepi64_epi8(a: __m256i) -> __m128i {
+ transmute(vpmovusqb256(
+ a.as_u64x4(),
+ _mm_setzero_si128().as_u8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi64_epi8&expand=2094)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm256_mask_cvtusepi64_epi8(src: __m128i, k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovusqb256(a.as_u64x4(), src.as_u8x16(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtusepi64_epi8&expand=2095)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm256_maskz_cvtusepi64_epi8(k: __mmask8, a: __m256i) -> __m128i {
+ transmute(vpmovusqb256(
+ a.as_u64x4(),
+ _mm_setzero_si128().as_u8x16(),
+ k,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtusepi64_epi8&expand=2090)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm_cvtusepi64_epi8(a: __m128i) -> __m128i {
+ transmute(vpmovusqb128(
+ a.as_u64x2(),
+ _mm_setzero_si128().as_u8x16(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi64_epi8&expand=2091)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm_mask_cvtusepi64_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovusqb128(a.as_u64x2(), src.as_u8x16(), k))
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtusepi64_epi8&expand=2092)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm_maskz_cvtusepi64_epi8(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpmovusqb128(
+ a.as_u64x2(),
+ _mm_setzero_si128().as_u8x16(),
+ k,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst.
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvt_roundps_epi32&expand=1335)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2dq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvt_roundps_epi32<const ROUNDING: i32>(a: __m512) -> __m512i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ let r = vcvtps2dq(a, zero, 0b11111111_11111111, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvt_roundps_epi32&expand=1336)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2dq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvt_roundps_epi32<const ROUNDING: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512,
+) -> __m512i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let src = src.as_i32x16();
+ let r = vcvtps2dq(a, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundps_epi32&expand=1337)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2dq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvt_roundps_epi32<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+) -> __m512i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ let r = vcvtps2dq(a, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvt_roundps_epu32&expand=1341)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2udq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvt_roundps_epu32<const ROUNDING: i32>(a: __m512) -> __m512i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_si512().as_u32x16();
+ let r = vcvtps2udq(a, zero, 0b11111111_11111111, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvt_roundps_epu32&expand=1342)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2udq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvt_roundps_epu32<const ROUNDING: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512,
+) -> __m512i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let src = src.as_u32x16();
+ let r = vcvtps2udq(a, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundps_epu32&expand=1343)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2udq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvt_roundps_epu32<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512,
+) -> __m512i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_si512().as_u32x16();
+ let r = vcvtps2udq(a, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed double-precision (64-bit) floating-point elements, and store the results in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvt_roundps_pd&expand=1347)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2pd, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvt_roundps_pd<const SAE: i32>(a: __m256) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vcvtps2pd(a, zero, 0b11111111, SAE);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvt_roundps_epi32&expand=1336)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2pd, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvt_roundps_pd<const SAE: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m256,
+) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x8();
+ let src = src.as_f64x8();
+ let r = vcvtps2pd(a, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed double-precision (64-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundps_epi32&expand=1337)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2pd, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvt_roundps_pd<const SAE: i32>(k: __mmask8, a: __m256) -> __m512d {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let r = vcvtps2pd(a, zero, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvt_roundpd_epi32&expand=1315)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvt_roundpd_epi32<const ROUNDING: i32>(a: __m512d) -> __m256i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ let r = vcvtpd2dq(a, zero, 0b11111111, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvt_roundpd_epi32&expand=1316)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvt_roundpd_epi32<const ROUNDING: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m512d,
+) -> __m256i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let src = src.as_i32x8();
+ let r = vcvtpd2dq(a, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundpd_epi32&expand=1317)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2dq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvt_roundpd_epi32<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+) -> __m256i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ let r = vcvtpd2dq(a, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvt_roundpd_epu32&expand=1321)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvt_roundpd_epu32<const ROUNDING: i32>(a: __m512d) -> __m256i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let zero = _mm256_setzero_si256().as_u32x8();
+ let r = vcvtpd2udq(a, zero, 0b11111111, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvt_roundpd_epu32&expand=1322)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvt_roundpd_epu32<const ROUNDING: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m512d,
+) -> __m256i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let src = src.as_u32x8();
+ let r = vcvtpd2udq(a, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundpd_epu32&expand=1323)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2udq, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvt_roundpd_epu32<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m512d,
+) -> __m256i {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let zero = _mm256_setzero_si256().as_u32x8();
+ let r = vcvtpd2udq(a, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvt_roundpd_ps&expand=1327)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvt_roundpd_ps<const ROUNDING: i32>(a: __m512d) -> __m256 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ let r = vcvtpd2ps(a, zero, 0b11111111, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvt_roundpd_ps&expand=1328)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvt_roundpd_ps<const ROUNDING: i32>(
+ src: __m256,
+ k: __mmask8,
+ a: __m512d,
+) -> __m256 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let src = src.as_f32x8();
+ let r = vcvtpd2ps(a, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundpd_ps&expand=1329)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtpd2ps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvt_roundpd_ps<const ROUNDING: i32>(k: __mmask8, a: __m512d) -> __m256 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ let r = vcvtpd2ps(a, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed signed 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvt_roundepi32_ps&expand=1294)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvt_roundepi32_ps<const ROUNDING: i32>(a: __m512i) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_i32x16();
+ let r = vcvtdq2ps(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed signed 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvt_roundepi32_ps&expand=1295)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvt_roundepi32_ps<const ROUNDING: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512i,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_i32x16();
+ let r = vcvtdq2ps(a, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f32x16()))
+}
+
+/// Convert packed signed 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundepi32_ps&expand=1296)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtdq2ps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvt_roundepi32_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512i,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_i32x16();
+ let r = vcvtdq2ps(a, ROUNDING);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvt_roundepu32_ps&expand=1303)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2ps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvt_roundepu32_ps<const ROUNDING: i32>(a: __m512i) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_u32x16();
+ let r = vcvtudq2ps(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvt_roundepu32_ps&expand=1304)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2ps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvt_roundepu32_ps<const ROUNDING: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512i,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_u32x16();
+ let r = vcvtudq2ps(a, ROUNDING);
+ transmute(simd_select_bitmask(k, r, src.as_f32x16()))
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundepu32_ps&expand=1305)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtudq2ps, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvt_roundepu32_ps<const ROUNDING: i32>(
+ k: __mmask16,
+ a: __m512i,
+) -> __m512 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_u32x16();
+ let r = vcvtudq2ps(a, ROUNDING);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvt_roundps_ph&expand=1354)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvt_roundps_ph<const SAE: i32>(a: __m512) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm256_setzero_si256().as_i16x16();
+ let r = vcvtps2ph(a, SAE, zero, 0b11111111_11111111);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvt_roundps_ph&expand=1355)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvt_roundps_ph<const SAE: i32>(
+ src: __m256i,
+ k: __mmask16,
+ a: __m512,
+) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let src = src.as_i16x16();
+ let r = vcvtps2ph(a, SAE, src, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundps_ph&expand=1356)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvt_roundps_ph<const SAE: i32>(k: __mmask16, a: __m512) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm256_setzero_si256().as_i16x16();
+ let r = vcvtps2ph(a, SAE, zero, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvt_roundps_ph&expand=1352)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, IMM8 = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_cvt_roundps_ph<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m256,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x8();
+ let src = src.as_i16x8();
+ let r = vcvtps2ph256(a, IMM8, src, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvt_roundps_ph&expand=1353)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, IMM8 = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_cvt_roundps_ph<const IMM8: i32>(k: __mmask8, a: __m256) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x8();
+ let zero = _mm_setzero_si128().as_i16x8();
+ let r = vcvtps2ph256(a, IMM8, zero, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvt_roundps_ph&expand=1350)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, IMM8 = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_cvt_roundps_ph<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let src = src.as_i16x8();
+ let r = vcvtps2ph128(a, IMM8, src, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvt_roundps_ph&expand=1351)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, IMM8 = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_cvt_roundps_ph<const IMM8: i32>(k: __mmask8, a: __m128) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let zero = _mm_setzero_si128().as_i16x8();
+ let r = vcvtps2ph128(a, IMM8, zero, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtps_ph&expand=1778)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvtps_ph<const SAE: i32>(a: __m512) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm256_setzero_si256().as_i16x16();
+ let r = vcvtps2ph(a, SAE, zero, 0b11111111_11111111);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtps_ph&expand=1779)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvtps_ph<const SAE: i32>(
+ src: __m256i,
+ k: __mmask16,
+ a: __m512,
+) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let src = src.as_i16x16();
+ let r = vcvtps2ph(a, SAE, src, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtps_ph&expand=1780)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvtps_ph<const SAE: i32>(k: __mmask16, a: __m512) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm256_setzero_si256().as_i16x16();
+ let r = vcvtps2ph(a, SAE, zero, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtps_ph&expand=1776)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, IMM8 = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_cvtps_ph<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m256,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x8();
+ let src = src.as_i16x8();
+ let r = vcvtps2ph256(a, IMM8, src, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtps_ph&expand=1777)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, IMM8 = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_cvtps_ph<const IMM8: i32>(k: __mmask8, a: __m256) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x8();
+ let zero = _mm_setzero_si128().as_i16x8();
+ let r = vcvtps2ph256(a, IMM8, zero, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtps_ph&expand=1773)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, IMM8 = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_cvtps_ph<const IMM8: i32>(src: __m128i, k: __mmask8, a: __m128) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let src = src.as_i16x8();
+ let r = vcvtps2ph128(a, IMM8, src, k);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed half-precision (16-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtps_ph&expand=1774)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtps2ph, IMM8 = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_cvtps_ph<const IMM8: i32>(k: __mmask8, a: __m128) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let zero = _mm_setzero_si128().as_i16x8();
+ let r = vcvtps2ph128(a, IMM8, zero, k);
+ transmute(r)
+}
+
+/// Convert packed half-precision (16-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvt_roundph_ps&expand=1332)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtph2ps, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvt_roundph_ps<const SAE: i32>(a: __m256i) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_i16x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vcvtph2ps(a, zero, 0b11111111_11111111, SAE);
+ transmute(r)
+}
+
+/// Convert packed half-precision (16-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvt_roundph_ps&expand=1333)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtph2ps, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvt_roundph_ps<const SAE: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m256i,
+) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_i16x16();
+ let src = src.as_f32x16();
+ let r = vcvtph2ps(a, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed half-precision (16-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvt_roundph_ps&expand=1334)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtph2ps, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvt_roundph_ps<const SAE: i32>(k: __mmask16, a: __m256i) -> __m512 {
+ static_assert_sae!(SAE);
+ let a = a.as_i16x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let r = vcvtph2ps(a, zero, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed half-precision (16-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtph_ps&expand=1723)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtph2ps))]
+pub unsafe fn _mm512_cvtph_ps(a: __m256i) -> __m512 {
+ transmute(vcvtph2ps(
+ a.as_i16x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ 0b11111111_11111111,
+ _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Convert packed half-precision (16-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtph_ps&expand=1724)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtph2ps))]
+pub unsafe fn _mm512_mask_cvtph_ps(src: __m512, k: __mmask16, a: __m256i) -> __m512 {
+ transmute(vcvtph2ps(
+ a.as_i16x16(),
+ src.as_f32x16(),
+ k,
+ _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Convert packed half-precision (16-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtph_ps&expand=1725)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtph2ps))]
+pub unsafe fn _mm512_maskz_cvtph_ps(k: __mmask16, a: __m256i) -> __m512 {
+ transmute(vcvtph2ps(
+ a.as_i16x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ k,
+ _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Convert packed half-precision (16-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtph_ps&expand=1721)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtph2ps))]
+pub unsafe fn _mm256_mask_cvtph_ps(src: __m256, k: __mmask8, a: __m128i) -> __m256 {
+ let convert = _mm256_cvtph_ps(a);
+ transmute(simd_select_bitmask(k, convert.as_f32x8(), src.as_f32x8()))
+}
+
+/// Convert packed half-precision (16-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvtph_ps&expand=1722)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtph2ps))]
+pub unsafe fn _mm256_maskz_cvtph_ps(k: __mmask8, a: __m128i) -> __m256 {
+ let convert = _mm256_cvtph_ps(a);
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, convert.as_f32x8(), zero))
+}
+
+/// Convert packed half-precision (16-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtph_ps&expand=1718)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtph2ps))]
+pub unsafe fn _mm_mask_cvtph_ps(src: __m128, k: __mmask8, a: __m128i) -> __m128 {
+ let convert = _mm_cvtph_ps(a);
+ transmute(simd_select_bitmask(k, convert.as_f32x4(), src.as_f32x4()))
+}
+
+/// Convert packed half-precision (16-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvtph_ps&expand=1719)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvtph2ps))]
+pub unsafe fn _mm_maskz_cvtph_ps(k: __mmask8, a: __m128i) -> __m128 {
+ let convert = _mm_cvtph_ps(a);
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, convert.as_f32x4(), zero))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtt_roundps_epi32&expand=1916)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2dq, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvtt_roundps_epi32<const SAE: i32>(a: __m512) -> __m512i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ let r = vcvttps2dq(a, zero, 0b11111111_11111111, SAE);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtt_roundps_epi32&expand=1917)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2dq, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvtt_roundps_epi32<const SAE: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512,
+) -> __m512i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let src = src.as_i32x16();
+ let r = vcvttps2dq(a, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtt_roundps_epi32&expand=1918)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2dq, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvtt_roundps_epi32<const SAE: i32>(k: __mmask16, a: __m512) -> __m512i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ let r = vcvttps2dq(a, zero, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtt_roundps_epu32&expand=1922)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2udq, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvtt_roundps_epu32<const SAE: i32>(a: __m512) -> __m512i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_si512().as_u32x16();
+ let r = vcvttps2udq(a, zero, 0b11111111_11111111, SAE);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtt_roundps_epu32&expand=1923)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2udq, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvtt_roundps_epu32<const SAE: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512,
+) -> __m512i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let src = src.as_u32x16();
+ let r = vcvttps2udq(a, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtt_roundps_epu32&expand=1924)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2udq, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvtt_roundps_epu32<const SAE: i32>(k: __mmask16, a: __m512) -> __m512i {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x16();
+ let zero = _mm512_setzero_si512().as_u32x16();
+ let r = vcvttps2udq(a, zero, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtt_roundpd_epi32&expand=1904)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvtt_roundpd_epi32<const SAE: i32>(a: __m512d) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ let r = vcvttpd2dq(a, zero, 0b11111111, SAE);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtt_roundpd_epi32&expand=1905)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvtt_roundpd_epi32<const SAE: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m512d,
+) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let src = src.as_i32x8();
+ let r = vcvttpd2dq(a, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtt_roundps_epi32&expand=1918)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvtt_roundpd_epi32<const SAE: i32>(k: __mmask8, a: __m512d) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ let r = vcvttpd2dq(a, zero, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtt_roundpd_epu32&expand=1910)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_cvtt_roundpd_epu32<const SAE: i32>(a: __m512d) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ let r = vcvttpd2udq(a, zero, 0b11111111, SAE);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtt_roundpd_epu32&expand=1911)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_cvtt_roundpd_epu32<const SAE: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m512d,
+) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let src = src.as_i32x8();
+ let r = vcvttpd2udq(a, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvttps_epi32&expand=1984)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2dq))]
+pub unsafe fn _mm512_cvttps_epi32(a: __m512) -> __m512i {
+ transmute(vcvttps2dq(
+ a.as_f32x16(),
+ _mm512_setzero_si512().as_i32x16(),
+ 0b11111111_11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvttps_epi32&expand=1985)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2dq))]
+pub unsafe fn _mm512_mask_cvttps_epi32(src: __m512i, k: __mmask16, a: __m512) -> __m512i {
+ transmute(vcvttps2dq(
+ a.as_f32x16(),
+ src.as_i32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvttps_epi32&expand=1986)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2dq))]
+pub unsafe fn _mm512_maskz_cvttps_epi32(k: __mmask16, a: __m512) -> __m512i {
+ transmute(vcvttps2dq(
+ a.as_f32x16(),
+ _mm512_setzero_si512().as_i32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvttps_epi32&expand=1982)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttps2dq))]
+pub unsafe fn _mm256_mask_cvttps_epi32(src: __m256i, k: __mmask8, a: __m256) -> __m256i {
+ transmute(vcvttps2dq256(a.as_f32x8(), src.as_i32x8(), k))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvttps_epi32&expand=1983)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttps2dq))]
+pub unsafe fn _mm256_maskz_cvttps_epi32(k: __mmask8, a: __m256) -> __m256i {
+ transmute(vcvttps2dq256(
+ a.as_f32x8(),
+ _mm256_setzero_si256().as_i32x8(),
+ k,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvttps_epi32&expand=1979)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttps2dq))]
+pub unsafe fn _mm_mask_cvttps_epi32(src: __m128i, k: __mmask8, a: __m128) -> __m128i {
+ transmute(vcvttps2dq128(a.as_f32x4(), src.as_i32x4(), k))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvttps_epi32&expand=1980)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttps2dq))]
+pub unsafe fn _mm_maskz_cvttps_epi32(k: __mmask8, a: __m128) -> __m128i {
+ transmute(vcvttps2dq128(
+ a.as_f32x4(),
+ _mm_setzero_si128().as_i32x4(),
+ k,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvttps_epu32&expand=2002)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2udq))]
+pub unsafe fn _mm512_cvttps_epu32(a: __m512) -> __m512i {
+ transmute(vcvttps2udq(
+ a.as_f32x16(),
+ _mm512_setzero_si512().as_u32x16(),
+ 0b11111111_11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvttps_epu32&expand=2003)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2udq))]
+pub unsafe fn _mm512_mask_cvttps_epu32(src: __m512i, k: __mmask16, a: __m512) -> __m512i {
+ transmute(vcvttps2udq(
+ a.as_f32x16(),
+ src.as_u32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvttps_epu32&expand=2004)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttps2udq))]
+pub unsafe fn _mm512_maskz_cvttps_epu32(k: __mmask16, a: __m512) -> __m512i {
+ transmute(vcvttps2udq(
+ a.as_f32x16(),
+ _mm512_setzero_si512().as_u32x16(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvttps_epu32&expand=1999)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttps2udq))]
+pub unsafe fn _mm256_cvttps_epu32(a: __m256) -> __m256i {
+ transmute(vcvttps2udq256(
+ a.as_f32x8(),
+ _mm256_setzero_si256().as_u32x8(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed double-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvttps_epu32&expand=2000)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttps2udq))]
+pub unsafe fn _mm256_mask_cvttps_epu32(src: __m256i, k: __mmask8, a: __m256) -> __m256i {
+ transmute(vcvttps2udq256(a.as_f32x8(), src.as_u32x8(), k))
+}
+
+/// Convert packed double-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvttps_epu32&expand=2001)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttps2udq))]
+pub unsafe fn _mm256_maskz_cvttps_epu32(k: __mmask8, a: __m256) -> __m256i {
+ transmute(vcvttps2udq256(
+ a.as_f32x8(),
+ _mm256_setzero_si256().as_u32x8(),
+ k,
+ ))
+}
+
+/// Convert packed single-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttps_epu32&expand=1996)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttps2udq))]
+pub unsafe fn _mm_cvttps_epu32(a: __m128) -> __m128i {
+ transmute(vcvttps2udq128(
+ a.as_f32x4(),
+ _mm_setzero_si128().as_u32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed double-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvttps_epu32&expand=1997)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttps2udq))]
+pub unsafe fn _mm_mask_cvttps_epu32(src: __m128i, k: __mmask8, a: __m128) -> __m128i {
+ transmute(vcvttps2udq128(a.as_f32x4(), src.as_u32x4(), k))
+}
+
+/// Convert packed double-precision (32-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvttps_epu32&expand=1998)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttps2udq))]
+pub unsafe fn _mm_maskz_cvttps_epu32(k: __mmask8, a: __m128) -> __m128i {
+ transmute(vcvttps2udq128(
+ a.as_f32x4(),
+ _mm_setzero_si128().as_u32x4(),
+ k,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvtt_roundpd_epu32&expand=1912)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_cvtt_roundpd_epu32<const SAE: i32>(k: __mmask8, a: __m512d) -> __m256i {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ let r = vcvttpd2udq(a, zero, k, SAE);
+ transmute(r)
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvttpd_epi32&expand=1947)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq))]
+pub unsafe fn _mm512_cvttpd_epi32(a: __m512d) -> __m256i {
+ transmute(vcvttpd2dq(
+ a.as_f64x8(),
+ _mm256_setzero_si256().as_i32x8(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvttpd_epi32&expand=1948)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq))]
+pub unsafe fn _mm512_mask_cvttpd_epi32(src: __m256i, k: __mmask8, a: __m512d) -> __m256i {
+ transmute(vcvttpd2dq(
+ a.as_f64x8(),
+ src.as_i32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvttpd_epi32&expand=1949)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq))]
+pub unsafe fn _mm512_maskz_cvttpd_epi32(k: __mmask8, a: __m512d) -> __m256i {
+ transmute(vcvttpd2dq(
+ a.as_f64x8(),
+ _mm256_setzero_si256().as_i32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvttpd_epi32&expand=1945)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq))]
+pub unsafe fn _mm256_mask_cvttpd_epi32(src: __m128i, k: __mmask8, a: __m256d) -> __m128i {
+ transmute(vcvttpd2dq256(a.as_f64x4(), src.as_i32x4(), k))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvttpd_epi32&expand=1946)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq))]
+pub unsafe fn _mm256_maskz_cvttpd_epi32(k: __mmask8, a: __m256d) -> __m128i {
+ transmute(vcvttpd2dq256(
+ a.as_f64x4(),
+ _mm_setzero_si128().as_i32x4(),
+ k,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvttpd_epi32&expand=1942)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq))]
+pub unsafe fn _mm_mask_cvttpd_epi32(src: __m128i, k: __mmask8, a: __m128d) -> __m128i {
+ transmute(vcvttpd2dq128(a.as_f64x2(), src.as_i32x4(), k))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvttpd_epi32&expand=1943)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttpd2dq))]
+pub unsafe fn _mm_maskz_cvttpd_epi32(k: __mmask8, a: __m128d) -> __m128i {
+ transmute(vcvttpd2dq128(
+ a.as_f64x2(),
+ _mm_setzero_si128().as_i32x4(),
+ k,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvttpd_epu32&expand=1965)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq))]
+pub unsafe fn _mm512_cvttpd_epu32(a: __m512d) -> __m256i {
+ transmute(vcvttpd2udq(
+ a.as_f64x8(),
+ _mm256_setzero_si256().as_i32x8(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvttpd_epu32&expand=1966)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq))]
+pub unsafe fn _mm512_mask_cvttpd_epu32(src: __m256i, k: __mmask8, a: __m512d) -> __m256i {
+ transmute(vcvttpd2udq(
+ a.as_f64x8(),
+ src.as_i32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_cvttpd_epu32&expand=1967)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq))]
+pub unsafe fn _mm512_maskz_cvttpd_epu32(k: __mmask8, a: __m512d) -> __m256i {
+ transmute(vcvttpd2udq(
+ a.as_f64x8(),
+ _mm256_setzero_si256().as_i32x8(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvttpd_epu32&expand=1962)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq))]
+pub unsafe fn _mm256_cvttpd_epu32(a: __m256d) -> __m128i {
+ transmute(vcvttpd2udq256(
+ a.as_f64x4(),
+ _mm_setzero_si128().as_i32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvttpd_epu32&expand=1963)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq))]
+pub unsafe fn _mm256_mask_cvttpd_epu32(src: __m128i, k: __mmask8, a: __m256d) -> __m128i {
+ transmute(vcvttpd2udq256(a.as_f64x4(), src.as_i32x4(), k))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_cvttpd_epu32&expand=1964)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq))]
+pub unsafe fn _mm256_maskz_cvttpd_epu32(k: __mmask8, a: __m256d) -> __m128i {
+ transmute(vcvttpd2udq256(
+ a.as_f64x4(),
+ _mm_setzero_si128().as_i32x4(),
+ k,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttpd_epu32&expand=1959)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq))]
+pub unsafe fn _mm_cvttpd_epu32(a: __m128d) -> __m128i {
+ transmute(vcvttpd2udq128(
+ a.as_f64x2(),
+ _mm_setzero_si128().as_i32x4(),
+ 0b11111111,
+ ))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvttpd_epu32&expand=1960)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq))]
+pub unsafe fn _mm_mask_cvttpd_epu32(src: __m128i, k: __mmask8, a: __m128d) -> __m128i {
+ transmute(vcvttpd2udq128(a.as_f64x2(), src.as_i32x4(), k))
+}
+
+/// Convert packed double-precision (64-bit) floating-point elements in a to packed unsigned 32-bit integers with truncation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_cvttpd_epu32&expand=1961)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcvttpd2udq))]
+pub unsafe fn _mm_maskz_cvttpd_epu32(k: __mmask8, a: __m128d) -> __m128i {
+ transmute(vcvttpd2udq128(
+ a.as_f64x2(),
+ _mm_setzero_si128().as_i32x4(),
+ k,
+ ))
+}
+
+/// Returns vector of type `__m512d` with all elements set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setzero_pd&expand=5018)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vxorps))]
+pub unsafe fn _mm512_setzero_pd() -> __m512d {
+ // All-0 is a properly initialized __m512d
+ mem::zeroed()
+}
+
+/// Returns vector of type `__m512d` with all elements set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setzero_ps&expand=5021)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vxorps))]
+pub unsafe fn _mm512_setzero_ps() -> __m512 {
+ // All-0 is a properly initialized __m512
+ mem::zeroed()
+}
+
+/// Return vector of type __m512 with all elements set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setzero&expand=5014)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vxorps))]
+pub unsafe fn _mm512_setzero() -> __m512 {
+ // All-0 is a properly initialized __m512
+ mem::zeroed()
+}
+
+/// Returns vector of type `__m512i` with all elements set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setzero_si512&expand=5024)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vxorps))]
+pub unsafe fn _mm512_setzero_si512() -> __m512i {
+ // All-0 is a properly initialized __m512i
+ mem::zeroed()
+}
+
+/// Return vector of type __m512i with all elements set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setzero_epi32&expand=5015)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vxorps))]
+pub unsafe fn _mm512_setzero_epi32() -> __m512i {
+ // All-0 is a properly initialized __m512i
+ mem::zeroed()
+}
+
+/// Sets packed 32-bit integers in `dst` with the supplied values in reverse
+/// order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setr_epi32&expand=4991)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_setr_epi32(
+ e15: i32,
+ e14: i32,
+ e13: i32,
+ e12: i32,
+ e11: i32,
+ e10: i32,
+ e9: i32,
+ e8: i32,
+ e7: i32,
+ e6: i32,
+ e5: i32,
+ e4: i32,
+ e3: i32,
+ e2: i32,
+ e1: i32,
+ e0: i32,
+) -> __m512i {
+ let r = i32x16(
+ e15, e14, e13, e12, e11, e10, e9, e8, e7, e6, e5, e4, e3, e2, e1, e0,
+ );
+ transmute(r)
+}
+
+/// Set packed 8-bit integers in dst with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set_epi8&expand=4915)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set_epi8(
+ e63: i8,
+ e62: i8,
+ e61: i8,
+ e60: i8,
+ e59: i8,
+ e58: i8,
+ e57: i8,
+ e56: i8,
+ e55: i8,
+ e54: i8,
+ e53: i8,
+ e52: i8,
+ e51: i8,
+ e50: i8,
+ e49: i8,
+ e48: i8,
+ e47: i8,
+ e46: i8,
+ e45: i8,
+ e44: i8,
+ e43: i8,
+ e42: i8,
+ e41: i8,
+ e40: i8,
+ e39: i8,
+ e38: i8,
+ e37: i8,
+ e36: i8,
+ e35: i8,
+ e34: i8,
+ e33: i8,
+ e32: i8,
+ e31: i8,
+ e30: i8,
+ e29: i8,
+ e28: i8,
+ e27: i8,
+ e26: i8,
+ e25: i8,
+ e24: i8,
+ e23: i8,
+ e22: i8,
+ e21: i8,
+ e20: i8,
+ e19: i8,
+ e18: i8,
+ e17: i8,
+ e16: i8,
+ e15: i8,
+ e14: i8,
+ e13: i8,
+ e12: i8,
+ e11: i8,
+ e10: i8,
+ e9: i8,
+ e8: i8,
+ e7: i8,
+ e6: i8,
+ e5: i8,
+ e4: i8,
+ e3: i8,
+ e2: i8,
+ e1: i8,
+ e0: i8,
+) -> __m512i {
+ let r = i8x64(
+ e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19,
+ e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37,
+ e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55,
+ e56, e57, e58, e59, e60, e61, e62, e63,
+ );
+ transmute(r)
+}
+
+/// Set packed 16-bit integers in dst with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set_epi16&expand=4905)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set_epi16(
+ e31: i16,
+ e30: i16,
+ e29: i16,
+ e28: i16,
+ e27: i16,
+ e26: i16,
+ e25: i16,
+ e24: i16,
+ e23: i16,
+ e22: i16,
+ e21: i16,
+ e20: i16,
+ e19: i16,
+ e18: i16,
+ e17: i16,
+ e16: i16,
+ e15: i16,
+ e14: i16,
+ e13: i16,
+ e12: i16,
+ e11: i16,
+ e10: i16,
+ e9: i16,
+ e8: i16,
+ e7: i16,
+ e6: i16,
+ e5: i16,
+ e4: i16,
+ e3: i16,
+ e2: i16,
+ e1: i16,
+ e0: i16,
+) -> __m512i {
+ let r = i16x32(
+ e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19,
+ e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31,
+ );
+ transmute(r)
+}
+
+/// Set packed 32-bit integers in dst with the repeated 4 element sequence.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set4_epi32&expand=4982)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set4_epi32(d: i32, c: i32, b: i32, a: i32) -> __m512i {
+ _mm512_set_epi32(d, c, b, a, d, c, b, a, d, c, b, a, d, c, b, a)
+}
+
+/// Set packed single-precision (32-bit) floating-point elements in dst with the repeated 4 element sequence.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set4_ps&expand=4985)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set4_ps(d: f32, c: f32, b: f32, a: f32) -> __m512 {
+ _mm512_set_ps(d, c, b, a, d, c, b, a, d, c, b, a, d, c, b, a)
+}
+
+/// Set packed double-precision (64-bit) floating-point elements in dst with the repeated 4 element sequence.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set4_pd&expand=4984)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set4_pd(d: f64, c: f64, b: f64, a: f64) -> __m512d {
+ _mm512_set_pd(d, c, b, a, d, c, b, a)
+}
+
+/// Set packed 32-bit integers in dst with the repeated 4 element sequence in reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setr4_epi32&expand=5009)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_setr4_epi32(d: i32, c: i32, b: i32, a: i32) -> __m512i {
+ _mm512_set_epi32(a, b, c, d, a, b, c, d, a, b, c, d, a, b, c, d)
+}
+
+/// Set packed single-precision (32-bit) floating-point elements in dst with the repeated 4 element sequence in reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setr4_ps&expand=5012)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_setr4_ps(d: f32, c: f32, b: f32, a: f32) -> __m512 {
+ _mm512_set_ps(a, b, c, d, a, b, c, d, a, b, c, d, a, b, c, d)
+}
+
+/// Set packed double-precision (64-bit) floating-point elements in dst with the repeated 4 element sequence in reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setr4_pd&expand=5011)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_setr4_pd(d: f64, c: f64, b: f64, a: f64) -> __m512d {
+ _mm512_set_pd(a, b, c, d, a, b, c, d)
+}
+
+/// Set packed 64-bit integers in dst with the supplied values.
+///
+/// [Intel's documentation]( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set_epi64&expand=4910)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set_epi64(
+ e0: i64,
+ e1: i64,
+ e2: i64,
+ e3: i64,
+ e4: i64,
+ e5: i64,
+ e6: i64,
+ e7: i64,
+) -> __m512i {
+ _mm512_setr_epi64(e7, e6, e5, e4, e3, e2, e1, e0)
+}
+
+/// Set packed 64-bit integers in dst with the supplied values in reverse order.
+///
+/// [Intel's documentation]( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setr_epi64&expand=4993)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_setr_epi64(
+ e0: i64,
+ e1: i64,
+ e2: i64,
+ e3: i64,
+ e4: i64,
+ e5: i64,
+ e6: i64,
+ e7: i64,
+) -> __m512i {
+ let r = i64x8::new(e0, e1, e2, e3, e4, e5, e6, e7);
+ transmute(r)
+}
+
+/// Gather double-precision (64-bit) floating-point elements from memory using 32-bit indices. 64-bit elements are loaded from addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst. scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i32gather_pd&expand=3002)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgatherdpd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_i32gather_pd<const SCALE: i32>(offsets: __m256i, slice: *const u8) -> __m512d {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let neg_one = -1;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i32x8();
+ let r = vgatherdpd(zero, slice, offsets, neg_one, SCALE);
+ transmute(r)
+}
+
+/// Gather double-precision (64-bit) floating-point elements from memory using 32-bit indices. 64-bit elements are loaded from addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst using writemask k (elements are copied from src when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i32gather_pd&expand=3003)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgatherdpd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i32gather_pd<const SCALE: i32>(
+ src: __m512d,
+ mask: __mmask8,
+ offsets: __m256i,
+ slice: *const u8,
+) -> __m512d {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f64x8();
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i32x8();
+ let r = vgatherdpd(src, slice, offsets, mask as i8, SCALE);
+ transmute(r)
+}
+
+/// Gather double-precision (64-bit) floating-point elements from memory using 64-bit indices. 64-bit elements are loaded from addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst. scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i64gather_pd&expand=3092)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgatherqpd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_i64gather_pd<const SCALE: i32>(offsets: __m512i, slice: *const u8) -> __m512d {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ let neg_one = -1;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x8();
+ let r = vgatherqpd(zero, slice, offsets, neg_one, SCALE);
+ transmute(r)
+}
+
+/// Gather double-precision (64-bit) floating-point elements from memory using 64-bit indices. 64-bit elements are loaded from addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst using writemask k (elements are copied from src when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i64gather_pd&expand=3093)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgatherqpd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i64gather_pd<const SCALE: i32>(
+ src: __m512d,
+ mask: __mmask8,
+ offsets: __m512i,
+ slice: *const u8,
+) -> __m512d {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f64x8();
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x8();
+ let r = vgatherqpd(src, slice, offsets, mask as i8, SCALE);
+ transmute(r)
+}
+
+/// Gather single-precision (32-bit) floating-point elements from memory using 64-bit indices. 32-bit elements are loaded from addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst. scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i64gather_ps&expand=3100)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgatherqps, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_i64gather_ps<const SCALE: i32>(offsets: __m512i, slice: *const u8) -> __m256 {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm256_setzero_ps().as_f32x8();
+ let neg_one = -1;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x8();
+ let r = vgatherqps(zero, slice, offsets, neg_one, SCALE);
+ transmute(r)
+}
+
+/// Gather single-precision (32-bit) floating-point elements from memory using 64-bit indices. 32-bit elements are loaded from addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst using writemask k (elements are copied from src when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i64gather_ps&expand=3101)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgatherqps, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i64gather_ps<const SCALE: i32>(
+ src: __m256,
+ mask: __mmask8,
+ offsets: __m512i,
+ slice: *const u8,
+) -> __m256 {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f32x8();
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x8();
+ let r = vgatherqps(src, slice, offsets, mask as i8, SCALE);
+ transmute(r)
+}
+
+/// Gather single-precision (32-bit) floating-point elements from memory using 32-bit indices. 32-bit elements are loaded from addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst. scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i32gather_ps&expand=3010)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgatherdps, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_i32gather_ps<const SCALE: i32>(offsets: __m512i, slice: *const u8) -> __m512 {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ let neg_one = -1;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i32x16();
+ let r = vgatherdps(zero, slice, offsets, neg_one, SCALE);
+ transmute(r)
+}
+
+/// Gather single-precision (32-bit) floating-point elements from memory using 32-bit indices. 32-bit elements are loaded from addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst using writemask k (elements are copied from src when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i32gather_ps&expand=3011)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgatherdps, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i32gather_ps<const SCALE: i32>(
+ src: __m512,
+ mask: __mmask16,
+ offsets: __m512i,
+ slice: *const u8,
+) -> __m512 {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f32x16();
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i32x16();
+ let r = vgatherdps(src, slice, offsets, mask as i16, SCALE);
+ transmute(r)
+}
+
+/// Gather 32-bit integers from memory using 32-bit indices. 32-bit elements are loaded from addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst. scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i32gather_epi32&expand=2986)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpgatherdd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_i32gather_epi32<const SCALE: i32>(
+ offsets: __m512i,
+ slice: *const u8,
+) -> __m512i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ let neg_one = -1;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i32x16();
+ let r = vpgatherdd(zero, slice, offsets, neg_one, SCALE);
+ transmute(r)
+}
+
+/// Gather 32-bit integers from memory using 32-bit indices. 32-bit elements are loaded from addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst using writemask k (elements are copied from src when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i32gather_epi32&expand=2987)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpgatherdd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i32gather_epi32<const SCALE: i32>(
+ src: __m512i,
+ mask: __mmask16,
+ offsets: __m512i,
+ slice: *const u8,
+) -> __m512i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i32x16();
+ let mask = mask as i16;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i32x16();
+ let r = vpgatherdd(src, slice, offsets, mask, SCALE);
+ transmute(r)
+}
+
+/// Gather 64-bit integers from memory using 32-bit indices. 64-bit elements are loaded from addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst. scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i32gather_epi64&expand=2994)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpgatherdq, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_i32gather_epi64<const SCALE: i32>(
+ offsets: __m256i,
+ slice: *const u8,
+) -> __m512i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ let neg_one = -1;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i32x8();
+ let r = vpgatherdq(zero, slice, offsets, neg_one, SCALE);
+ transmute(r)
+}
+
+/// Gather 64-bit integers from memory using 32-bit indices. 64-bit elements are loaded from addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst using writemask k (elements are copied from src when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i32gather_epi64&expand=2995)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpgatherdq, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i32gather_epi64<const SCALE: i32>(
+ src: __m512i,
+ mask: __mmask8,
+ offsets: __m256i,
+ slice: *const u8,
+) -> __m512i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i64x8();
+ let mask = mask as i8;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i32x8();
+ let r = vpgatherdq(src, slice, offsets, mask, SCALE);
+ transmute(r)
+}
+
+/// Gather 64-bit integers from memory using 64-bit indices. 64-bit elements are loaded from addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst. scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i64gather_epi64&expand=3084)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpgatherqq, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_i64gather_epi64<const SCALE: i32>(
+ offsets: __m512i,
+ slice: *const u8,
+) -> __m512i {
+ static_assert_imm8_scale!(SCALE);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ let neg_one = -1;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x8();
+ let r = vpgatherqq(zero, slice, offsets, neg_one, SCALE);
+ transmute(r)
+}
+
+/// Gather 64-bit integers from memory using 64-bit indices. 64-bit elements are loaded from addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst using writemask k (elements are copied from src when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i64gather_epi64&expand=3085)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpgatherqq, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i64gather_epi64<const SCALE: i32>(
+ src: __m512i,
+ mask: __mmask8,
+ offsets: __m512i,
+ slice: *const u8,
+) -> __m512i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i64x8();
+ let mask = mask as i8;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x8();
+ let r = vpgatherqq(src, slice, offsets, mask, SCALE);
+ transmute(r)
+}
+
+/// Gather 32-bit integers from memory using 64-bit indices. 32-bit elements are loaded from addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst. scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i64gather_epi32&expand=3074)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpgatherqd, SCALE = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_i64gather_epi32<const SCALE: i32>(
+ offsets: __m512i,
+ slice: *const u8,
+) -> __m256i {
+ static_assert_imm8_scale!(SCALE);
+ let zeros = _mm256_setzero_si256().as_i32x8();
+ let neg_one = -1;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x8();
+ let r = vpgatherqd(zeros, slice, offsets, neg_one, SCALE);
+ transmute(r)
+}
+
+/// Gather 32-bit integers from memory using 64-bit indices. 32-bit elements are loaded from addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). Gathered elements are merged into dst using writemask k (elements are copied from src when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i64gather_epi32&expand=3075)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpgatherqd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i64gather_epi32<const SCALE: i32>(
+ src: __m256i,
+ mask: __mmask8,
+ offsets: __m512i,
+ slice: *const u8,
+) -> __m256i {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i32x8();
+ let mask = mask as i8;
+ let slice = slice as *const i8;
+ let offsets = offsets.as_i64x8();
+ let r = vpgatherqd(src, slice, offsets, mask, SCALE);
+ transmute(r)
+}
+
+/// Scatter double-precision (64-bit) floating-point elements from a into memory using 32-bit indices. 64-bit elements are stored at addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i32scatter_pd&expand=3044)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscatterdpd, SCALE = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_i32scatter_pd<const SCALE: i32>(
+ slice: *mut u8,
+ offsets: __m256i,
+ src: __m512d,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f64x8();
+ let neg_one = -1;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i32x8();
+ vscatterdpd(slice, neg_one, offsets, src, SCALE);
+}
+
+/// Scatter double-precision (64-bit) floating-point elements from a into memory using 32-bit indices. 64-bit elements are stored at addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale) subject to mask k (elements are not stored when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i32scatter_pd&expand=3045)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscatterdpd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i32scatter_pd<const SCALE: i32>(
+ slice: *mut u8,
+ mask: __mmask8,
+ offsets: __m256i,
+ src: __m512d,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f64x8();
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i32x8();
+ vscatterdpd(slice, mask as i8, offsets, src, SCALE);
+}
+
+/// Scatter double-precision (64-bit) floating-point elements from a into memory using 64-bit indices. 64-bit elements are stored at addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i64scatter_pd&expand=3122)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscatterqpd, SCALE = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_i64scatter_pd<const SCALE: i32>(
+ slice: *mut u8,
+ offsets: __m512i,
+ src: __m512d,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f64x8();
+ let neg_one = -1;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i64x8();
+ vscatterqpd(slice, neg_one, offsets, src, SCALE);
+}
+
+/// Scatter double-precision (64-bit) floating-point elements from a into memory using 64-bit indices. 64-bit elements are stored at addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale) subject to mask k (elements are not stored when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i64scatter_pd&expand=3123)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscatterqpd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i64scatter_pd<const SCALE: i32>(
+ slice: *mut u8,
+ mask: __mmask8,
+ offsets: __m512i,
+ src: __m512d,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f64x8();
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i64x8();
+ vscatterqpd(slice, mask as i8, offsets, src, SCALE);
+}
+
+/// Scatter single-precision (32-bit) floating-point elements from a into memory using 32-bit indices. 32-bit elements are stored at addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i32scatter_ps&expand=3050)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscatterdps, SCALE = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_i32scatter_ps<const SCALE: i32>(
+ slice: *mut u8,
+ offsets: __m512i,
+ src: __m512,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f32x16();
+ let neg_one = -1;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i32x16();
+ vscatterdps(slice, neg_one, offsets, src, SCALE);
+}
+
+/// Scatter single-precision (32-bit) floating-point elements from a into memory using 32-bit indices. 32-bit elements are stored at addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale) subject to mask k (elements are not stored when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i32scatter_ps&expand=3051)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscatterdps, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i32scatter_ps<const SCALE: i32>(
+ slice: *mut u8,
+ mask: __mmask16,
+ offsets: __m512i,
+ src: __m512,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f32x16();
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i32x16();
+ vscatterdps(slice, mask as i16, offsets, src, SCALE);
+}
+
+/// Scatter single-precision (32-bit) floating-point elements from a into memory using 64-bit indices. 32-bit elements are stored at addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale) subject to mask k (elements are not stored when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i64scatter_ps&expand=3128)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscatterqps, SCALE = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_i64scatter_ps<const SCALE: i32>(
+ slice: *mut u8,
+ offsets: __m512i,
+ src: __m256,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f32x8();
+ let neg_one = -1;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i64x8();
+ vscatterqps(slice, neg_one, offsets, src, SCALE);
+}
+
+/// Scatter single-precision (32-bit) floating-point elements from a into memory using 64-bit indices. 32-bit elements are stored at addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale) subject to mask k (elements are not stored when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i64scatter_ps&expand=3129)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscatterqps, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i64scatter_ps<const SCALE: i32>(
+ slice: *mut u8,
+ mask: __mmask8,
+ offsets: __m512i,
+ src: __m256,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_f32x8();
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i64x8();
+ vscatterqps(slice, mask as i8, offsets, src, SCALE);
+}
+
+/// Scatter 64-bit integers from a into memory using 32-bit indices. 64-bit elements are stored at addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i32scatter_epi64&expand=3038)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpscatterdq, SCALE = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_i32scatter_epi64<const SCALE: i32>(
+ slice: *mut u8,
+ offsets: __m256i,
+ src: __m512i,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i64x8();
+ let neg_one = -1;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i32x8();
+ vpscatterdq(slice, neg_one, offsets, src, SCALE);
+}
+
+/// Scatter 64-bit integers from a into memory using 32-bit indices. 64-bit elements are stored at addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale) subject to mask k (elements are not stored when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i32scatter_epi64&expand=3039)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpscatterdq, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i32scatter_epi64<const SCALE: i32>(
+ slice: *mut u8,
+ mask: __mmask8,
+ offsets: __m256i,
+ src: __m512i,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i64x8();
+ let mask = mask as i8;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i32x8();
+ vpscatterdq(slice, mask, offsets, src, SCALE);
+}
+
+/// Scatter 64-bit integers from a into memory using 64-bit indices. 64-bit elements are stored at addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i64scatter_epi64&expand=3116)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpscatterqq, SCALE = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_i64scatter_epi64<const SCALE: i32>(
+ slice: *mut u8,
+ offsets: __m512i,
+ src: __m512i,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i64x8();
+ let neg_one = -1;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i64x8();
+ vpscatterqq(slice, neg_one, offsets, src, SCALE);
+}
+
+/// Scatter 64-bit integers from a into memory using 64-bit indices. 64-bit elements are stored at addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale) subject to mask k (elements are not stored when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i64scatter_epi64&expand=3117)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpscatterqq, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i64scatter_epi64<const SCALE: i32>(
+ slice: *mut u8,
+ mask: __mmask8,
+ offsets: __m512i,
+ src: __m512i,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i64x8();
+ let mask = mask as i8;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i64x8();
+ vpscatterqq(slice, mask, offsets, src, SCALE);
+}
+
+/// Scatter 32-bit integers from a into memory using 32-bit indices. 32-bit elements are stored at addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i32scatter_epi32&expand=3032)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpscatterdd, SCALE = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_i32scatter_epi32<const SCALE: i32>(
+ slice: *mut u8,
+ offsets: __m512i,
+ src: __m512i,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i32x16();
+ let neg_one = -1;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i32x16();
+ vpscatterdd(slice, neg_one, offsets, src, SCALE);
+}
+
+/// Scatter 32-bit integers from a into memory using 32-bit indices. 32-bit elements are stored at addresses starting at base_addr and offset by each 32-bit element in vindex (each index is scaled by the factor in scale) subject to mask k (elements are not stored when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i32scatter_epi32&expand=3033)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpscatterdd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i32scatter_epi32<const SCALE: i32>(
+ slice: *mut u8,
+ mask: __mmask16,
+ offsets: __m512i,
+ src: __m512i,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i32x16();
+ let mask = mask as i16;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i32x16();
+ vpscatterdd(slice, mask, offsets, src, SCALE);
+}
+
+/// Scatter 32-bit integers from a into memory using 64-bit indices. 32-bit elements are stored at addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_i64scatter_epi32&expand=3108)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpscatterqd, SCALE = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_i64scatter_epi32<const SCALE: i32>(
+ slice: *mut u8,
+ offsets: __m512i,
+ src: __m256i,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i32x8();
+ let neg_one = -1;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i64x8();
+ vpscatterqd(slice, neg_one, offsets, src, SCALE);
+}
+
+/// Scatter 32-bit integers from a into memory using 64-bit indices. 32-bit elements are stored at addresses starting at base_addr and offset by each 64-bit element in vindex (each index is scaled by the factor in scale) subject to mask k (elements are not stored when the corresponding mask bit is not set). scale should be 1, 2, 4 or 8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_i64scatter_epi32&expand=3109)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpscatterqd, SCALE = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_i64scatter_epi32<const SCALE: i32>(
+ slice: *mut u8,
+ mask: __mmask8,
+ offsets: __m512i,
+ src: __m256i,
+) {
+ static_assert_imm8_scale!(SCALE);
+ let src = src.as_i32x8();
+ let mask = mask as i8;
+ let slice = slice as *mut i8;
+ let offsets = offsets.as_i64x8();
+ vpscatterqd(slice, mask, offsets, src, SCALE);
+}
+
+/// Contiguously store the active 32-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compress_epi32&expand=1198)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcompressd))]
+pub unsafe fn _mm512_mask_compress_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i {
+ transmute(vpcompressd(a.as_i32x16(), src.as_i32x16(), k))
+}
+
+/// Contiguously store the active 32-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_compress_epi32&expand=1199)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcompressd))]
+pub unsafe fn _mm512_maskz_compress_epi32(k: __mmask16, a: __m512i) -> __m512i {
+ transmute(vpcompressd(
+ a.as_i32x16(),
+ _mm512_setzero_si512().as_i32x16(),
+ k,
+ ))
+}
+
+/// Contiguously store the active 32-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compress_epi32&expand=1196)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressd))]
+pub unsafe fn _mm256_mask_compress_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ transmute(vpcompressd256(a.as_i32x8(), src.as_i32x8(), k))
+}
+
+/// Contiguously store the active 32-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_compress_epi32&expand=1197)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressd))]
+pub unsafe fn _mm256_maskz_compress_epi32(k: __mmask8, a: __m256i) -> __m256i {
+ transmute(vpcompressd256(
+ a.as_i32x8(),
+ _mm256_setzero_si256().as_i32x8(),
+ k,
+ ))
+}
+
+/// Contiguously store the active 32-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compress_epi32&expand=1194)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressd))]
+pub unsafe fn _mm_mask_compress_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpcompressd128(a.as_i32x4(), src.as_i32x4(), k))
+}
+
+/// Contiguously store the active 32-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_compress_epi32&expand=1195)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressd))]
+pub unsafe fn _mm_maskz_compress_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpcompressd128(
+ a.as_i32x4(),
+ _mm_setzero_si128().as_i32x4(),
+ k,
+ ))
+}
+
+/// Contiguously store the active 64-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compress_epi64&expand=1204)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcompressq))]
+pub unsafe fn _mm512_mask_compress_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i {
+ transmute(vpcompressq(a.as_i64x8(), src.as_i64x8(), k))
+}
+
+/// Contiguously store the active 64-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_compress_epi64&expand=1205)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcompressq))]
+pub unsafe fn _mm512_maskz_compress_epi64(k: __mmask8, a: __m512i) -> __m512i {
+ transmute(vpcompressq(
+ a.as_i64x8(),
+ _mm512_setzero_si512().as_i64x8(),
+ k,
+ ))
+}
+
+/// Contiguously store the active 64-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compress_epi64&expand=1202)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressq))]
+pub unsafe fn _mm256_mask_compress_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ transmute(vpcompressq256(a.as_i64x4(), src.as_i64x4(), k))
+}
+
+/// Contiguously store the active 64-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_compress_epi64&expand=1203)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressq))]
+pub unsafe fn _mm256_maskz_compress_epi64(k: __mmask8, a: __m256i) -> __m256i {
+ transmute(vpcompressq256(
+ a.as_i64x4(),
+ _mm256_setzero_si256().as_i64x4(),
+ k,
+ ))
+}
+
+/// Contiguously store the active 64-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compress_epi64&expand=1200)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressq))]
+pub unsafe fn _mm_mask_compress_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpcompressq128(a.as_i64x2(), src.as_i64x2(), k))
+}
+
+/// Contiguously store the active 64-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_compress_epi64&expand=1201)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressq))]
+pub unsafe fn _mm_maskz_compress_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpcompressq128(
+ a.as_i64x2(),
+ _mm_setzero_si128().as_i64x2(),
+ k,
+ ))
+}
+
+/// Contiguously store the active single-precision (32-bit) floating-point elements in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compress_ps&expand=1222)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcompressps))]
+pub unsafe fn _mm512_mask_compress_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 {
+ transmute(vcompressps(a.as_f32x16(), src.as_f32x16(), k))
+}
+
+/// Contiguously store the active single-precision (32-bit) floating-point elements in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_compress_ps&expand=1223)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcompressps))]
+pub unsafe fn _mm512_maskz_compress_ps(k: __mmask16, a: __m512) -> __m512 {
+ transmute(vcompressps(
+ a.as_f32x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ k,
+ ))
+}
+
+/// Contiguously store the active single-precision (32-bit) floating-point elements in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compress_ps&expand=1220)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompressps))]
+pub unsafe fn _mm256_mask_compress_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 {
+ transmute(vcompressps256(a.as_f32x8(), src.as_f32x8(), k))
+}
+
+/// Contiguously store the active single-precision (32-bit) floating-point elements in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_compress_ps&expand=1221)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompressps))]
+pub unsafe fn _mm256_maskz_compress_ps(k: __mmask8, a: __m256) -> __m256 {
+ transmute(vcompressps256(
+ a.as_f32x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ k,
+ ))
+}
+
+/// Contiguously store the active single-precision (32-bit) floating-point elements in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compress_ps&expand=1218)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompressps))]
+pub unsafe fn _mm_mask_compress_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ transmute(vcompressps128(a.as_f32x4(), src.as_f32x4(), k))
+}
+
+/// Contiguously store the active single-precision (32-bit) floating-point elements in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_compress_ps&expand=1219)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompressps))]
+pub unsafe fn _mm_maskz_compress_ps(k: __mmask8, a: __m128) -> __m128 {
+ transmute(vcompressps128(a.as_f32x4(), _mm_setzero_ps().as_f32x4(), k))
+}
+
+/// Contiguously store the active double-precision (64-bit) floating-point elements in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compress_pd&expand=1216)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcompresspd))]
+pub unsafe fn _mm512_mask_compress_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d {
+ transmute(vcompresspd(a.as_f64x8(), src.as_f64x8(), k))
+}
+
+/// Contiguously store the active double-precision (64-bit) floating-point elements in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_compress_pd&expand=1217)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcompresspd))]
+pub unsafe fn _mm512_maskz_compress_pd(k: __mmask8, a: __m512d) -> __m512d {
+ transmute(vcompresspd(a.as_f64x8(), _mm512_setzero_pd().as_f64x8(), k))
+}
+
+/// Contiguously store the active double-precision (64-bit) floating-point elements in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compress_pd&expand=1214)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompresspd))]
+pub unsafe fn _mm256_mask_compress_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d {
+ transmute(vcompresspd256(a.as_f64x4(), src.as_f64x4(), k))
+}
+
+/// Contiguously store the active double-precision (64-bit) floating-point elements in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_compress_pd&expand=1215)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompresspd))]
+pub unsafe fn _mm256_maskz_compress_pd(k: __mmask8, a: __m256d) -> __m256d {
+ transmute(vcompresspd256(
+ a.as_f64x4(),
+ _mm256_setzero_pd().as_f64x4(),
+ k,
+ ))
+}
+
+/// Contiguously store the active double-precision (64-bit) floating-point elements in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compress_pd&expand=1212)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompresspd))]
+pub unsafe fn _mm_mask_compress_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d {
+ transmute(vcompresspd128(a.as_f64x2(), src.as_f64x2(), k))
+}
+
+/// Contiguously store the active double-precision (64-bit) floating-point elements in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_compress_pd&expand=1213)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompresspd))]
+pub unsafe fn _mm_maskz_compress_pd(k: __mmask8, a: __m128d) -> __m128d {
+ transmute(vcompresspd128(a.as_f64x2(), _mm_setzero_pd().as_f64x2(), k))
+}
+
+/// Contiguously store the active 32-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compressstoreu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcompressd))]
+pub unsafe fn _mm512_mask_compressstoreu_epi32(base_addr: *mut u8, k: __mmask16, a: __m512i) {
+ vcompressstored(base_addr as *mut _, a.as_i32x16(), k)
+}
+
+/// Contiguously store the active 32-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compressstoreu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressd))]
+pub unsafe fn _mm256_mask_compressstoreu_epi32(base_addr: *mut u8, k: __mmask8, a: __m256i) {
+ vcompressstored256(base_addr as *mut _, a.as_i32x8(), k)
+}
+
+/// Contiguously store the active 32-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compressstoreu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressd))]
+pub unsafe fn _mm_mask_compressstoreu_epi32(base_addr: *mut u8, k: __mmask8, a: __m128i) {
+ vcompressstored128(base_addr as *mut _, a.as_i32x4(), k)
+}
+
+/// Contiguously store the active 64-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compressstoreu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcompressq))]
+pub unsafe fn _mm512_mask_compressstoreu_epi64(base_addr: *mut u8, k: __mmask8, a: __m512i) {
+ vcompressstoreq(base_addr as *mut _, a.as_i64x8(), k)
+}
+
+/// Contiguously store the active 64-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compressstoreu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressq))]
+pub unsafe fn _mm256_mask_compressstoreu_epi64(base_addr: *mut u8, k: __mmask8, a: __m256i) {
+ vcompressstoreq256(base_addr as *mut _, a.as_i64x4(), k)
+}
+
+/// Contiguously store the active 64-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compressstoreu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressq))]
+pub unsafe fn _mm_mask_compressstoreu_epi64(base_addr: *mut u8, k: __mmask8, a: __m128i) {
+ vcompressstoreq128(base_addr as *mut _, a.as_i64x2(), k)
+}
+
+/// Contiguously store the active single-precision (32-bit) floating-point elements in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compressstoreu_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcompressps))]
+pub unsafe fn _mm512_mask_compressstoreu_ps(base_addr: *mut u8, k: __mmask16, a: __m512) {
+ vcompressstoreps(base_addr as *mut _, a.as_f32x16(), k)
+}
+
+/// Contiguously store the active single-precision (32-bit) floating-point elements in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compressstoreu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompressps))]
+pub unsafe fn _mm256_mask_compressstoreu_ps(base_addr: *mut u8, k: __mmask8, a: __m256) {
+ vcompressstoreps256(base_addr as *mut _, a.as_f32x8(), k)
+}
+
+/// Contiguously store the active single-precision (32-bit) floating-point elements in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compressstoreu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompressps))]
+pub unsafe fn _mm_mask_compressstoreu_ps(base_addr: *mut u8, k: __mmask8, a: __m128) {
+ vcompressstoreps128(base_addr as *mut _, a.as_f32x4(), k)
+}
+
+/// Contiguously store the active double-precision (64-bit) floating-point elements in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compressstoreu_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcompresspd))]
+pub unsafe fn _mm512_mask_compressstoreu_pd(base_addr: *mut u8, k: __mmask8, a: __m512d) {
+ vcompressstorepd(base_addr as *mut _, a.as_f64x8(), k)
+}
+
+/// Contiguously store the active double-precision (64-bit) floating-point elements in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compressstoreu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompresspd))]
+pub unsafe fn _mm256_mask_compressstoreu_pd(base_addr: *mut u8, k: __mmask8, a: __m256d) {
+ vcompressstorepd256(base_addr as *mut _, a.as_f64x4(), k)
+}
+
+/// Contiguously store the active double-precision (64-bit) floating-point elements in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compressstoreu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vcompresspd))]
+pub unsafe fn _mm_mask_compressstoreu_pd(base_addr: *mut u8, k: __mmask8, a: __m128d) {
+ vcompressstorepd128(base_addr as *mut _, a.as_f64x2(), k)
+}
+
+/// Load contiguous active 32-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expand_epi32&expand=2316)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpexpandd))]
+pub unsafe fn _mm512_mask_expand_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i {
+ transmute(vpexpandd(a.as_i32x16(), src.as_i32x16(), k))
+}
+
+/// Load contiguous active 32-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expand_epi32&expand=2317)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpexpandd))]
+pub unsafe fn _mm512_maskz_expand_epi32(k: __mmask16, a: __m512i) -> __m512i {
+ transmute(vpexpandd(
+ a.as_i32x16(),
+ _mm512_setzero_si512().as_i32x16(),
+ k,
+ ))
+}
+
+/// Load contiguous active 32-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expand_epi32&expand=2314)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandd))]
+pub unsafe fn _mm256_mask_expand_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ transmute(vpexpandd256(a.as_i32x8(), src.as_i32x8(), k))
+}
+
+/// Load contiguous active 32-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expand_epi32&expand=2315)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandd))]
+pub unsafe fn _mm256_maskz_expand_epi32(k: __mmask8, a: __m256i) -> __m256i {
+ transmute(vpexpandd256(
+ a.as_i32x8(),
+ _mm256_setzero_si256().as_i32x8(),
+ k,
+ ))
+}
+
+/// Load contiguous active 32-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expand_epi32&expand=2312)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandd))]
+pub unsafe fn _mm_mask_expand_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpexpandd128(a.as_i32x4(), src.as_i32x4(), k))
+}
+
+/// Load contiguous active 32-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expand_epi32&expand=2313)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandd))]
+pub unsafe fn _mm_maskz_expand_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpexpandd128(
+ a.as_i32x4(),
+ _mm_setzero_si128().as_i32x4(),
+ k,
+ ))
+}
+
+/// Load contiguous active 64-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expand_epi64&expand=2322)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpexpandq))]
+pub unsafe fn _mm512_mask_expand_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i {
+ transmute(vpexpandq(a.as_i64x8(), src.as_i64x8(), k))
+}
+
+/// Load contiguous active 64-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expand_epi64&expand=2323)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpexpandq))]
+pub unsafe fn _mm512_maskz_expand_epi64(k: __mmask8, a: __m512i) -> __m512i {
+ transmute(vpexpandq(
+ a.as_i64x8(),
+ _mm512_setzero_si512().as_i64x8(),
+ k,
+ ))
+}
+
+/// Load contiguous active 64-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expand_epi64&expand=2320)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandq))]
+pub unsafe fn _mm256_mask_expand_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ transmute(vpexpandq256(a.as_i64x4(), src.as_i64x4(), k))
+}
+
+/// Load contiguous active 64-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expand_epi64&expand=2321)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandq))]
+pub unsafe fn _mm256_maskz_expand_epi64(k: __mmask8, a: __m256i) -> __m256i {
+ transmute(vpexpandq256(
+ a.as_i64x4(),
+ _mm256_setzero_si256().as_i64x4(),
+ k,
+ ))
+}
+
+/// Load contiguous active 64-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expand_epi64&expand=2318)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandq))]
+pub unsafe fn _mm_mask_expand_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpexpandq128(a.as_i64x2(), src.as_i64x2(), k))
+}
+
+/// Load contiguous active 64-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expand_epi64&expand=2319)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandq))]
+pub unsafe fn _mm_maskz_expand_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpexpandq128(
+ a.as_i64x2(),
+ _mm_setzero_si128().as_i64x2(),
+ k,
+ ))
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expand_ps&expand=2340)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vexpandps))]
+pub unsafe fn _mm512_mask_expand_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 {
+ transmute(vexpandps(a.as_f32x16(), src.as_f32x16(), k))
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expand_ps&expand=2341)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vexpandps))]
+pub unsafe fn _mm512_maskz_expand_ps(k: __mmask16, a: __m512) -> __m512 {
+ transmute(vexpandps(a.as_f32x16(), _mm512_setzero_ps().as_f32x16(), k))
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expand_ps&expand=2338)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vexpandps))]
+pub unsafe fn _mm256_mask_expand_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 {
+ transmute(vexpandps256(a.as_f32x8(), src.as_f32x8(), k))
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expand_ps&expand=2339)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vexpandps))]
+pub unsafe fn _mm256_maskz_expand_ps(k: __mmask8, a: __m256) -> __m256 {
+ transmute(vexpandps256(
+ a.as_f32x8(),
+ _mm256_setzero_ps().as_f32x8(),
+ k,
+ ))
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expand_ps&expand=2336)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vexpandps))]
+pub unsafe fn _mm_mask_expand_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ transmute(vexpandps128(a.as_f32x4(), src.as_f32x4(), k))
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expand_ps&expand=2337)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vexpandps))]
+pub unsafe fn _mm_maskz_expand_ps(k: __mmask8, a: __m128) -> __m128 {
+ transmute(vexpandps128(a.as_f32x4(), _mm_setzero_ps().as_f32x4(), k))
+}
+
+/// Load contiguous active double-precision (64-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expand_pd&expand=2334)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vexpandpd))]
+pub unsafe fn _mm512_mask_expand_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d {
+ transmute(vexpandpd(a.as_f64x8(), src.as_f64x8(), k))
+}
+
+/// Load contiguous active double-precision (64-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expand_pd&expand=2335)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vexpandpd))]
+pub unsafe fn _mm512_maskz_expand_pd(k: __mmask8, a: __m512d) -> __m512d {
+ transmute(vexpandpd(a.as_f64x8(), _mm512_setzero_pd().as_f64x8(), k))
+}
+
+/// Load contiguous active double-precision (64-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expand_pd&expand=2332)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vexpandpd))]
+pub unsafe fn _mm256_mask_expand_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d {
+ transmute(vexpandpd256(a.as_f64x4(), src.as_f64x4(), k))
+}
+
+/// Load contiguous active double-precision (64-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expand_pd&expand=2333)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vexpandpd))]
+pub unsafe fn _mm256_maskz_expand_pd(k: __mmask8, a: __m256d) -> __m256d {
+ transmute(vexpandpd256(
+ a.as_f64x4(),
+ _mm256_setzero_pd().as_f64x4(),
+ k,
+ ))
+}
+
+/// Load contiguous active double-precision (64-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expand_pd&expand=2330)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vexpandpd))]
+pub unsafe fn _mm_mask_expand_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d {
+ transmute(vexpandpd128(a.as_f64x2(), src.as_f64x2(), k))
+}
+
+/// Load contiguous active double-precision (64-bit) floating-point elements from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expand_pd&expand=2331)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vexpandpd))]
+pub unsafe fn _mm_maskz_expand_pd(k: __mmask8, a: __m128d) -> __m128d {
+ transmute(vexpandpd128(a.as_f64x2(), _mm_setzero_pd().as_f64x2(), k))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_rol_epi32&expand=4685)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_rol_epi32<const IMM8: i32>(a: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vprold(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_rol_epi32&expand=4683)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_rol_epi32<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vprold(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x16()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_rol_epi32&expand=4684)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_rol_epi32<const IMM8: i32>(k: __mmask16, a: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vprold(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_rol_epi32&expand=4682)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_rol_epi32<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x8();
+ let r = vprold256(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_rol_epi32&expand=4680)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_rol_epi32<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x8();
+ let r = vprold256(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x8()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_rol_epi32&expand=4681)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_rol_epi32<const IMM8: i32>(k: __mmask8, a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x8();
+ let r = vprold256(a, IMM8);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rol_epi32&expand=4679)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_rol_epi32<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x4();
+ let r = vprold128(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_rol_epi32&expand=4677)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_rol_epi32<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x4();
+ let r = vprold128(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x4()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_rol_epi32&expand=4678)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_rol_epi32<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x4();
+ let r = vprold128(a, IMM8);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_ror_epi32&expand=4721)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_ror_epi32<const IMM8: i32>(a: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vprord(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_ror_epi32&expand=4719)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 123))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_ror_epi32<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vprord(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x16()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_ror_epi32&expand=4720)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 123))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_ror_epi32<const IMM8: i32>(k: __mmask16, a: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vprord(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_ror_epi32&expand=4718)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_ror_epi32<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x8();
+ let r = vprord256(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_ror_epi32&expand=4716)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 123))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_ror_epi32<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x8();
+ let r = vprord256(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x8()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_ror_epi32&expand=4717)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 123))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_ror_epi32<const IMM8: i32>(k: __mmask8, a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x8();
+ let r = vprord256(a, IMM8);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ror_epi32&expand=4715)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_ror_epi32<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x4();
+ let r = vprord128(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_ror_epi32&expand=4713)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 123))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_ror_epi32<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x4();
+ let r = vprord128(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x4()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_ror_epi32&expand=4714)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprold, IMM8 = 123))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_ror_epi32<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x4();
+ let r = vprord128(a, IMM8);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_rol_epi64&expand=4694)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_rol_epi64<const IMM8: i32>(a: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x8();
+ let r = vprolq(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_rol_epi64&expand=4692)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_rol_epi64<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x8();
+ let r = vprolq(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i64x8()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_rol_epi64&expand=4693)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_rol_epi64<const IMM8: i32>(k: __mmask8, a: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x8();
+ let r = vprolq(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_rol_epi64&expand=4691)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_rol_epi64<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x4();
+ let r = vprolq256(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_rol_epi64&expand=4689)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_rol_epi64<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x4();
+ let r = vprolq256(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i64x4()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_rol_epi64&expand=4690)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_rol_epi64<const IMM8: i32>(k: __mmask8, a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x4();
+ let r = vprolq256(a, IMM8);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rol_epi64&expand=4688)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_rol_epi64<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x2();
+ let r = vprolq128(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_rol_epi64&expand=4686)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_rol_epi64<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x2();
+ let r = vprolq128(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i64x2()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_rol_epi64&expand=4687)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_rol_epi64<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x2();
+ let r = vprolq128(a, IMM8);
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_ror_epi64&expand=4730)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_ror_epi64<const IMM8: i32>(a: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x8();
+ let r = vprorq(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_ror_epi64&expand=4728)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_ror_epi64<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x8();
+ let r = vprorq(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i64x8()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_ror_epi64&expand=4729)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_ror_epi64<const IMM8: i32>(k: __mmask8, a: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x8();
+ let r = vprorq(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_ror_epi64&expand=4727)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_ror_epi64<const IMM8: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x4();
+ let r = vprorq256(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_ror_epi64&expand=4725)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_ror_epi64<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x4();
+ let r = vprorq256(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i64x4()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_ror_epi64&expand=4726)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_ror_epi64<const IMM8: i32>(k: __mmask8, a: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x4();
+ let r = vprorq256(a, IMM8);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ror_epi64&expand=4724)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_ror_epi64<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x2();
+ let r = vprorq128(a, IMM8);
+ transmute(r)
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_ror_epi64&expand=4722)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_ror_epi64<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x2();
+ let r = vprorq128(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i64x2()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_ror_epi64&expand=4723)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_ror_epi64<const IMM8: i32>(k: __mmask8, a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i64x2();
+ let r = vprorq128(a, IMM8);
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 32-bit integers in a left by imm8 while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_slli_epi32&expand=5310)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_slli_epi32<const IMM8: u32>(a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vpsllid(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 32-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_slli_epi32&expand=5308)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_slli_epi32<const IMM8: u32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i32x16();
+ let shf = vpsllid(a, IMM8);
+ transmute(simd_select_bitmask(k, shf, src.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_slli_epi32&expand=5309)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_slli_epi32<const IMM8: u32>(k: __mmask16, a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i32x16();
+ let shf = vpsllid(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_slli_epi32&expand=5305)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_slli_epi32<const IMM8: u32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psllid256(a.as_i32x8(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x8()))
+}
+
+/// Shift packed 32-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_slli_epi32&expand=5306)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_slli_epi32<const IMM8: u32>(k: __mmask8, a: __m256i) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psllid256(a.as_i32x8(), imm8);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 32-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_slli_epi32&expand=5302)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_slli_epi32<const IMM8: u32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psllid128(a.as_i32x4(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_slli_epi32&expand=5303)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_slli_epi32<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psllid128(a.as_i32x4(), imm8);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srli_epi32&expand=5522)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_srli_epi32<const IMM8: u32>(a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vpsrlid(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srli_epi32&expand=5520)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_srli_epi32<const IMM8: u32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i32x16();
+ let shf = vpsrlid(a, IMM8);
+ transmute(simd_select_bitmask(k, shf, src.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srli_epi32&expand=5521)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_srli_epi32<const IMM8: u32>(k: __mmask16, a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i32x16();
+ let shf = vpsrlid(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srli_epi32&expand=5517)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_srli_epi32<const IMM8: u32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psrlid256(a.as_i32x8(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x8()))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srli_epi32&expand=5518)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_srli_epi32<const IMM8: u32>(k: __mmask8, a: __m256i) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psrlid256(a.as_i32x8(), imm8);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srli_epi32&expand=5514)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_srli_epi32<const IMM8: u32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psrlid128(a.as_i32x4(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srli_epi32&expand=5515)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_srli_epi32<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psrlid128(a.as_i32x4(), imm8);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 64-bit integers in a left by imm8 while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_slli_epi64&expand=5319)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_slli_epi64<const IMM8: u32>(a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x8();
+ let r = vpslliq(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 64-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_slli_epi64&expand=5317)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_slli_epi64<const IMM8: u32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x8();
+ let shf = vpslliq(a, IMM8);
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_slli_epi64&expand=5318)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_slli_epi64<const IMM8: u32>(k: __mmask8, a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x8();
+ let shf = vpslliq(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_slli_epi64&expand=5314)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_slli_epi64<const IMM8: u32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = pslliq256(a.as_i64x4(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i64x4()))
+}
+
+/// Shift packed 64-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_slli_epi64&expand=5315)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_slli_epi64<const IMM8: u32>(k: __mmask8, a: __m256i) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = pslliq256(a.as_i64x4(), imm8);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 64-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_slli_epi64&expand=5311)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_slli_epi64<const IMM8: u32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = pslliq128(a.as_i64x2(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a left by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_slli_epi64&expand=5312)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_slli_epi64<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = pslliq128(a.as_i64x2(), imm8);
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srli_epi64&expand=5531)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_srli_epi64<const IMM8: u32>(a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x8();
+ let r = vpsrliq(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srli_epi64&expand=5529)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_srli_epi64<const IMM8: u32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x8();
+ let shf = vpsrliq(a, IMM8);
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srli_epi64&expand=5530)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_srli_epi64<const IMM8: u32>(k: __mmask8, a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x8();
+ let shf = vpsrliq(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srli_epi64&expand=5526)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_srli_epi64<const IMM8: u32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psrliq256(a.as_i64x4(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i64x4()))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srli_epi64&expand=5527)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_srli_epi64<const IMM8: u32>(k: __mmask8, a: __m256i) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psrliq256(a.as_i64x4(), imm8);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srli_epi64&expand=5523)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_srli_epi64<const IMM8: u32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psrliq128(a.as_i64x2(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srli_epi64&expand=5524)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_srli_epi64<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let imm8 = IMM8 as i32;
+ let r = psrliq128(a.as_i64x2(), imm8);
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 32-bit integers in a left by count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sll_epi32&expand=5280)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpslld))]
+pub unsafe fn _mm512_sll_epi32(a: __m512i, count: __m128i) -> __m512i {
+ transmute(vpslld(a.as_i32x16(), count.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sll_epi32&expand=5278)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpslld))]
+pub unsafe fn _mm512_mask_sll_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ count: __m128i,
+) -> __m512i {
+ let shf = _mm512_sll_epi32(a, count).as_i32x16();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sll_epi32&expand=5279)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpslld))]
+pub unsafe fn _mm512_maskz_sll_epi32(k: __mmask16, a: __m512i, count: __m128i) -> __m512i {
+ let shf = _mm512_sll_epi32(a, count).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sll_epi32&expand=5275)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpslld))]
+pub unsafe fn _mm256_mask_sll_epi32(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m128i,
+) -> __m256i {
+ let shf = _mm256_sll_epi32(a, count).as_i32x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x8()))
+}
+
+/// Shift packed 32-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sll_epi32&expand=5276)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpslld))]
+pub unsafe fn _mm256_maskz_sll_epi32(k: __mmask8, a: __m256i, count: __m128i) -> __m256i {
+ let shf = _mm256_sll_epi32(a, count).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sll_epi32&expand=5272)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpslld))]
+pub unsafe fn _mm_mask_sll_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_sll_epi32(a, count).as_i32x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sll_epi32&expand=5273)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpslld))]
+pub unsafe fn _mm_maskz_sll_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_sll_epi32(a, count).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srl_epi32&expand=5492)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrld))]
+pub unsafe fn _mm512_srl_epi32(a: __m512i, count: __m128i) -> __m512i {
+ transmute(vpsrld(a.as_i32x16(), count.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srl_epi32&expand=5490)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrld))]
+pub unsafe fn _mm512_mask_srl_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ count: __m128i,
+) -> __m512i {
+ let shf = _mm512_srl_epi32(a, count).as_i32x16();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srl_epi32&expand=5491)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrld))]
+pub unsafe fn _mm512_maskz_srl_epi32(k: __mmask16, a: __m512i, count: __m128i) -> __m512i {
+ let shf = _mm512_srl_epi32(a, count).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srl_epi32&expand=5487)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrld))]
+pub unsafe fn _mm256_mask_srl_epi32(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m128i,
+) -> __m256i {
+ let shf = _mm256_srl_epi32(a, count).as_i32x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x8()))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srl_epi32&expand=5488)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrld))]
+pub unsafe fn _mm256_maskz_srl_epi32(k: __mmask8, a: __m256i, count: __m128i) -> __m256i {
+ let shf = _mm256_srl_epi32(a, count).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srl_epi32&expand=5484)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrld))]
+pub unsafe fn _mm_mask_srl_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_srl_epi32(a, count).as_i32x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srl_epi32&expand=5485)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrld))]
+pub unsafe fn _mm_maskz_srl_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_srl_epi32(a, count).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a left by count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sll_epi64&expand=5289)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllq))]
+pub unsafe fn _mm512_sll_epi64(a: __m512i, count: __m128i) -> __m512i {
+ transmute(vpsllq(a.as_i64x8(), count.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sll_epi64&expand=5287)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllq))]
+pub unsafe fn _mm512_mask_sll_epi64(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ count: __m128i,
+) -> __m512i {
+ let shf = _mm512_sll_epi64(a, count).as_i64x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sll_epi64&expand=5288)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllq))]
+pub unsafe fn _mm512_maskz_sll_epi64(k: __mmask8, a: __m512i, count: __m128i) -> __m512i {
+ let shf = _mm512_sll_epi64(a, count).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sll_epi64&expand=5284)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllq))]
+pub unsafe fn _mm256_mask_sll_epi64(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m128i,
+) -> __m256i {
+ let shf = _mm256_sll_epi64(a, count).as_i64x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x4()))
+}
+
+/// Shift packed 64-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sll_epi64&expand=5285)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllq))]
+pub unsafe fn _mm256_maskz_sll_epi64(k: __mmask8, a: __m256i, count: __m128i) -> __m256i {
+ let shf = _mm256_sll_epi64(a, count).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a left by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sll_epi64&expand=5281)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllq))]
+pub unsafe fn _mm_mask_sll_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_sll_epi64(a, count).as_i64x2();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a left by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sll_epi64&expand=5282)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllq))]
+pub unsafe fn _mm_maskz_sll_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_sll_epi64(a, count).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srl_epi64&expand=5501)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlq))]
+pub unsafe fn _mm512_srl_epi64(a: __m512i, count: __m128i) -> __m512i {
+ transmute(vpsrlq(a.as_i64x8(), count.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srl_epi64&expand=5499)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlq))]
+pub unsafe fn _mm512_mask_srl_epi64(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ count: __m128i,
+) -> __m512i {
+ let shf = _mm512_srl_epi64(a, count).as_i64x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srl_epi64&expand=5500)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlq))]
+pub unsafe fn _mm512_maskz_srl_epi64(k: __mmask8, a: __m512i, count: __m128i) -> __m512i {
+ let shf = _mm512_srl_epi64(a, count).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srl_epi64&expand=5496)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlq))]
+pub unsafe fn _mm256_mask_srl_epi64(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m128i,
+) -> __m256i {
+ let shf = _mm256_srl_epi64(a, count).as_i64x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x4()))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srl_epi64&expand=5497)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlq))]
+pub unsafe fn _mm256_maskz_srl_epi64(k: __mmask8, a: __m256i, count: __m128i) -> __m256i {
+ let shf = _mm256_srl_epi64(a, count).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srl_epi64&expand=5493)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlq))]
+pub unsafe fn _mm_mask_srl_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_srl_epi64(a, count).as_i64x2();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srl_epi64&expand=5494)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlq))]
+pub unsafe fn _mm_maskz_srl_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_srl_epi64(a, count).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sra_epi32&expand=5407)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrad))]
+pub unsafe fn _mm512_sra_epi32(a: __m512i, count: __m128i) -> __m512i {
+ transmute(vpsrad(a.as_i32x16(), count.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sra_epi32&expand=5405)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrad))]
+pub unsafe fn _mm512_mask_sra_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ count: __m128i,
+) -> __m512i {
+ let shf = _mm512_sra_epi32(a, count).as_i32x16();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sra_epi32&expand=5406)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrad))]
+pub unsafe fn _mm512_maskz_sra_epi32(k: __mmask16, a: __m512i, count: __m128i) -> __m512i {
+ let shf = _mm512_sra_epi32(a, count).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sra_epi32&expand=5402)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrad))]
+pub unsafe fn _mm256_mask_sra_epi32(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m128i,
+) -> __m256i {
+ let shf = _mm256_sra_epi32(a, count).as_i32x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x8()))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sra_epi32&expand=5403)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrad))]
+pub unsafe fn _mm256_maskz_sra_epi32(k: __mmask8, a: __m256i, count: __m128i) -> __m256i {
+ let shf = _mm256_sra_epi32(a, count).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sra_epi32&expand=5399)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrad))]
+pub unsafe fn _mm_mask_sra_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_sra_epi32(a, count).as_i32x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sra_epi32&expand=5400)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrad))]
+pub unsafe fn _mm_maskz_sra_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_sra_epi32(a, count).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sra_epi64&expand=5416)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsraq))]
+pub unsafe fn _mm512_sra_epi64(a: __m512i, count: __m128i) -> __m512i {
+ transmute(vpsraq(a.as_i64x8(), count.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sra_epi64&expand=5414)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsraq))]
+pub unsafe fn _mm512_mask_sra_epi64(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ count: __m128i,
+) -> __m512i {
+ let shf = _mm512_sra_epi64(a, count).as_i64x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sra_epi64&expand=5415)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsraq))]
+pub unsafe fn _mm512_maskz_sra_epi64(k: __mmask8, a: __m512i, count: __m128i) -> __m512i {
+ let shf = _mm512_sra_epi64(a, count).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_sra_epi64&expand=5413)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq))]
+pub unsafe fn _mm256_sra_epi64(a: __m256i, count: __m128i) -> __m256i {
+ transmute(vpsraq256(a.as_i64x4(), count.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sra_epi64&expand=5411)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq))]
+pub unsafe fn _mm256_mask_sra_epi64(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m128i,
+) -> __m256i {
+ let shf = _mm256_sra_epi64(a, count).as_i64x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x4()))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sra_epi64&expand=5412)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq))]
+pub unsafe fn _mm256_maskz_sra_epi64(k: __mmask8, a: __m256i, count: __m128i) -> __m256i {
+ let shf = _mm256_sra_epi64(a, count).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sra_epi64&expand=5410)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq))]
+pub unsafe fn _mm_sra_epi64(a: __m128i, count: __m128i) -> __m128i {
+ transmute(vpsraq128(a.as_i64x2(), count.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sra_epi64&expand=5408)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq))]
+pub unsafe fn _mm_mask_sra_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_sra_epi64(a, count).as_i64x2();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sra_epi64&expand=5409)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq))]
+pub unsafe fn _mm_maskz_sra_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_sra_epi64(a, count).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srai_epi32&expand=5436)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_srai_epi32<const IMM8: u32>(a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vpsraid512(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srai_epi32&expand=5434)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_srai_epi32<const IMM8: u32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vpsraid512(a, IMM8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srai_epi32&expand=5435)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_srai_epi32<const IMM8: u32>(k: __mmask16, a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i32x16();
+ let r = vpsraid512(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srai_epi32&expand=5431)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_srai_epi32<const IMM8: u32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ let imm8 = IMM8 as i32;
+ let r = psraid256(a.as_i32x8(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x8()))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srai_epi32&expand=5432)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_srai_epi32<const IMM8: u32>(k: __mmask8, a: __m256i) -> __m256i {
+ let imm8 = IMM8 as i32;
+ let r = psraid256(a.as_i32x8(), imm8);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srai_epi32&expand=5428)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_srai_epi32<const IMM8: u32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ let imm8 = IMM8 as i32;
+ let r = psraid128(a.as_i32x4(), imm8);
+ transmute(simd_select_bitmask(k, r, src.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srai_epi32&expand=5429)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_srai_epi32<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
+ let imm8 = IMM8 as i32;
+ let r = psraid128(a.as_i32x4(), imm8);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srai_epi64&expand=5445)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_srai_epi64<const IMM8: u32>(a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x8();
+ let r = vpsraiq(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srai_epi64&expand=5443)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_srai_epi64<const IMM8: u32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x8();
+ let shf = vpsraiq(a, IMM8);
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srai_epi64&expand=5444)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_srai_epi64<const IMM8: u32>(k: __mmask8, a: __m512i) -> __m512i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x8();
+ let shf = vpsraiq(a, IMM8);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srai_epi64&expand=5442)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_srai_epi64<const IMM8: u32>(a: __m256i) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x4();
+ let r = vpsraiq256(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srai_epi64&expand=5440)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_srai_epi64<const IMM8: u32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x4();
+ let shf = vpsraiq256(a, IMM8);
+ transmute(simd_select_bitmask(k, shf, src.as_i64x4()))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srai_epi64&expand=5441)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_srai_epi64<const IMM8: u32>(k: __mmask8, a: __m256i) -> __m256i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x4();
+ let shf = vpsraiq256(a, IMM8);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srai_epi64&expand=5439)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_srai_epi64<const IMM8: u32>(a: __m128i) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x2();
+ let r = vpsraiq128(a, IMM8);
+ transmute(r)
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srai_epi64&expand=5437)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_srai_epi64<const IMM8: u32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x2();
+ let shf = vpsraiq128(a, IMM8);
+ transmute(simd_select_bitmask(k, shf, src.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by imm8 while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srai_epi64&expand=5438)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_srai_epi64<const IMM8: u32>(k: __mmask8, a: __m128i) -> __m128i {
+ static_assert_imm_u8!(IMM8);
+ let a = a.as_i64x2();
+ let shf = vpsraiq128(a, IMM8);
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srav_epi32&expand=5465)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsravd))]
+pub unsafe fn _mm512_srav_epi32(a: __m512i, count: __m512i) -> __m512i {
+ transmute(vpsravd(a.as_i32x16(), count.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srav_epi32&expand=5463)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsravd))]
+pub unsafe fn _mm512_mask_srav_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ count: __m512i,
+) -> __m512i {
+ let shf = _mm512_srav_epi32(a, count).as_i32x16();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srav_epi32&expand=5464)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsravd))]
+pub unsafe fn _mm512_maskz_srav_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m512i {
+ let shf = _mm512_srav_epi32(a, count).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srav_epi32&expand=5460)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsravd))]
+pub unsafe fn _mm256_mask_srav_epi32(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m256i,
+) -> __m256i {
+ let shf = _mm256_srav_epi32(a, count).as_i32x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x8()))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srav_epi32&expand=5461)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsravd))]
+pub unsafe fn _mm256_maskz_srav_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m256i {
+ let shf = _mm256_srav_epi32(a, count).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srav_epi32&expand=5457)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsravd))]
+pub unsafe fn _mm_mask_srav_epi32(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ count: __m128i,
+) -> __m128i {
+ let shf = _mm_srav_epi32(a, count).as_i32x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srav_epi32&expand=5458)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsravd))]
+pub unsafe fn _mm_maskz_srav_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_srav_epi32(a, count).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srav_epi64&expand=5474)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsravq))]
+pub unsafe fn _mm512_srav_epi64(a: __m512i, count: __m512i) -> __m512i {
+ transmute(vpsravq(a.as_i64x8(), count.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srav_epi64&expand=5472)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsravq))]
+pub unsafe fn _mm512_mask_srav_epi64(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ count: __m512i,
+) -> __m512i {
+ let shf = _mm512_srav_epi64(a, count).as_i64x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srav_epi64&expand=5473)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsravq))]
+pub unsafe fn _mm512_maskz_srav_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m512i {
+ let shf = _mm512_srav_epi64(a, count).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_srav_epi64&expand=5471)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsravq))]
+pub unsafe fn _mm256_srav_epi64(a: __m256i, count: __m256i) -> __m256i {
+ transmute(vpsravq256(a.as_i64x4(), count.as_i64x4()))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srav_epi64&expand=5469)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsravq))]
+pub unsafe fn _mm256_mask_srav_epi64(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m256i,
+) -> __m256i {
+ let shf = _mm256_srav_epi64(a, count).as_i64x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x4()))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srav_epi64&expand=5470)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsravq))]
+pub unsafe fn _mm256_maskz_srav_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m256i {
+ let shf = _mm256_srav_epi64(a, count).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srav_epi64&expand=5468)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsravq))]
+pub unsafe fn _mm_srav_epi64(a: __m128i, count: __m128i) -> __m128i {
+ transmute(vpsravq128(a.as_i64x2(), count.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srav_epi64&expand=5466)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsravq))]
+pub unsafe fn _mm_mask_srav_epi64(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ count: __m128i,
+) -> __m128i {
+ let shf = _mm_srav_epi64(a, count).as_i64x2();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in sign bits, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srav_epi64&expand=5467)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsravq))]
+pub unsafe fn _mm_maskz_srav_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_srav_epi64(a, count).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_rolv_epi32&expand=4703)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolvd))]
+pub unsafe fn _mm512_rolv_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vprolvd(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_rolv_epi32&expand=4701)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolvd))]
+pub unsafe fn _mm512_mask_rolv_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let rol = _mm512_rolv_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, rol, src.as_i32x16()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_rolv_epi32&expand=4702)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolvd))]
+pub unsafe fn _mm512_maskz_rolv_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let rol = _mm512_rolv_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, rol, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_rolv_epi32&expand=4700)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvd))]
+pub unsafe fn _mm256_rolv_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(vprolvd256(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_rolv_epi3&expand=4698)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvd))]
+pub unsafe fn _mm256_mask_rolv_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let rol = _mm256_rolv_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, rol, src.as_i32x8()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_rolv_epi32&expand=4699)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvd))]
+pub unsafe fn _mm256_maskz_rolv_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let rol = _mm256_rolv_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, rol, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rolv_epi32&expand=4697)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvd))]
+pub unsafe fn _mm_rolv_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(vprolvd128(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_rolv_epi32&expand=4695)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvd))]
+pub unsafe fn _mm_mask_rolv_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let rol = _mm_rolv_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, rol, src.as_i32x4()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_rolv_epi32&expand=4696)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvd))]
+pub unsafe fn _mm_maskz_rolv_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let rol = _mm_rolv_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, rol, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_rorv_epi32&expand=4739)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprorvd))]
+pub unsafe fn _mm512_rorv_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vprorvd(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_rorv_epi32&expand=4737)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprorvd))]
+pub unsafe fn _mm512_mask_rorv_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let ror = _mm512_rorv_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, ror, src.as_i32x16()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_rorv_epi32&expand=4738)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprorvd))]
+pub unsafe fn _mm512_maskz_rorv_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let ror = _mm512_rorv_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, ror, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_rorv_epi32&expand=4736)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvd))]
+pub unsafe fn _mm256_rorv_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(vprorvd256(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_rorv_epi32&expand=4734)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvd))]
+pub unsafe fn _mm256_mask_rorv_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let ror = _mm256_rorv_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, ror, src.as_i32x8()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_rorv_epi32&expand=4735)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvd))]
+pub unsafe fn _mm256_maskz_rorv_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let ror = _mm256_rorv_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, ror, zero))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rorv_epi32&expand=4733)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvd))]
+pub unsafe fn _mm_rorv_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(vprorvd128(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_rorv_epi32&expand=4731)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvd))]
+pub unsafe fn _mm_mask_rorv_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let ror = _mm_rorv_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, ror, src.as_i32x4()))
+}
+
+/// Rotate the bits in each packed 32-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_rorv_epi32&expand=4732)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvd))]
+pub unsafe fn _mm_maskz_rorv_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let ror = _mm_rorv_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, ror, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_rolv_epi64&expand=4712)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolvq))]
+pub unsafe fn _mm512_rolv_epi64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vprolvq(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_rolv_epi64&expand=4710)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolvq))]
+pub unsafe fn _mm512_mask_rolv_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let rol = _mm512_rolv_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, rol, src.as_i64x8()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_rolv_epi64&expand=4711)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprolvq))]
+pub unsafe fn _mm512_maskz_rolv_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let rol = _mm512_rolv_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, rol, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_rolv_epi64&expand=4709)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvq))]
+pub unsafe fn _mm256_rolv_epi64(a: __m256i, b: __m256i) -> __m256i {
+ transmute(vprolvq256(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_rolv_epi64&expand=4707)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvq))]
+pub unsafe fn _mm256_mask_rolv_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let rol = _mm256_rolv_epi64(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, rol, src.as_i64x4()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_rolv_epi64&expand=4708)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvq))]
+pub unsafe fn _mm256_maskz_rolv_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let rol = _mm256_rolv_epi64(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, rol, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rolv_epi64&expand=4706)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvq))]
+pub unsafe fn _mm_rolv_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(vprolvq128(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_rolv_epi64&expand=4704)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvq))]
+pub unsafe fn _mm_mask_rolv_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let rol = _mm_rolv_epi64(a, b).as_i64x2();
+ transmute(simd_select_bitmask(k, rol, src.as_i64x2()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the left by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_rolv_epi64&expand=4705)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprolvq))]
+pub unsafe fn _mm_maskz_rolv_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let rol = _mm_rolv_epi64(a, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, rol, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_rorv_epi64&expand=4748)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprorvq))]
+pub unsafe fn _mm512_rorv_epi64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vprorvq(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_rorv_epi64&expand=4746)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprorvq))]
+pub unsafe fn _mm512_mask_rorv_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let ror = _mm512_rorv_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, ror, src.as_i64x8()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_rorv_epi64&expand=4747)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vprorvq))]
+pub unsafe fn _mm512_maskz_rorv_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let ror = _mm512_rorv_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, ror, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_rorv_epi64&expand=4745)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvq))]
+pub unsafe fn _mm256_rorv_epi64(a: __m256i, b: __m256i) -> __m256i {
+ transmute(vprorvq256(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_rorv_epi64&expand=4743)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvq))]
+pub unsafe fn _mm256_mask_rorv_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let ror = _mm256_rorv_epi64(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, ror, src.as_i64x4()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_rorv_epi64&expand=4744)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvq))]
+pub unsafe fn _mm256_maskz_rorv_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let ror = _mm256_rorv_epi64(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, ror, zero))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rorv_epi64&expand=4742)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvq))]
+pub unsafe fn _mm_rorv_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(vprorvq128(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_rorv_epi64&expand=4740)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvq))]
+pub unsafe fn _mm_mask_rorv_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let ror = _mm_rorv_epi64(a, b).as_i64x2();
+ transmute(simd_select_bitmask(k, ror, src.as_i64x2()))
+}
+
+/// Rotate the bits in each packed 64-bit integer in a to the right by the number of bits specified in the corresponding element of b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_rorv_epi64&expand=4741)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vprorvq))]
+pub unsafe fn _mm_maskz_rorv_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let ror = _mm_rorv_epi64(a, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, ror, zero))
+}
+
+/// Shift packed 32-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sllv_epi32&expand=5342)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllvd))]
+pub unsafe fn _mm512_sllv_epi32(a: __m512i, count: __m512i) -> __m512i {
+ transmute(vpsllvd(a.as_i32x16(), count.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sllv_epi32&expand=5340)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllvd))]
+pub unsafe fn _mm512_mask_sllv_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ count: __m512i,
+) -> __m512i {
+ let shf = _mm512_sllv_epi32(a, count).as_i32x16();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sllv_epi32&expand=5341)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllvd))]
+pub unsafe fn _mm512_maskz_sllv_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m512i {
+ let shf = _mm512_sllv_epi32(a, count).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sllv_epi32&expand=5337)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllvd))]
+pub unsafe fn _mm256_mask_sllv_epi32(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m256i,
+) -> __m256i {
+ let shf = _mm256_sllv_epi32(a, count).as_i32x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x8()))
+}
+
+/// Shift packed 32-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sllv_epi32&expand=5338)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllvd))]
+pub unsafe fn _mm256_maskz_sllv_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m256i {
+ let shf = _mm256_sllv_epi32(a, count).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sllv_epi32&expand=5334)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllvd))]
+pub unsafe fn _mm_mask_sllv_epi32(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ count: __m128i,
+) -> __m128i {
+ let shf = _mm_sllv_epi32(a, count).as_i32x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sllv_epi32&expand=5335)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllvd))]
+pub unsafe fn _mm_maskz_sllv_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_sllv_epi32(a, count).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srlv_epi32&expand=5554)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlvd))]
+pub unsafe fn _mm512_srlv_epi32(a: __m512i, count: __m512i) -> __m512i {
+ transmute(vpsrlvd(a.as_i32x16(), count.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srlv_epi32&expand=5552)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlvd))]
+pub unsafe fn _mm512_mask_srlv_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ count: __m512i,
+) -> __m512i {
+ let shf = _mm512_srlv_epi32(a, count).as_i32x16();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x16()))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srlv_epi32&expand=5553)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlvd))]
+pub unsafe fn _mm512_maskz_srlv_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m512i {
+ let shf = _mm512_srlv_epi32(a, count).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srlv_epi32&expand=5549)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlvd))]
+pub unsafe fn _mm256_mask_srlv_epi32(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m256i,
+) -> __m256i {
+ let shf = _mm256_srlv_epi32(a, count).as_i32x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x8()))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srlv_epi32&expand=5550)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlvd))]
+pub unsafe fn _mm256_maskz_srlv_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m256i {
+ let shf = _mm256_srlv_epi32(a, count).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srlv_epi32&expand=5546)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlvd))]
+pub unsafe fn _mm_mask_srlv_epi32(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ count: __m128i,
+) -> __m128i {
+ let shf = _mm_srlv_epi32(a, count).as_i32x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i32x4()))
+}
+
+/// Shift packed 32-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srlv_epi32&expand=5547)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlvd))]
+pub unsafe fn _mm_maskz_srlv_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_srlv_epi32(a, count).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_sllv_epi64&expand=5351)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllvq))]
+pub unsafe fn _mm512_sllv_epi64(a: __m512i, count: __m512i) -> __m512i {
+ transmute(vpsllvq(a.as_i64x8(), count.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_sllv_epi64&expand=5349)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllvq))]
+pub unsafe fn _mm512_mask_sllv_epi64(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ count: __m512i,
+) -> __m512i {
+ let shf = _mm512_sllv_epi64(a, count).as_i64x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_sllv_epi64&expand=5350)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsllvq))]
+pub unsafe fn _mm512_maskz_sllv_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m512i {
+ let shf = _mm512_sllv_epi64(a, count).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_sllv_epi64&expand=5346)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllvq))]
+pub unsafe fn _mm256_mask_sllv_epi64(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m256i,
+) -> __m256i {
+ let shf = _mm256_sllv_epi64(a, count).as_i64x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x4()))
+}
+
+/// Shift packed 64-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_sllv_epi64&expand=5347)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllvq))]
+pub unsafe fn _mm256_maskz_sllv_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m256i {
+ let shf = _mm256_sllv_epi64(a, count).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_sllv_epi64&expand=5343)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllvq))]
+pub unsafe fn _mm_mask_sllv_epi64(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ count: __m128i,
+) -> __m128i {
+ let shf = _mm_sllv_epi64(a, count).as_i64x2();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a left by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_sllv_epi64&expand=5344)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsllvq))]
+pub unsafe fn _mm_maskz_sllv_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_sllv_epi64(a, count).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_srlv_epi64&expand=5563)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlvq))]
+pub unsafe fn _mm512_srlv_epi64(a: __m512i, count: __m512i) -> __m512i {
+ transmute(vpsrlvq(a.as_i64x8(), count.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_srlv_epi64&expand=5561)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlvq))]
+pub unsafe fn _mm512_mask_srlv_epi64(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ count: __m512i,
+) -> __m512i {
+ let shf = _mm512_srlv_epi64(a, count).as_i64x8();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_srlv_epi64&expand=5562)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpsrlvq))]
+pub unsafe fn _mm512_maskz_srlv_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m512i {
+ let shf = _mm512_srlv_epi64(a, count).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_srlv_epi64&expand=5558)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlvq))]
+pub unsafe fn _mm256_mask_srlv_epi64(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ count: __m256i,
+) -> __m256i {
+ let shf = _mm256_srlv_epi64(a, count).as_i64x4();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x4()))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_srlv_epi64&expand=5559)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlvq))]
+pub unsafe fn _mm256_maskz_srlv_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m256i {
+ let shf = _mm256_srlv_epi64(a, count).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_srlv_epi64&expand=5555)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlvq))]
+pub unsafe fn _mm_mask_srlv_epi64(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ count: __m128i,
+) -> __m128i {
+ let shf = _mm_srlv_epi64(a, count).as_i64x2();
+ transmute(simd_select_bitmask(k, shf, src.as_i64x2()))
+}
+
+/// Shift packed 64-bit integers in a right by the amount specified by the corresponding element in count while shifting in zeros, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_srlv_epi64&expand=5556)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpsrlvq))]
+pub unsafe fn _mm_maskz_srlv_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i {
+ let shf = _mm_srlv_epi64(a, count).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permute_ps&expand=4170)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilps, MASK = 0b11_00_01_11))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_permute_ps<const MASK: i32>(a: __m512) -> __m512 {
+ static_assert_imm8!(MASK);
+ simd_shuffle16!(
+ a,
+ a,
+ <const MASK: i32> [
+ MASK as u32 & 0b11,
+ (MASK as u32 >> 2) & 0b11,
+ ((MASK as u32 >> 4) & 0b11),
+ ((MASK as u32 >> 6) & 0b11),
+ (MASK as u32 & 0b11) + 4,
+ ((MASK as u32 >> 2) & 0b11) + 4,
+ ((MASK as u32 >> 4) & 0b11) + 4,
+ ((MASK as u32 >> 6) & 0b11) + 4,
+ (MASK as u32 & 0b11) + 8,
+ ((MASK as u32 >> 2) & 0b11) + 8,
+ ((MASK as u32 >> 4) & 0b11) + 8,
+ ((MASK as u32 >> 6) & 0b11) + 8,
+ (MASK as u32 & 0b11) + 12,
+ ((MASK as u32 >> 2) & 0b11) + 12,
+ ((MASK as u32 >> 4) & 0b11) + 12,
+ ((MASK as u32 >> 6) & 0b11) + 12,
+ ],
+ )
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permute_ps&expand=4168)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilps, MASK = 0b11_00_01_11))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_permute_ps<const MASK: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+) -> __m512 {
+ static_assert_imm8!(MASK);
+ let r = _mm512_permute_ps::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_f32x16(), src.as_f32x16()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permute_ps&expand=4169)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilps, MASK = 0b11_00_01_11))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_permute_ps<const MASK: i32>(k: __mmask16, a: __m512) -> __m512 {
+ static_assert_imm8!(MASK);
+ let r = _mm512_permute_ps::<MASK>(a);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r.as_f32x16(), zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permute_ps&expand=4165)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilps, MASK = 0b11_00_01_11))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_permute_ps<const MASK: i32>(
+ src: __m256,
+ k: __mmask8,
+ a: __m256,
+) -> __m256 {
+ let r = _mm256_permute_ps::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_f32x8(), src.as_f32x8()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permute_ps&expand=4166)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilps, MASK = 0b11_00_01_11))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_permute_ps<const MASK: i32>(k: __mmask8, a: __m256) -> __m256 {
+ let r = _mm256_permute_ps::<MASK>(a);
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, r.as_f32x8(), zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permute_ps&expand=4162)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilps, MASK = 0b11_00_01_11))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_permute_ps<const MASK: i32>(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ let r = _mm_permute_ps::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_f32x4(), src.as_f32x4()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permute_ps&expand=4163)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilps, MASK = 0b11_00_01_11))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_permute_ps<const MASK: i32>(k: __mmask8, a: __m128) -> __m128 {
+ let r = _mm_permute_ps::<MASK>(a);
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, r.as_f32x4(), zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permute_pd&expand=4161)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilpd, MASK = 0b11_01_10_01))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_permute_pd<const MASK: i32>(a: __m512d) -> __m512d {
+ static_assert_imm8!(MASK);
+ simd_shuffle8!(
+ a,
+ a,
+ <const MASK: i32> [
+ MASK as u32 & 0b1,
+ ((MASK as u32 >> 1) & 0b1),
+ ((MASK as u32 >> 2) & 0b1) + 2,
+ ((MASK as u32 >> 3) & 0b1) + 2,
+ ((MASK as u32 >> 4) & 0b1) + 4,
+ ((MASK as u32 >> 5) & 0b1) + 4,
+ ((MASK as u32 >> 6) & 0b1) + 6,
+ ((MASK as u32 >> 7) & 0b1) + 6,
+ ],
+ )
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permute_pd&expand=4159)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilpd, MASK = 0b11_01_10_01))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_permute_pd<const MASK: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ static_assert_imm8!(MASK);
+ let r = _mm512_permute_pd::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_f64x8(), src.as_f64x8()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permute_pd&expand=4160)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilpd, MASK = 0b11_01_10_01))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_permute_pd<const MASK: i32>(k: __mmask8, a: __m512d) -> __m512d {
+ static_assert_imm8!(MASK);
+ let r = _mm512_permute_pd::<MASK>(a);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r.as_f64x8(), zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permute_pd&expand=4156)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilpd, MASK = 0b11_01))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_permute_pd<const MASK: i32>(
+ src: __m256d,
+ k: __mmask8,
+ a: __m256d,
+) -> __m256d {
+ static_assert_imm4!(MASK);
+ let r = _mm256_permute_pd::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_f64x4(), src.as_f64x4()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permute_pd&expand=4157)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilpd, MASK = 0b11_01))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_permute_pd<const MASK: i32>(k: __mmask8, a: __m256d) -> __m256d {
+ static_assert_imm4!(MASK);
+ let r = _mm256_permute_pd::<MASK>(a);
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, r.as_f64x4(), zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permute_pd&expand=4153)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilpd, IMM2 = 0b01))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_permute_pd<const IMM2: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+) -> __m128d {
+ static_assert_imm2!(IMM2);
+ let r = _mm_permute_pd::<IMM2>(a);
+ transmute(simd_select_bitmask(k, r.as_f64x2(), src.as_f64x2()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permute_pd&expand=4154)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilpd, IMM2 = 0b01))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_permute_pd<const IMM2: i32>(k: __mmask8, a: __m128d) -> __m128d {
+ static_assert_imm2!(IMM2);
+ let r = _mm_permute_pd::<IMM2>(a);
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, r.as_f64x2(), zero))
+}
+
+/// Shuffle 64-bit integers in a within 256-bit lanes using the control in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutex_epi64&expand=4208)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_permutex_epi64<const MASK: i32>(a: __m512i) -> __m512i {
+ static_assert_imm8!(MASK);
+ simd_shuffle8!(
+ a,
+ a,
+ <const MASK: i32> [
+ MASK as u32 & 0b11,
+ (MASK as u32 >> 2) & 0b11,
+ ((MASK as u32 >> 4) & 0b11),
+ ((MASK as u32 >> 6) & 0b11),
+ (MASK as u32 & 0b11) + 4,
+ ((MASK as u32 >> 2) & 0b11) + 4,
+ ((MASK as u32 >> 4) & 0b11) + 4,
+ ((MASK as u32 >> 6) & 0b11) + 4,
+ ],
+ )
+}
+
+/// Shuffle 64-bit integers in a within 256-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutex_epi64&expand=4206)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_permutex_epi64<const MASK: i32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(MASK);
+ let r = _mm512_permutex_epi64::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_i64x8(), src.as_i64x8()))
+}
+
+/// Shuffle 64-bit integers in a within 256-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutex_epi64&expand=4207)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_permutex_epi64<const MASK: i32>(k: __mmask8, a: __m512i) -> __m512i {
+ static_assert_imm8!(MASK);
+ let r = _mm512_permutex_epi64::<MASK>(a);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, r.as_i64x8(), zero))
+}
+
+/// Shuffle 64-bit integers in a within 256-bit lanes using the control in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutex_epi64&expand=4205)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_permutex_epi64<const MASK: i32>(a: __m256i) -> __m256i {
+ static_assert_imm8!(MASK);
+ simd_shuffle4!(
+ a,
+ a,
+ <const MASK: i32> [
+ MASK as u32 & 0b11,
+ (MASK as u32 >> 2) & 0b11,
+ ((MASK as u32 >> 4) & 0b11),
+ ((MASK as u32 >> 6) & 0b11),
+ ],
+ )
+}
+
+/// Shuffle 64-bit integers in a within 256-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutex_epi6&expand=4203)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_permutex_epi64<const MASK: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(MASK);
+ let r = _mm256_permutex_epi64::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_i64x4(), src.as_i64x4()))
+}
+
+/// Shuffle 64-bit integers in a within 256-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutex_epi64&expand=4204)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_permutex_epi64<const MASK: i32>(k: __mmask8, a: __m256i) -> __m256i {
+ static_assert_imm8!(MASK);
+ let r = _mm256_permutex_epi64::<MASK>(a);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, r.as_i64x4(), zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 256-bit lanes using the control in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutex_pd&expand=4214)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_permutex_pd<const MASK: i32>(a: __m512d) -> __m512d {
+ static_assert_imm8!(MASK);
+ simd_shuffle8!(
+ a,
+ a,
+ <const MASK: i32> [
+ MASK as u32 & 0b11,
+ (MASK as u32 >> 2) & 0b11,
+ ((MASK as u32 >> 4) & 0b11),
+ ((MASK as u32 >> 6) & 0b11),
+ (MASK as u32 & 0b11) + 4,
+ ((MASK as u32 >> 2) & 0b11) + 4,
+ ((MASK as u32 >> 4) & 0b11) + 4,
+ ((MASK as u32 >> 6) & 0b11) + 4,
+ ],
+ )
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 256-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutex_pd&expand=4212)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_permutex_pd<const MASK: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+) -> __m512d {
+ let r = _mm512_permutex_pd::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_f64x8(), src.as_f64x8()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 256-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutex_pd&expand=4213)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_permutex_pd<const MASK: i32>(k: __mmask8, a: __m512d) -> __m512d {
+ let r = _mm512_permutex_pd::<MASK>(a);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r.as_f64x8(), zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 256-bit lanes using the control in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutex_pd&expand=4211)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_permutex_pd<const MASK: i32>(a: __m256d) -> __m256d {
+ static_assert_imm8!(MASK);
+ simd_shuffle4!(
+ a,
+ a,
+ <const MASK: i32> [
+ MASK as u32 & 0b11,
+ (MASK as u32 >> 2) & 0b11,
+ ((MASK as u32 >> 4) & 0b11),
+ ((MASK as u32 >> 6) & 0b11),
+ ],
+ )
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 256-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutex_pd&expand=4209)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_permutex_pd<const MASK: i32>(
+ src: __m256d,
+ k: __mmask8,
+ a: __m256d,
+) -> __m256d {
+ static_assert_imm8!(MASK);
+ let r = _mm256_permutex_pd::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_f64x4(), src.as_f64x4()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 256-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutex_pd&expand=4210)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_permutex_pd<const MASK: i32>(k: __mmask8, a: __m256d) -> __m256d {
+ static_assert_imm8!(MASK);
+ let r = _mm256_permutex_pd::<MASK>(a);
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, r.as_f64x4(), zero))
+}
+
+/// Shuffle 32-bit integers in a across lanes using the corresponding index in idx, and store the results in dst. Note that this intrinsic shuffles across 128-bit lanes, unlike past intrinsics that use the permutevar name. This intrinsic is identical to _mm512_permutexvar_epi32, and it is recommended that you use that intrinsic name.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutevar_epi32&expand=4182)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermd
+pub unsafe fn _mm512_permutevar_epi32(idx: __m512i, a: __m512i) -> __m512i {
+ transmute(vpermd(a.as_i32x16(), idx.as_i32x16()))
+}
+
+/// Shuffle 32-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). Note that this intrinsic shuffles across 128-bit lanes, unlike past intrinsics that use the permutevar name. This intrinsic is identical to _mm512_mask_permutexvar_epi32, and it is recommended that you use that intrinsic name.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutevar_epi32&expand=4181)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermd))]
+pub unsafe fn _mm512_mask_permutevar_epi32(
+ src: __m512i,
+ k: __mmask16,
+ idx: __m512i,
+ a: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutevar_epi32(idx, a).as_i32x16();
+ transmute(simd_select_bitmask(k, permute, src.as_i32x16()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutevar_ps&expand=4200)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilps))]
+pub unsafe fn _mm512_permutevar_ps(a: __m512, b: __m512i) -> __m512 {
+ transmute(vpermilps(a.as_f32x16(), b.as_i32x16()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutevar_ps&expand=4198)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilps))]
+pub unsafe fn _mm512_mask_permutevar_ps(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m512i,
+) -> __m512 {
+ let permute = _mm512_permutevar_ps(a, b).as_f32x16();
+ transmute(simd_select_bitmask(k, permute, src.as_f32x16()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutevar_ps&expand=4199)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilps))]
+pub unsafe fn _mm512_maskz_permutevar_ps(k: __mmask16, a: __m512, b: __m512i) -> __m512 {
+ let permute = _mm512_permutevar_ps(a, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm256_mask_permutevar_ps&expand=4195)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilps))]
+pub unsafe fn _mm256_mask_permutevar_ps(src: __m256, k: __mmask8, a: __m256, b: __m256i) -> __m256 {
+ let permute = _mm256_permutevar_ps(a, b).as_f32x8();
+ transmute(simd_select_bitmask(k, permute, src.as_f32x8()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutevar_ps&expand=4196)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilps))]
+pub unsafe fn _mm256_maskz_permutevar_ps(k: __mmask8, a: __m256, b: __m256i) -> __m256 {
+ let permute = _mm256_permutevar_ps(a, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permutevar_ps&expand=4192)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilps))]
+pub unsafe fn _mm_mask_permutevar_ps(src: __m128, k: __mmask8, a: __m128, b: __m128i) -> __m128 {
+ let permute = _mm_permutevar_ps(a, b).as_f32x4();
+ transmute(simd_select_bitmask(k, permute, src.as_f32x4()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permutevar_ps&expand=4193)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilps))]
+pub unsafe fn _mm_maskz_permutevar_ps(k: __mmask8, a: __m128, b: __m128i) -> __m128 {
+ let permute = _mm_permutevar_ps(a, b).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutevar_pd&expand=4191)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilpd))]
+pub unsafe fn _mm512_permutevar_pd(a: __m512d, b: __m512i) -> __m512d {
+ transmute(vpermilpd(a.as_f64x8(), b.as_i64x8()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutevar_pd&expand=4189)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilpd))]
+pub unsafe fn _mm512_mask_permutevar_pd(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512i,
+) -> __m512d {
+ let permute = _mm512_permutevar_pd(a, b).as_f64x8();
+ transmute(simd_select_bitmask(k, permute, src.as_f64x8()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutevar_pd&expand=4190)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilpd))]
+pub unsafe fn _mm512_maskz_permutevar_pd(k: __mmask8, a: __m512d, b: __m512i) -> __m512d {
+ let permute = _mm512_permutevar_pd(a, b).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutevar_pd&expand=4186)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilpd))]
+pub unsafe fn _mm256_mask_permutevar_pd(
+ src: __m256d,
+ k: __mmask8,
+ a: __m256d,
+ b: __m256i,
+) -> __m256d {
+ let permute = _mm256_permutevar_pd(a, b).as_f64x4();
+ transmute(simd_select_bitmask(k, permute, src.as_f64x4()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutevar_pd&expand=4187)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilpd))]
+pub unsafe fn _mm256_maskz_permutevar_pd(k: __mmask8, a: __m256d, b: __m256i) -> __m256d {
+ let permute = _mm256_permutevar_pd(a, b).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permutevar_pd&expand=4183)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilpd))]
+pub unsafe fn _mm_mask_permutevar_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128i) -> __m128d {
+ let permute = _mm_permutevar_pd(a, b).as_f64x2();
+ transmute(simd_select_bitmask(k, permute, src.as_f64x2()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a within 128-bit lanes using the control in b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permutevar_pd&expand=4184)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermilpd))]
+pub unsafe fn _mm_maskz_permutevar_pd(k: __mmask8, a: __m128d, b: __m128i) -> __m128d {
+ let permute = _mm_permutevar_pd(a, b).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 32-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutexvar_epi32&expand=4301)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermd
+pub unsafe fn _mm512_permutexvar_epi32(idx: __m512i, a: __m512i) -> __m512i {
+ transmute(vpermd(a.as_i32x16(), idx.as_i32x16()))
+}
+
+/// Shuffle 32-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutexvar_epi32&expand=4299)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermd))]
+pub unsafe fn _mm512_mask_permutexvar_epi32(
+ src: __m512i,
+ k: __mmask16,
+ idx: __m512i,
+ a: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutexvar_epi32(idx, a).as_i32x16();
+ transmute(simd_select_bitmask(k, permute, src.as_i32x16()))
+}
+
+/// Shuffle 32-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutexvar_epi32&expand=4300)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermd))]
+pub unsafe fn _mm512_maskz_permutexvar_epi32(k: __mmask16, idx: __m512i, a: __m512i) -> __m512i {
+ let permute = _mm512_permutexvar_epi32(idx, a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 32-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutexvar_epi32&expand=4298)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermd
+pub unsafe fn _mm256_permutexvar_epi32(idx: __m256i, a: __m256i) -> __m256i {
+ transmute(_mm256_permutevar8x32_epi32(a, idx)) // llvm use llvm.x86.avx2.permd
+}
+
+/// Shuffle 32-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutexvar_epi32&expand=4296)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermd))]
+pub unsafe fn _mm256_mask_permutexvar_epi32(
+ src: __m256i,
+ k: __mmask8,
+ idx: __m256i,
+ a: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutexvar_epi32(idx, a).as_i32x8();
+ transmute(simd_select_bitmask(k, permute, src.as_i32x8()))
+}
+
+/// Shuffle 32-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutexvar_epi32&expand=4297)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermd))]
+pub unsafe fn _mm256_maskz_permutexvar_epi32(k: __mmask8, idx: __m256i, a: __m256i) -> __m256i {
+ let permute = _mm256_permutexvar_epi32(idx, a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 64-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutexvar_epi64&expand=4307)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermq
+pub unsafe fn _mm512_permutexvar_epi64(idx: __m512i, a: __m512i) -> __m512i {
+ transmute(vpermq(a.as_i64x8(), idx.as_i64x8()))
+}
+
+/// Shuffle 64-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutexvar_epi64&expand=4305)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermq))]
+pub unsafe fn _mm512_mask_permutexvar_epi64(
+ src: __m512i,
+ k: __mmask8,
+ idx: __m512i,
+ a: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutexvar_epi64(idx, a).as_i64x8();
+ transmute(simd_select_bitmask(k, permute, src.as_i64x8()))
+}
+
+/// Shuffle 64-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutexvar_epi64&expand=4306)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermq))]
+pub unsafe fn _mm512_maskz_permutexvar_epi64(k: __mmask8, idx: __m512i, a: __m512i) -> __m512i {
+ let permute = _mm512_permutexvar_epi64(idx, a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 64-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutexvar_epi64&expand=4304)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermq
+pub unsafe fn _mm256_permutexvar_epi64(idx: __m256i, a: __m256i) -> __m256i {
+ transmute(vpermq256(a.as_i64x4(), idx.as_i64x4()))
+}
+
+/// Shuffle 64-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutexvar_epi64&expand=4302)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermq))]
+pub unsafe fn _mm256_mask_permutexvar_epi64(
+ src: __m256i,
+ k: __mmask8,
+ idx: __m256i,
+ a: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutexvar_epi64(idx, a).as_i64x4();
+ transmute(simd_select_bitmask(k, permute, src.as_i64x4()))
+}
+
+/// Shuffle 64-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutexvar_epi64&expand=4303)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermq))]
+pub unsafe fn _mm256_maskz_permutexvar_epi64(k: __mmask8, idx: __m256i, a: __m256i) -> __m256i {
+ let permute = _mm256_permutexvar_epi64(idx, a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a across lanes using the corresponding index in idx.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutevar_ps&expand=4200)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermps))]
+pub unsafe fn _mm512_permutexvar_ps(idx: __m512i, a: __m512) -> __m512 {
+ transmute(vpermps(a.as_f32x16(), idx.as_i32x16()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutexvar_ps&expand=4326)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermps))]
+pub unsafe fn _mm512_mask_permutexvar_ps(
+ src: __m512,
+ k: __mmask16,
+ idx: __m512i,
+ a: __m512,
+) -> __m512 {
+ let permute = _mm512_permutexvar_ps(idx, a).as_f32x16();
+ transmute(simd_select_bitmask(k, permute, src.as_f32x16()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutexvar_ps&expand=4327)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermps))]
+pub unsafe fn _mm512_maskz_permutexvar_ps(k: __mmask16, idx: __m512i, a: __m512) -> __m512 {
+ let permute = _mm512_permutexvar_ps(idx, a).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a across lanes using the corresponding index in idx.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutexvar_ps&expand=4325)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermps))]
+pub unsafe fn _mm256_permutexvar_ps(idx: __m256i, a: __m256) -> __m256 {
+ transmute(_mm256_permutevar8x32_ps(a, idx)) //llvm.x86.avx2.permps
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutexvar_ps&expand=4323)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermps))]
+pub unsafe fn _mm256_mask_permutexvar_ps(
+ src: __m256,
+ k: __mmask8,
+ idx: __m256i,
+ a: __m256,
+) -> __m256 {
+ let permute = _mm256_permutexvar_ps(idx, a).as_f32x8();
+ transmute(simd_select_bitmask(k, permute, src.as_f32x8()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutexvar_ps&expand=4324)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermps))]
+pub unsafe fn _mm256_maskz_permutexvar_ps(k: __mmask8, idx: __m256i, a: __m256) -> __m256 {
+ let permute = _mm256_permutexvar_ps(idx, a).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutexvar_pd&expand=4322)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermpd))]
+pub unsafe fn _mm512_permutexvar_pd(idx: __m512i, a: __m512d) -> __m512d {
+ transmute(vpermpd(a.as_f64x8(), idx.as_i64x8()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutexvar_pd&expand=4320)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermpd))]
+pub unsafe fn _mm512_mask_permutexvar_pd(
+ src: __m512d,
+ k: __mmask8,
+ idx: __m512i,
+ a: __m512d,
+) -> __m512d {
+ let permute = _mm512_permutexvar_pd(idx, a).as_f64x8();
+ transmute(simd_select_bitmask(k, permute, src.as_f64x8()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutexvar_pd&expand=4321)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermpd))]
+pub unsafe fn _mm512_maskz_permutexvar_pd(k: __mmask8, idx: __m512i, a: __m512d) -> __m512d {
+ let permute = _mm512_permutexvar_pd(idx, a).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutexvar_pd&expand=4319)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermpd))]
+pub unsafe fn _mm256_permutexvar_pd(idx: __m256i, a: __m256d) -> __m256d {
+ transmute(vpermpd256(a.as_f64x4(), idx.as_i64x4()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutexvar_pd&expand=4317)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermpd))]
+pub unsafe fn _mm256_mask_permutexvar_pd(
+ src: __m256d,
+ k: __mmask8,
+ idx: __m256i,
+ a: __m256d,
+) -> __m256d {
+ let permute = _mm256_permutexvar_pd(idx, a).as_f64x4();
+ transmute(simd_select_bitmask(k, permute, src.as_f64x4()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutexvar_pd&expand=4318)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermpd))]
+pub unsafe fn _mm256_maskz_permutexvar_pd(k: __mmask8, idx: __m256i, a: __m256d) -> __m256d {
+ let permute = _mm256_permutexvar_pd(idx, a).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutex2var_epi32&expand=4238)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2d or vpermt2d
+pub unsafe fn _mm512_permutex2var_epi32(a: __m512i, idx: __m512i, b: __m512i) -> __m512i {
+ transmute(vpermi2d(a.as_i32x16(), idx.as_i32x16(), b.as_i32x16()))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutex2var_epi32&expand=4235)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermt2d))]
+pub unsafe fn _mm512_mask_permutex2var_epi32(
+ a: __m512i,
+ k: __mmask16,
+ idx: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutex2var_epi32(a, idx, b).as_i32x16();
+ transmute(simd_select_bitmask(k, permute, a.as_i32x16()))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutex2var_epi32&expand=4237)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2d or vpermt2d
+pub unsafe fn _mm512_maskz_permutex2var_epi32(
+ k: __mmask16,
+ a: __m512i,
+ idx: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutex2var_epi32(a, idx, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask2_permutex2var_epi32&expand=4236)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermi2d))]
+pub unsafe fn _mm512_mask2_permutex2var_epi32(
+ a: __m512i,
+ idx: __m512i,
+ k: __mmask16,
+ b: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutex2var_epi32(a, idx, b).as_i32x16();
+ transmute(simd_select_bitmask(k, permute, idx.as_i32x16()))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutex2var_epi32&expand=4234)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2d or vpermt2d
+pub unsafe fn _mm256_permutex2var_epi32(a: __m256i, idx: __m256i, b: __m256i) -> __m256i {
+ transmute(vpermi2d256(a.as_i32x8(), idx.as_i32x8(), b.as_i32x8()))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutex2var_epi32&expand=4231)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermt2d))]
+pub unsafe fn _mm256_mask_permutex2var_epi32(
+ a: __m256i,
+ k: __mmask8,
+ idx: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutex2var_epi32(a, idx, b).as_i32x8();
+ transmute(simd_select_bitmask(k, permute, a.as_i32x8()))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutex2var_epi32&expand=4233)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2d or vpermt2d
+pub unsafe fn _mm256_maskz_permutex2var_epi32(
+ k: __mmask8,
+ a: __m256i,
+ idx: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutex2var_epi32(a, idx, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask2_permutex2var_epi32&expand=4232)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermi2d))]
+pub unsafe fn _mm256_mask2_permutex2var_epi32(
+ a: __m256i,
+ idx: __m256i,
+ k: __mmask8,
+ b: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutex2var_epi32(a, idx, b).as_i32x8();
+ transmute(simd_select_bitmask(k, permute, idx.as_i32x8()))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutex2var_epi32&expand=4230)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2d or vpermt2d
+pub unsafe fn _mm_permutex2var_epi32(a: __m128i, idx: __m128i, b: __m128i) -> __m128i {
+ transmute(vpermi2d128(a.as_i32x4(), idx.as_i32x4(), b.as_i32x4()))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permutex2var_epi32&expand=4227)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermt2d))]
+pub unsafe fn _mm_mask_permutex2var_epi32(
+ a: __m128i,
+ k: __mmask8,
+ idx: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let permute = _mm_permutex2var_epi32(a, idx, b).as_i32x4();
+ transmute(simd_select_bitmask(k, permute, a.as_i32x4()))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permutex2var_epi32&expand=4229)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2d or vpermt2d
+pub unsafe fn _mm_maskz_permutex2var_epi32(
+ k: __mmask8,
+ a: __m128i,
+ idx: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let permute = _mm_permutex2var_epi32(a, idx, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 32-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask2_permutex2var_epi32&expand=4228)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermi2d))]
+pub unsafe fn _mm_mask2_permutex2var_epi32(
+ a: __m128i,
+ idx: __m128i,
+ k: __mmask8,
+ b: __m128i,
+) -> __m128i {
+ let permute = _mm_permutex2var_epi32(a, idx, b).as_i32x4();
+ transmute(simd_select_bitmask(k, permute, idx.as_i32x4()))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutex2var_epi64&expand=4250)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2q or vpermt2q
+pub unsafe fn _mm512_permutex2var_epi64(a: __m512i, idx: __m512i, b: __m512i) -> __m512i {
+ transmute(vpermi2q(a.as_i64x8(), idx.as_i64x8(), b.as_i64x8()))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutex2var_epi64&expand=4247)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermt2q))]
+pub unsafe fn _mm512_mask_permutex2var_epi64(
+ a: __m512i,
+ k: __mmask8,
+ idx: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutex2var_epi64(a, idx, b).as_i64x8();
+ transmute(simd_select_bitmask(k, permute, a.as_i64x8()))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutex2var_epi64&expand=4249)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2q or vpermt2q
+pub unsafe fn _mm512_maskz_permutex2var_epi64(
+ k: __mmask8,
+ a: __m512i,
+ idx: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutex2var_epi64(a, idx, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask2_permutex2var_epi64&expand=4248)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermi2q))]
+pub unsafe fn _mm512_mask2_permutex2var_epi64(
+ a: __m512i,
+ idx: __m512i,
+ k: __mmask8,
+ b: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutex2var_epi64(a, idx, b).as_i64x8();
+ transmute(simd_select_bitmask(k, permute, idx.as_i64x8()))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutex2var_epi64&expand=4246)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2q or vpermt2q
+pub unsafe fn _mm256_permutex2var_epi64(a: __m256i, idx: __m256i, b: __m256i) -> __m256i {
+ transmute(vpermi2q256(a.as_i64x4(), idx.as_i64x4(), b.as_i64x4()))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutex2var_epi64&expand=4243)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermt2q))]
+pub unsafe fn _mm256_mask_permutex2var_epi64(
+ a: __m256i,
+ k: __mmask8,
+ idx: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutex2var_epi64(a, idx, b).as_i64x4();
+ transmute(simd_select_bitmask(k, permute, a.as_i64x4()))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutex2var_epi64&expand=4245)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2q or vpermt2q
+pub unsafe fn _mm256_maskz_permutex2var_epi64(
+ k: __mmask8,
+ a: __m256i,
+ idx: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutex2var_epi64(a, idx, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask2_permutex2var_epi64&expand=4244)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermi2q))]
+pub unsafe fn _mm256_mask2_permutex2var_epi64(
+ a: __m256i,
+ idx: __m256i,
+ k: __mmask8,
+ b: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutex2var_epi64(a, idx, b).as_i64x4();
+ transmute(simd_select_bitmask(k, permute, idx.as_i64x4()))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutex2var_epi64&expand=4242)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2q or vpermt2q
+pub unsafe fn _mm_permutex2var_epi64(a: __m128i, idx: __m128i, b: __m128i) -> __m128i {
+ transmute(vpermi2q128(a.as_i64x2(), idx.as_i64x2(), b.as_i64x2()))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permutex2var_epi64&expand=4239)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermt2q))]
+pub unsafe fn _mm_mask_permutex2var_epi64(
+ a: __m128i,
+ k: __mmask8,
+ idx: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let permute = _mm_permutex2var_epi64(a, idx, b).as_i64x2();
+ transmute(simd_select_bitmask(k, permute, a.as_i64x2()))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permutex2var_epi64&expand=4241)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2q or vpermt2q
+pub unsafe fn _mm_maskz_permutex2var_epi64(
+ k: __mmask8,
+ a: __m128i,
+ idx: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let permute = _mm_permutex2var_epi64(a, idx, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 64-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask2_permutex2var_epi64&expand=4240)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermi2q))]
+pub unsafe fn _mm_mask2_permutex2var_epi64(
+ a: __m128i,
+ idx: __m128i,
+ k: __mmask8,
+ b: __m128i,
+) -> __m128i {
+ let permute = _mm_permutex2var_epi64(a, idx, b).as_i64x2();
+ transmute(simd_select_bitmask(k, permute, idx.as_i64x2()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutex2var_ps&expand=4286)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2ps or vpermt2ps
+pub unsafe fn _mm512_permutex2var_ps(a: __m512, idx: __m512i, b: __m512) -> __m512 {
+ transmute(vpermi2ps(a.as_f32x16(), idx.as_i32x16(), b.as_f32x16()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutex2var_ps&expand=4283)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermt2ps))]
+pub unsafe fn _mm512_mask_permutex2var_ps(
+ a: __m512,
+ k: __mmask16,
+ idx: __m512i,
+ b: __m512,
+) -> __m512 {
+ let permute = _mm512_permutex2var_ps(a, idx, b).as_f32x16();
+ transmute(simd_select_bitmask(k, permute, a.as_f32x16()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutex2var_ps&expand=4285)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2ps or vpermt2ps
+pub unsafe fn _mm512_maskz_permutex2var_ps(
+ k: __mmask16,
+ a: __m512,
+ idx: __m512i,
+ b: __m512,
+) -> __m512 {
+ let permute = _mm512_permutex2var_ps(a, idx, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask2_permutex2var_ps&expand=4284)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2ps, but it shows vpermt2ps
+pub unsafe fn _mm512_mask2_permutex2var_ps(
+ a: __m512,
+ idx: __m512i,
+ k: __mmask16,
+ b: __m512,
+) -> __m512 {
+ let permute = _mm512_permutex2var_ps(a, idx, b).as_f32x16();
+ let idx = _mm512_castsi512_ps(idx).as_f32x16();
+ transmute(simd_select_bitmask(k, permute, idx))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutex2var_ps&expand=4282)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2ps or vpermt2ps
+pub unsafe fn _mm256_permutex2var_ps(a: __m256, idx: __m256i, b: __m256) -> __m256 {
+ transmute(vpermi2ps256(a.as_f32x8(), idx.as_i32x8(), b.as_f32x8()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutex2var_ps&expand=4279)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermt2ps))]
+pub unsafe fn _mm256_mask_permutex2var_ps(
+ a: __m256,
+ k: __mmask8,
+ idx: __m256i,
+ b: __m256,
+) -> __m256 {
+ let permute = _mm256_permutex2var_ps(a, idx, b).as_f32x8();
+ transmute(simd_select_bitmask(k, permute, a.as_f32x8()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutex2var_ps&expand=4281)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2ps or vpermt2ps
+pub unsafe fn _mm256_maskz_permutex2var_ps(
+ k: __mmask8,
+ a: __m256,
+ idx: __m256i,
+ b: __m256,
+) -> __m256 {
+ let permute = _mm256_permutex2var_ps(a, idx, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask2_permutex2var_ps&expand=4280)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2ps, but it shows vpermt2ps
+pub unsafe fn _mm256_mask2_permutex2var_ps(
+ a: __m256,
+ idx: __m256i,
+ k: __mmask8,
+ b: __m256,
+) -> __m256 {
+ let permute = _mm256_permutex2var_ps(a, idx, b).as_f32x8();
+ let idx = _mm256_castsi256_ps(idx).as_f32x8();
+ transmute(simd_select_bitmask(k, permute, idx))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutex2var_ps&expand=4278)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2ps or vpermt2ps
+pub unsafe fn _mm_permutex2var_ps(a: __m128, idx: __m128i, b: __m128) -> __m128 {
+ transmute(vpermi2ps128(a.as_f32x4(), idx.as_i32x4(), b.as_f32x4()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permutex2var_ps&expand=4275)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermt2ps))]
+pub unsafe fn _mm_mask_permutex2var_ps(a: __m128, k: __mmask8, idx: __m128i, b: __m128) -> __m128 {
+ let permute = _mm_permutex2var_ps(a, idx, b).as_f32x4();
+ transmute(simd_select_bitmask(k, permute, a.as_f32x4()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permutex2var_ps&expand=4277)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2ps or vpermt2ps
+pub unsafe fn _mm_maskz_permutex2var_ps(k: __mmask8, a: __m128, idx: __m128i, b: __m128) -> __m128 {
+ let permute = _mm_permutex2var_ps(a, idx, b).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask2_permutex2var_ps&expand=4276)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2ps, but it shows vpermt2ps
+pub unsafe fn _mm_mask2_permutex2var_ps(a: __m128, idx: __m128i, k: __mmask8, b: __m128) -> __m128 {
+ let permute = _mm_permutex2var_ps(a, idx, b).as_f32x4();
+ let idx = _mm_castsi128_ps(idx).as_f32x4();
+ transmute(simd_select_bitmask(k, permute, idx))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutex2var_pd&expand=4274)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2pd or vpermt2pd
+pub unsafe fn _mm512_permutex2var_pd(a: __m512d, idx: __m512i, b: __m512d) -> __m512d {
+ transmute(vpermi2pd(a.as_f64x8(), idx.as_i64x8(), b.as_f64x8()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutex2var_pd&expand=4271)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermt2pd))]
+pub unsafe fn _mm512_mask_permutex2var_pd(
+ a: __m512d,
+ k: __mmask8,
+ idx: __m512i,
+ b: __m512d,
+) -> __m512d {
+ let permute = _mm512_permutex2var_pd(a, idx, b).as_f64x8();
+ transmute(simd_select_bitmask(k, permute, a.as_f64x8()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutex2var_pd&expand=4273)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2pd or vpermt2pd
+pub unsafe fn _mm512_maskz_permutex2var_pd(
+ k: __mmask8,
+ a: __m512d,
+ idx: __m512i,
+ b: __m512d,
+) -> __m512d {
+ let permute = _mm512_permutex2var_pd(a, idx, b).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask2_permutex2var_pd&expand=4272)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2pd, but it shows vpermt2pd
+pub unsafe fn _mm512_mask2_permutex2var_pd(
+ a: __m512d,
+ idx: __m512i,
+ k: __mmask8,
+ b: __m512d,
+) -> __m512d {
+ let permute = _mm512_permutex2var_pd(a, idx, b).as_f64x8();
+ let idx = _mm512_castsi512_pd(idx).as_f64x8();
+ transmute(simd_select_bitmask(k, permute, idx))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutex2var_pd&expand=4270)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2pd or vpermt2pd
+pub unsafe fn _mm256_permutex2var_pd(a: __m256d, idx: __m256i, b: __m256d) -> __m256d {
+ transmute(vpermi2pd256(a.as_f64x4(), idx.as_i64x4(), b.as_f64x4()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutex2var_pd&expand=4267)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermt2pd))]
+pub unsafe fn _mm256_mask_permutex2var_pd(
+ a: __m256d,
+ k: __mmask8,
+ idx: __m256i,
+ b: __m256d,
+) -> __m256d {
+ let permute = _mm256_permutex2var_pd(a, idx, b).as_f64x4();
+ transmute(simd_select_bitmask(k, permute, a.as_f64x4()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutex2var_pd&expand=4269)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2pd or vpermt2pd
+pub unsafe fn _mm256_maskz_permutex2var_pd(
+ k: __mmask8,
+ a: __m256d,
+ idx: __m256i,
+ b: __m256d,
+) -> __m256d {
+ let permute = _mm256_permutex2var_pd(a, idx, b).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask2_permutex2var_pd&expand=4268)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2pd, but it shows vpermt2pd
+pub unsafe fn _mm256_mask2_permutex2var_pd(
+ a: __m256d,
+ idx: __m256i,
+ k: __mmask8,
+ b: __m256d,
+) -> __m256d {
+ let permute = _mm256_permutex2var_pd(a, idx, b).as_f64x4();
+ let idx = _mm256_castsi256_pd(idx).as_f64x4();
+ transmute(simd_select_bitmask(k, permute, idx))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutex2var_pd&expand=4266)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2pd or vpermt2pd
+pub unsafe fn _mm_permutex2var_pd(a: __m128d, idx: __m128i, b: __m128d) -> __m128d {
+ transmute(vpermi2pd128(a.as_f64x2(), idx.as_i64x2(), b.as_f64x2()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permutex2var_pd&expand=4263)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermt2pd))]
+pub unsafe fn _mm_mask_permutex2var_pd(
+ a: __m128d,
+ k: __mmask8,
+ idx: __m128i,
+ b: __m128d,
+) -> __m128d {
+ let permute = _mm_permutex2var_pd(a, idx, b).as_f64x2();
+ transmute(simd_select_bitmask(k, permute, a.as_f64x2()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permutex2var_pd&expand=4265)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //vpermi2pd or vpermt2pd
+pub unsafe fn _mm_maskz_permutex2var_pd(
+ k: __mmask8,
+ a: __m128d,
+ idx: __m128i,
+ b: __m128d,
+) -> __m128d {
+ let permute = _mm_permutex2var_pd(a, idx, b).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from idx when the corresponding mask bit is not set)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask2_permutex2var_pd&expand=4264)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2pd, but it shows vpermt2pd
+pub unsafe fn _mm_mask2_permutex2var_pd(
+ a: __m128d,
+ idx: __m128i,
+ k: __mmask8,
+ b: __m128d,
+) -> __m128d {
+ let permute = _mm_permutex2var_pd(a, idx, b).as_f64x2();
+ let idx = _mm_castsi128_pd(idx).as_f64x2();
+ transmute(simd_select_bitmask(k, permute, idx))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_shuffle_epi32&expand=5150)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpermilps, MASK = 9))] //should be vpshufd
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_shuffle_epi32<const MASK: _MM_PERM_ENUM>(a: __m512i) -> __m512i {
+ static_assert_imm8!(MASK);
+ let r: i32x16 = simd_shuffle16!(
+ a.as_i32x16(),
+ a.as_i32x16(),
+ <const MASK: _MM_PERM_ENUM> [
+ MASK as u32 & 0b11,
+ (MASK as u32 >> 2) & 0b11,
+ (MASK as u32 >> 4) & 0b11,
+ (MASK as u32 >> 6) & 0b11,
+ (MASK as u32 & 0b11) + 4,
+ ((MASK as u32 >> 2) & 0b11) + 4,
+ ((MASK as u32 >> 4) & 0b11) + 4,
+ ((MASK as u32 >> 6) & 0b11) + 4,
+ (MASK as u32 & 0b11) + 8,
+ ((MASK as u32 >> 2) & 0b11) + 8,
+ ((MASK as u32 >> 4) & 0b11) + 8,
+ ((MASK as u32 >> 6) & 0b11) + 8,
+ (MASK as u32 & 0b11) + 12,
+ ((MASK as u32 >> 2) & 0b11) + 12,
+ ((MASK as u32 >> 4) & 0b11) + 12,
+ ((MASK as u32 >> 6) & 0b11) + 12,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffle 32-bit integers in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shuffle_epi32&expand=5148)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpshufd, MASK = 9))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_shuffle_epi32<const MASK: _MM_PERM_ENUM>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_epi32::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_i32x16(), src.as_i32x16()))
+}
+
+/// Shuffle 32-bit integers in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shuffle_epi32&expand=5149)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpshufd, MASK = 9))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_shuffle_epi32<const MASK: _MM_PERM_ENUM>(
+ k: __mmask16,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_epi32::<MASK>(a);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, r.as_i32x16(), zero))
+}
+
+/// Shuffle 32-bit integers in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shuffle_epi32&expand=5145)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshufd, MASK = 9))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_shuffle_epi32<const MASK: _MM_PERM_ENUM>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_epi32::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_i32x8(), src.as_i32x8()))
+}
+
+/// Shuffle 32-bit integers in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shuffle_epi32&expand=5146)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshufd, MASK = 9))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_shuffle_epi32<const MASK: _MM_PERM_ENUM>(
+ k: __mmask8,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_epi32::<MASK>(a);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r.as_i32x8(), zero))
+}
+
+/// Shuffle 32-bit integers in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shuffle_epi32&expand=5142)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshufd, MASK = 9))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_mask_shuffle_epi32<const MASK: _MM_PERM_ENUM>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm8!(MASK);
+ let r = _mm_shuffle_epi32::<MASK>(a);
+ transmute(simd_select_bitmask(k, r.as_i32x4(), src.as_i32x4()))
+}
+
+/// Shuffle 32-bit integers in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shuffle_epi32&expand=5143)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshufd, MASK = 9))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_maskz_shuffle_epi32<const MASK: _MM_PERM_ENUM>(
+ k: __mmask8,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm8!(MASK);
+ let r = _mm_shuffle_epi32::<MASK>(a);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r.as_i32x4(), zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shuffle_ps&expand=5203)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufps, MASK = 3))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shuffle_ps<const MASK: i32>(a: __m512, b: __m512) -> __m512 {
+ static_assert_imm8!(MASK);
+ simd_shuffle16!(
+ a,
+ b,
+ <const MASK: i32> [
+ MASK as u32 & 0b11,
+ (MASK as u32 >> 2) & 0b11,
+ ((MASK as u32 >> 4) & 0b11) + 16,
+ ((MASK as u32 >> 6) & 0b11) + 16,
+ (MASK as u32 & 0b11) + 4,
+ ((MASK as u32 >> 2) & 0b11) + 4,
+ ((MASK as u32 >> 4) & 0b11) + 20,
+ ((MASK as u32 >> 6) & 0b11) + 20,
+ (MASK as u32 & 0b11) + 8,
+ ((MASK as u32 >> 2) & 0b11) + 8,
+ ((MASK as u32 >> 4) & 0b11) + 24,
+ ((MASK as u32 >> 6) & 0b11) + 24,
+ (MASK as u32 & 0b11) + 12,
+ ((MASK as u32 >> 2) & 0b11) + 12,
+ ((MASK as u32 >> 4) & 0b11) + 28,
+ ((MASK as u32 >> 6) & 0b11) + 28,
+ ],
+ )
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shuffle_ps&expand=5201)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufps, MASK = 3))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shuffle_ps<const MASK: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_ps::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f32x16(), src.as_f32x16()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shuffle_ps&expand=5202)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufps, MASK = 3))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shuffle_ps<const MASK: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_ps::<MASK>(a, b);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r.as_f32x16(), zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shuffle_ps&expand=5198)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufps, MASK = 3))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shuffle_ps<const MASK: i32>(
+ src: __m256,
+ k: __mmask8,
+ a: __m256,
+ b: __m256,
+) -> __m256 {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_ps::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f32x8(), src.as_f32x8()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shuffle_ps&expand=5199)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufps, MASK = 3))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shuffle_ps<const MASK: i32>(
+ k: __mmask8,
+ a: __m256,
+ b: __m256,
+) -> __m256 {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_ps::<MASK>(a, b);
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, r.as_f32x8(), zero))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shuffle_ps&expand=5195)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufps, MASK = 3))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_shuffle_ps<const MASK: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm8!(MASK);
+ let r = _mm_shuffle_ps::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f32x4(), src.as_f32x4()))
+}
+
+/// Shuffle single-precision (32-bit) floating-point elements in a using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shuffle_ps&expand=5196)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufps, MASK = 3))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_shuffle_ps<const MASK: i32>(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ static_assert_imm8!(MASK);
+ let r = _mm_shuffle_ps::<MASK>(a, b);
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, r.as_f32x4(), zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements within 128-bit lanes using the control in imm8, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shuffle_pd&expand=5192)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufpd, MASK = 3))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shuffle_pd<const MASK: i32>(a: __m512d, b: __m512d) -> __m512d {
+ static_assert_imm8!(MASK);
+ simd_shuffle8!(
+ a,
+ b,
+ <const MASK: i32> [
+ MASK as u32 & 0b1,
+ ((MASK as u32 >> 1) & 0b1) + 8,
+ ((MASK as u32 >> 2) & 0b1) + 2,
+ ((MASK as u32 >> 3) & 0b1) + 10,
+ ((MASK as u32 >> 4) & 0b1) + 4,
+ ((MASK as u32 >> 5) & 0b1) + 12,
+ ((MASK as u32 >> 6) & 0b1) + 6,
+ ((MASK as u32 >> 7) & 0b1) + 14,
+ ],
+ )
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shuffle_pd&expand=5190)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufpd, MASK = 3))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shuffle_pd<const MASK: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_pd::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f64x8(), src.as_f64x8()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shuffle_pd&expand=5191)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufpd, MASK = 3))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shuffle_pd<const MASK: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_pd::<MASK>(a, b);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r.as_f64x8(), zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shuffle_pd&expand=5187)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufpd, MASK = 3))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shuffle_pd<const MASK: i32>(
+ src: __m256d,
+ k: __mmask8,
+ a: __m256d,
+ b: __m256d,
+) -> __m256d {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_pd::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f64x4(), src.as_f64x4()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shuffle_pd&expand=5188)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufpd, MASK = 3))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shuffle_pd<const MASK: i32>(
+ k: __mmask8,
+ a: __m256d,
+ b: __m256d,
+) -> __m256d {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_pd::<MASK>(a, b);
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, r.as_f64x4(), zero))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements within 128-bit lanes using the control in imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shuffle_pd&expand=5184)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufpd, MASK = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_shuffle_pd<const MASK: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm8!(MASK);
+ let r = _mm_shuffle_pd::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f64x2(), src.as_f64x2()))
+}
+
+/// Shuffle double-precision (64-bit) floating-point elements within 128-bit lanes using the control in imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shuffle_pd&expand=5185)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufpd, MASK = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_shuffle_pd<const MASK: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm8!(MASK);
+ let r = _mm_shuffle_pd::<MASK>(a, b);
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, r.as_f64x2(), zero))
+}
+
+/// Shuffle 128-bits (composed of 4 32-bit integers) selected by imm8 from a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shuffle_i32&expand=5177)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b10_01_01_01))] //should be vshufi32x4
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shuffle_i32x4<const MASK: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(MASK);
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ let r: i32x16 = simd_shuffle16!(
+ a,
+ b,
+ <const MASK: i32> [
+ (MASK as u32 & 0b11) * 4 + 0,
+ (MASK as u32 & 0b11) * 4 + 1,
+ (MASK as u32 & 0b11) * 4 + 2,
+ (MASK as u32 & 0b11) * 4 + 3,
+ ((MASK as u32 >> 2) & 0b11) * 4 + 0,
+ ((MASK as u32 >> 2) & 0b11) * 4 + 1,
+ ((MASK as u32 >> 2) & 0b11) * 4 + 2,
+ ((MASK as u32 >> 2) & 0b11) * 4 + 3,
+ ((MASK as u32 >> 4) & 0b11) * 4 + 0 + 16,
+ ((MASK as u32 >> 4) & 0b11) * 4 + 1 + 16,
+ ((MASK as u32 >> 4) & 0b11) * 4 + 2 + 16,
+ ((MASK as u32 >> 4) & 0b11) * 4 + 3 + 16,
+ ((MASK as u32 >> 6) & 0b11) * 4 + 0 + 16,
+ ((MASK as u32 >> 6) & 0b11) * 4 + 1 + 16,
+ ((MASK as u32 >> 6) & 0b11) * 4 + 2 + 16,
+ ((MASK as u32 >> 6) & 0b11) * 4 + 3 + 16,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffle 128-bits (composed of 4 32-bit integers) selected by imm8 from a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shuffle_i32x&expand=5175)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufi32x4, MASK = 0b10_11_01_01))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shuffle_i32x4<const MASK: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_i32x4::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i32x16(), src.as_i32x16()))
+}
+
+/// Shuffle 128-bits (composed of 4 32-bit integers) selected by imm8 from a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shuffle_i32&expand=5176)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufi32x4, MASK = 0b10_11_01_01))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shuffle_i32x4<const MASK: i32>(
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_i32x4::<MASK>(a, b);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, r.as_i32x16(), zero))
+}
+
+/// Shuffle 128-bits (composed of 4 32-bit integers) selected by imm8 from a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shuffle_i32x4&expand=5174)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b11))] //should be vshufi32x4
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_shuffle_i32x4<const MASK: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(MASK);
+ let a = a.as_i32x8();
+ let b = b.as_i32x8();
+ let r: i32x8 = simd_shuffle8!(
+ a,
+ b,
+ <const MASK: i32> [
+ (MASK as u32 & 0b1) * 4 + 0,
+ (MASK as u32 & 0b1) * 4 + 1,
+ (MASK as u32 & 0b1) * 4 + 2,
+ (MASK as u32 & 0b1) * 4 + 3,
+ ((MASK as u32 >> 1) & 0b1) * 4 + 0 + 8,
+ ((MASK as u32 >> 1) & 0b1) * 4 + 1 + 8,
+ ((MASK as u32 >> 1) & 0b1) * 4 + 2 + 8,
+ ((MASK as u32 >> 1) & 0b1) * 4 + 3 + 8,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffle 128-bits (composed of 4 32-bit integers) selected by imm8 from a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shuffle_i32x4&expand=5172)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufi32x4, MASK = 0b11))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shuffle_i32x4<const MASK: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_i32x4::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i32x8(), src.as_i32x8()))
+}
+
+/// Shuffle 128-bits (composed of 4 32-bit integers) selected by imm8 from a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shuffle_i32x4&expand=5173)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufi32x4, MASK = 0b11))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shuffle_i32x4<const MASK: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_i32x4::<MASK>(a, b);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r.as_i32x8(), zero))
+}
+
+/// Shuffle 128-bits (composed of 2 64-bit integers) selected by imm8 from a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shuffle_i64x2&expand=5183)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b10_11_11_11))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shuffle_i64x2<const MASK: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(MASK);
+ let a = a.as_i64x8();
+ let b = b.as_i64x8();
+ let r: i64x8 = simd_shuffle8!(
+ a,
+ b,
+ <const MASK: i32> [
+ (MASK as u32 & 0b11) * 2 + 0,
+ (MASK as u32 & 0b11) * 2 + 1,
+ ((MASK as u32 >> 2) & 0b11) * 2 + 0,
+ ((MASK as u32 >> 2) & 0b11) * 2 + 1,
+ ((MASK as u32 >> 4) & 0b11) * 2 + 0 + 8,
+ ((MASK as u32 >> 4) & 0b11) * 2 + 1 + 8,
+ ((MASK as u32 >> 6) & 0b11) * 2 + 0 + 8,
+ ((MASK as u32 >> 6) & 0b11) * 2 + 1 + 8,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffle 128-bits (composed of 2 64-bit integers) selected by imm8 from a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shuffle_i64x&expand=5181)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b10_11_11_11))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shuffle_i64x2<const MASK: i32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_i64x2::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i64x8(), src.as_i64x8()))
+}
+
+/// Shuffle 128-bits (composed of 2 64-bit integers) selected by imm8 from a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shuffle_i64&expand=5182)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b10_11_11_11))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shuffle_i64x2<const MASK: i32>(
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_i64x2::<MASK>(a, b);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, r.as_i64x8(), zero))
+}
+
+/// Shuffle 128-bits (composed of 2 64-bit integers) selected by imm8 from a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shuffle_i64x2&expand=5180)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b01))] //should be vshufi64x2
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_shuffle_i64x2<const MASK: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(MASK);
+ let a = a.as_i64x4();
+ let b = b.as_i64x4();
+ let r: i64x4 = simd_shuffle4!(
+ a,
+ b,
+ <const MASK: i32> [
+ (MASK as u32 & 0b1) * 2 + 0,
+ (MASK as u32 & 0b1) * 2 + 1,
+ ((MASK as u32 >> 1) & 0b1) * 2 + 0 + 4,
+ ((MASK as u32 >> 1) & 0b1) * 2 + 1 + 4,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffle 128-bits (composed of 2 64-bit integers) selected by imm8 from a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shuffle_i64x2&expand=5178)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b11))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shuffle_i64x2<const MASK: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_i64x2::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i64x4(), src.as_i64x4()))
+}
+
+/// Shuffle 128-bits (composed of 2 64-bit integers) selected by imm8 from a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shuffle_i64x2&expand=5179)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b11))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shuffle_i64x2<const MASK: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_i64x2::<MASK>(a, b);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, r.as_i64x4(), zero))
+}
+
+/// Shuffle 128-bits (composed of 4 single-precision (32-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shuffle_f32x4&expand=5165)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b1011))] //should be vshuff32x4, but generate vshuff64x2
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shuffle_f32x4<const MASK: i32>(a: __m512, b: __m512) -> __m512 {
+ static_assert_imm8!(MASK);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r: f32x16 = simd_shuffle16!(
+ a,
+ b,
+ <const MASK: i32> [
+ (MASK as u32 & 0b11) * 4 + 0,
+ (MASK as u32 & 0b11) * 4 + 1,
+ (MASK as u32 & 0b11) * 4 + 2,
+ (MASK as u32 & 0b11) * 4 + 3,
+ ((MASK as u32 >> 2) & 0b11) * 4 + 0,
+ ((MASK as u32 >> 2) & 0b11) * 4 + 1,
+ ((MASK as u32 >> 2) & 0b11) * 4 + 2,
+ ((MASK as u32 >> 2) & 0b11) * 4 + 3,
+ ((MASK as u32 >> 4) & 0b11) * 4 + 0 + 16,
+ ((MASK as u32 >> 4) & 0b11) * 4 + 1 + 16,
+ ((MASK as u32 >> 4) & 0b11) * 4 + 2 + 16,
+ ((MASK as u32 >> 4) & 0b11) * 4 + 3 + 16,
+ ((MASK as u32 >> 6) & 0b11) * 4 + 0 + 16,
+ ((MASK as u32 >> 6) & 0b11) * 4 + 1 + 16,
+ ((MASK as u32 >> 6) & 0b11) * 4 + 2 + 16,
+ ((MASK as u32 >> 6) & 0b11) * 4 + 3 + 16,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffle 128-bits (composed of 4 single-precision (32-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shuffle_f32&expand=5163)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshuff32x4, MASK = 0b1011))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shuffle_f32x4<const MASK: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_f32x4::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f32x16(), src.as_f32x16()))
+}
+
+/// Shuffle 128-bits (composed of 4 single-precision (32-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shuffle_f32&expand=5164)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshuff32x4, MASK = 0b1011))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shuffle_f32x4<const MASK: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __m512 {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_f32x4::<MASK>(a, b);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r.as_f32x16(), zero))
+}
+
+/// Shuffle 128-bits (composed of 4 single-precision (32-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shuffle_f32x4&expand=5162)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b01))] //should be vshuff32x4
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_shuffle_f32x4<const MASK: i32>(a: __m256, b: __m256) -> __m256 {
+ static_assert_imm8!(MASK);
+ let a = a.as_f32x8();
+ let b = b.as_f32x8();
+ let r: f32x8 = simd_shuffle8!(
+ a,
+ b,
+ <const MASK: i32> [
+ (MASK as u32 & 0b1) * 4 + 0,
+ (MASK as u32 & 0b1) * 4 + 1,
+ (MASK as u32 & 0b1) * 4 + 2,
+ (MASK as u32 & 0b1) * 4 + 3,
+ ((MASK as u32 >> 1) & 0b1) * 4 + 0 + 8,
+ ((MASK as u32 >> 1) & 0b1) * 4 + 1 + 8,
+ ((MASK as u32 >> 1) & 0b1) * 4 + 2 + 8,
+ ((MASK as u32 >> 1) & 0b1) * 4 + 3 + 8,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffle 128-bits (composed of 4 single-precision (32-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shuffle_f32x4&expand=5160)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshuff32x4, MASK = 0b11))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shuffle_f32x4<const MASK: i32>(
+ src: __m256,
+ k: __mmask8,
+ a: __m256,
+ b: __m256,
+) -> __m256 {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_f32x4::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f32x8(), src.as_f32x8()))
+}
+
+/// Shuffle 128-bits (composed of 4 single-precision (32-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shuffle_f32x4&expand=5161)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshuff32x4, MASK = 0b11))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shuffle_f32x4<const MASK: i32>(
+ k: __mmask8,
+ a: __m256,
+ b: __m256,
+) -> __m256 {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_f32x4::<MASK>(a, b);
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, r.as_f32x8(), zero))
+}
+
+/// Shuffle 128-bits (composed of 2 double-precision (64-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shuffle_f64x2&expand=5171)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b10_11_11_11))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shuffle_f64x2<const MASK: i32>(a: __m512d, b: __m512d) -> __m512d {
+ static_assert_imm8!(MASK);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r: f64x8 = simd_shuffle8!(
+ a,
+ b,
+ <const MASK: i32> [
+ (MASK as u32 & 0b11) * 2 + 0,
+ (MASK as u32 & 0b11) * 2 + 1,
+ ((MASK as u32 >> 2) & 0b11) * 2 + 0,
+ ((MASK as u32 >> 2) & 0b11) * 2 + 1,
+ ((MASK as u32 >> 4) & 0b11) * 2 + 0 + 8,
+ ((MASK as u32 >> 4) & 0b11) * 2 + 1 + 8,
+ ((MASK as u32 >> 6) & 0b11) * 2 + 0 + 8,
+ ((MASK as u32 >> 6) & 0b11) * 2 + 1 + 8,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffle 128-bits (composed of 2 double-precision (64-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shuffle_f64x2&expand=5169)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b10_11_11_11))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shuffle_f64x2<const MASK: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_f64x2::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f64x8(), src.as_f64x8()))
+}
+
+/// Shuffle 128-bits (composed of 2 double-precision (64-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shuffle_f64x2&expand=5170)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b10_11_11_11))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shuffle_f64x2<const MASK: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ static_assert_imm8!(MASK);
+ let r = _mm512_shuffle_f64x2::<MASK>(a, b);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r.as_f64x8(), zero))
+}
+
+/// Shuffle 128-bits (composed of 2 double-precision (64-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shuffle_f64x2&expand=5168)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm, MASK = 0b01))] //should be vshuff64x2
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_shuffle_f64x2<const MASK: i32>(a: __m256d, b: __m256d) -> __m256d {
+ static_assert_imm8!(MASK);
+ let a = a.as_f64x4();
+ let b = b.as_f64x4();
+ let r: f64x4 = simd_shuffle4!(
+ a,
+ b,
+ <const MASK: i32> [
+ (MASK as u32 & 0b1) * 2 + 0,
+ (MASK as u32 & 0b1) * 2 + 1,
+ ((MASK as u32 >> 1) & 0b1) * 2 + 0 + 4,
+ ((MASK as u32 >> 1) & 0b1) * 2 + 1 + 4,
+ ],
+ );
+ transmute(r)
+}
+
+/// Shuffle 128-bits (composed of 2 double-precision (64-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shuffle_f64x2&expand=5166)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b11))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shuffle_f64x2<const MASK: i32>(
+ src: __m256d,
+ k: __mmask8,
+ a: __m256d,
+ b: __m256d,
+) -> __m256d {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_f64x2::<MASK>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f64x4(), src.as_f64x4()))
+}
+
+/// Shuffle 128-bits (composed of 2 double-precision (64-bit) floating-point elements) selected by imm8 from a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shuffle_f64x2&expand=5167)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b11))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shuffle_f64x2<const MASK: i32>(
+ k: __mmask8,
+ a: __m256d,
+ b: __m256d,
+) -> __m256d {
+ static_assert_imm8!(MASK);
+ let r = _mm256_shuffle_f64x2::<MASK>(a, b);
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, r.as_f64x4(), zero))
+}
+
+/// Extract 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from a, selected with imm8, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_extractf32x4_ps&expand=2442)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf32x4, IMM8 = 3)
+)]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_extractf32x4_ps<const IMM8: i32>(a: __m512) -> __m128 {
+ static_assert_imm2!(IMM8);
+ match IMM8 & 0x3 {
+ 0 => simd_shuffle4!(a, _mm512_undefined_ps(), [0, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, _mm512_undefined_ps(), [4, 5, 6, 7]),
+ 2 => simd_shuffle4!(a, _mm512_undefined_ps(), [8, 9, 10, 11]),
+ _ => simd_shuffle4!(a, _mm512_undefined_ps(), [12, 13, 14, 15]),
+ }
+}
+
+/// Extract 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from a, selected with imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_extractf32x4_ps&expand=2443)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf32x4, IMM8 = 3)
+)]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_extractf32x4_ps<const IMM8: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m512,
+) -> __m128 {
+ static_assert_imm2!(IMM8);
+ let r = _mm512_extractf32x4_ps::<IMM8>(a);
+ transmute(simd_select_bitmask(k, r.as_f32x4(), src.as_f32x4()))
+}
+
+/// Extract 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from a, selected with imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_extractf32x4_ps&expand=2444)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf32x4, IMM8 = 3)
+)]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_extractf32x4_ps<const IMM8: i32>(k: __mmask8, a: __m512) -> __m128 {
+ static_assert_imm2!(IMM8);
+ let r = _mm512_extractf32x4_ps::<IMM8>(a);
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, r.as_f32x4(), zero))
+}
+
+/// Extract 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from a, selected with imm8, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extractf32x4_ps&expand=2439)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextract, IMM8 = 1) //should be vextractf32x4
+)]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_extractf32x4_ps<const IMM8: i32>(a: __m256) -> __m128 {
+ static_assert_imm1!(IMM8);
+ match IMM8 & 0x1 {
+ 0 => simd_shuffle4!(a, _mm256_undefined_ps(), [0, 1, 2, 3]),
+ _ => simd_shuffle4!(a, _mm256_undefined_ps(), [4, 5, 6, 7]),
+ }
+}
+
+/// Extract 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from a, selected with imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_extractf32x4_ps&expand=2440)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf32x4, IMM8 = 1)
+)]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_extractf32x4_ps<const IMM8: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m256,
+) -> __m128 {
+ static_assert_imm1!(IMM8);
+ let r = _mm256_extractf32x4_ps::<IMM8>(a);
+ transmute(simd_select_bitmask(k, r.as_f32x4(), src.as_f32x4()))
+}
+
+/// Extract 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from a, selected with imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_extractf32x4_ps&expand=2441)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf32x4, IMM8 = 1)
+)]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_extractf32x4_ps<const IMM8: i32>(k: __mmask8, a: __m256) -> __m128 {
+ static_assert_imm1!(IMM8);
+ let r = _mm256_extractf32x4_ps::<IMM8>(a);
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, r.as_f32x4(), zero))
+}
+
+/// Extract 256 bits (composed of 4 packed 64-bit integers) from a, selected with IMM1, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_extracti64x4_epi64&expand=2473)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf64x4, IMM1 = 1) //should be vextracti64x4
+)]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_extracti64x4_epi64<const IMM1: i32>(a: __m512i) -> __m256i {
+ static_assert_imm1!(IMM1);
+ match IMM1 {
+ 0 => simd_shuffle4!(a, _mm512_set1_epi64(0), [0, 1, 2, 3]),
+ _ => simd_shuffle4!(a, _mm512_set1_epi64(0), [4, 5, 6, 7]),
+ }
+}
+
+/// Extract 256 bits (composed of 4 packed 64-bit integers) from a, selected with IMM1, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_extracti64x4_epi64&expand=2474)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextracti64x4, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_extracti64x4_epi64<const IMM1: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m512i,
+) -> __m256i {
+ static_assert_imm1!(IMM1);
+ let r = _mm512_extracti64x4_epi64::<IMM1>(a);
+ transmute(simd_select_bitmask(k, r.as_i64x4(), src.as_i64x4()))
+}
+
+/// Extract 256 bits (composed of 4 packed 64-bit integers) from a, selected with IMM1, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_extracti64x4_epi64&expand=2475)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextracti64x4, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_extracti64x4_epi64<const IMM1: i32>(k: __mmask8, a: __m512i) -> __m256i {
+ static_assert_imm1!(IMM1);
+ let r = _mm512_extracti64x4_epi64::<IMM1>(a);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, r.as_i64x4(), zero))
+}
+
+/// Extract 256 bits (composed of 4 packed double-precision (64-bit) floating-point elements) from a, selected with imm8, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_extractf64x4_pd&expand=2454)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf64x4, IMM8 = 1)
+)]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_extractf64x4_pd<const IMM8: i32>(a: __m512d) -> __m256d {
+ static_assert_imm1!(IMM8);
+ match IMM8 & 0x1 {
+ 0 => simd_shuffle4!(a, _mm512_undefined_pd(), [0, 1, 2, 3]),
+ _ => simd_shuffle4!(a, _mm512_undefined_pd(), [4, 5, 6, 7]),
+ }
+}
+
+/// Extract 256 bits (composed of 4 packed double-precision (64-bit) floating-point elements) from a, selected with imm8, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_extractf64x4_pd&expand=2455)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf64x4, IMM8 = 1)
+)]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_extractf64x4_pd<const IMM8: i32>(
+ src: __m256d,
+ k: __mmask8,
+ a: __m512d,
+) -> __m256d {
+ static_assert_imm1!(IMM8);
+ let r = _mm512_extractf64x4_pd::<IMM8>(a);
+ transmute(simd_select_bitmask(k, r.as_f64x4(), src.as_f64x4()))
+}
+
+/// Extract 256 bits (composed of 4 packed double-precision (64-bit) floating-point elements) from a, selected with imm8, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_extractf64x4_pd&expand=2456)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf64x4, IMM8 = 1)
+)]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_extractf64x4_pd<const IMM8: i32>(k: __mmask8, a: __m512d) -> __m256d {
+ static_assert_imm1!(IMM8);
+ let r = _mm512_extractf64x4_pd::<IMM8>(a);
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, r.as_f64x4(), zero))
+}
+
+/// Extract 128 bits (composed of 4 packed 32-bit integers) from a, selected with IMM2, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_extracti32x4_epi32&expand=2461)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextractf32x4, IMM2 = 3) //should be vextracti32x4
+)]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm512_extracti32x4_epi32<const IMM2: i32>(a: __m512i) -> __m128i {
+ static_assert_imm2!(IMM2);
+ let a = a.as_i32x16();
+ let undefined = _mm512_undefined_epi32().as_i32x16();
+ let extract: i32x4 = match IMM2 {
+ 0 => simd_shuffle4!(a, undefined, [0, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, undefined, [4, 5, 6, 7]),
+ 2 => simd_shuffle4!(a, undefined, [8, 9, 10, 11]),
+ _ => simd_shuffle4!(a, undefined, [12, 13, 14, 15]),
+ };
+ transmute(extract)
+}
+
+/// Extract 128 bits (composed of 4 packed 32-bit integers) from a, selected with IMM2, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_extracti32x4_epi32&expand=2462)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextracti32x4, IMM2 = 3)
+)]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_mask_extracti32x4_epi32<const IMM2: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m512i,
+) -> __m128i {
+ static_assert_imm2!(IMM2);
+ let r = _mm512_extracti32x4_epi32::<IMM2>(a);
+ transmute(simd_select_bitmask(k, r.as_i32x4(), src.as_i32x4()))
+}
+
+/// Extract 128 bits (composed of 4 packed 32-bit integers) from a, selected with IMM2, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_extracti32x4_epi32&expand=2463)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextracti32x4, IMM2 = 3)
+)]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_maskz_extracti32x4_epi32<const IMM2: i32>(k: __mmask8, a: __m512i) -> __m128i {
+ static_assert_imm2!(IMM2);
+ let r = _mm512_extracti32x4_epi32::<IMM2>(a);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r.as_i32x4(), zero))
+}
+
+/// Extract 128 bits (composed of 4 packed 32-bit integers) from a, selected with IMM1, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extracti32x4_epi32&expand=2458)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextract, IMM1 = 1) //should be vextracti32x4
+)]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_extracti32x4_epi32<const IMM1: i32>(a: __m256i) -> __m128i {
+ static_assert_imm1!(IMM1);
+ let a = a.as_i32x8();
+ let undefined = _mm256_undefined_si256().as_i32x8();
+ let extract: i32x4 = match IMM1 {
+ 0 => simd_shuffle4!(a, undefined, [0, 1, 2, 3]),
+ _ => simd_shuffle4!(a, undefined, [4, 5, 6, 7]),
+ };
+ transmute(extract)
+}
+
+/// Extract 128 bits (composed of 4 packed 32-bit integers) from a, selected with IMM1, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_extracti32x4_epi32&expand=2459)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextracti32x4, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_mask_extracti32x4_epi32<const IMM1: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m256i,
+) -> __m128i {
+ static_assert_imm1!(IMM1);
+ let r = _mm256_extracti32x4_epi32::<IMM1>(a);
+ transmute(simd_select_bitmask(k, r.as_i32x4(), src.as_i32x4()))
+}
+
+/// Extract 128 bits (composed of 4 packed 32-bit integers) from a, selected with IMM1, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_extracti32x4_epi32&expand=2460)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vextracti32x4, IMM1 = 1)
+)]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_maskz_extracti32x4_epi32<const IMM1: i32>(k: __mmask8, a: __m256i) -> __m128i {
+ static_assert_imm1!(IMM1);
+ let r = _mm256_extracti32x4_epi32::<IMM1>(a);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r.as_i32x4(), zero))
+}
+
+/// Duplicate even-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_moveldup_ps&expand=3862)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovsldup))]
+pub unsafe fn _mm512_moveldup_ps(a: __m512) -> __m512 {
+ let r: f32x16 = simd_shuffle16!(a, a, [0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14]);
+ transmute(r)
+}
+
+/// Duplicate even-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_moveldup_ps&expand=3860)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovsldup))]
+pub unsafe fn _mm512_mask_moveldup_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 {
+ let mov: f32x16 = simd_shuffle16!(a, a, [0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14]);
+ transmute(simd_select_bitmask(k, mov, src.as_f32x16()))
+}
+
+/// Duplicate even-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_moveldup_ps&expand=3861)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovsldup))]
+pub unsafe fn _mm512_maskz_moveldup_ps(k: __mmask16, a: __m512) -> __m512 {
+ let mov: f32x16 = simd_shuffle16!(a, a, [0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14]);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Duplicate even-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_moveldup_ps&expand=3857)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovsldup))]
+pub unsafe fn _mm256_mask_moveldup_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 {
+ let mov = _mm256_moveldup_ps(a);
+ transmute(simd_select_bitmask(k, mov.as_f32x8(), src.as_f32x8()))
+}
+
+/// Duplicate even-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_moveldup_ps&expand=3858)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovsldup))]
+pub unsafe fn _mm256_maskz_moveldup_ps(k: __mmask8, a: __m256) -> __m256 {
+ let mov = _mm256_moveldup_ps(a);
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, mov.as_f32x8(), zero))
+}
+
+/// Duplicate even-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_moveldup_ps&expand=3854)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovsldup))]
+pub unsafe fn _mm_mask_moveldup_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ let mov = _mm_moveldup_ps(a);
+ transmute(simd_select_bitmask(k, mov.as_f32x4(), src.as_f32x4()))
+}
+
+/// Duplicate even-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_moveldup_ps&expand=3855)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovsldup))]
+pub unsafe fn _mm_maskz_moveldup_ps(k: __mmask8, a: __m128) -> __m128 {
+ let mov = _mm_moveldup_ps(a);
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, mov.as_f32x4(), zero))
+}
+
+/// Duplicate odd-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_movehdup_ps&expand=3852)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovshdup))]
+pub unsafe fn _mm512_movehdup_ps(a: __m512) -> __m512 {
+ let r: f32x16 = simd_shuffle16!(a, a, [1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15]);
+ transmute(r)
+}
+
+/// Duplicate odd-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_movehdup&expand=3850)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovshdup))]
+pub unsafe fn _mm512_mask_movehdup_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 {
+ let mov: f32x16 = simd_shuffle16!(a, a, [1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15]);
+ transmute(simd_select_bitmask(k, mov, src.as_f32x16()))
+}
+
+/// Duplicate odd-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_moveh&expand=3851)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovshdup))]
+pub unsafe fn _mm512_maskz_movehdup_ps(k: __mmask16, a: __m512) -> __m512 {
+ let mov: f32x16 = simd_shuffle16!(a, a, [1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15]);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Duplicate odd-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_movehdup_ps&expand=3847)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovshdup))]
+pub unsafe fn _mm256_mask_movehdup_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 {
+ let mov = _mm256_movehdup_ps(a);
+ transmute(simd_select_bitmask(k, mov.as_f32x8(), src.as_f32x8()))
+}
+
+/// Duplicate odd-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_movehdup_ps&expand=3848)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovshdup))]
+pub unsafe fn _mm256_maskz_movehdup_ps(k: __mmask8, a: __m256) -> __m256 {
+ let mov = _mm256_movehdup_ps(a);
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, mov.as_f32x8(), zero))
+}
+
+/// Duplicate odd-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_movehdup_ps&expand=3844)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovshdup))]
+pub unsafe fn _mm_mask_movehdup_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ let mov = _mm_movehdup_ps(a);
+ transmute(simd_select_bitmask(k, mov.as_f32x4(), src.as_f32x4()))
+}
+
+/// Duplicate odd-indexed single-precision (32-bit) floating-point elements from a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_movehdup_ps&expand=3845)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovshdup))]
+pub unsafe fn _mm_maskz_movehdup_ps(k: __mmask8, a: __m128) -> __m128 {
+ let mov = _mm_movehdup_ps(a);
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, mov.as_f32x4(), zero))
+}
+
+/// Duplicate even-indexed double-precision (64-bit) floating-point elements from a, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_movedup_pd&expand=3843)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovddup))]
+pub unsafe fn _mm512_movedup_pd(a: __m512d) -> __m512d {
+ let r: f64x8 = simd_shuffle8!(a, a, [0, 0, 2, 2, 4, 4, 6, 6]);
+ transmute(r)
+}
+
+/// Duplicate even-indexed double-precision (64-bit) floating-point elements from a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_movedup_pd&expand=3841)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovddup))]
+pub unsafe fn _mm512_mask_movedup_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d {
+ let mov: f64x8 = simd_shuffle8!(a, a, [0, 0, 2, 2, 4, 4, 6, 6]);
+ transmute(simd_select_bitmask(k, mov, src.as_f64x8()))
+}
+
+/// Duplicate even-indexed double-precision (64-bit) floating-point elements from a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_movedup_pd&expand=3842)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovddup))]
+pub unsafe fn _mm512_maskz_movedup_pd(k: __mmask8, a: __m512d) -> __m512d {
+ let mov: f64x8 = simd_shuffle8!(a, a, [0, 0, 2, 2, 4, 4, 6, 6]);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, mov, zero))
+}
+
+/// Duplicate even-indexed double-precision (64-bit) floating-point elements from a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_movedup_pd&expand=3838)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovddup))]
+pub unsafe fn _mm256_mask_movedup_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d {
+ let mov = _mm256_movedup_pd(a);
+ transmute(simd_select_bitmask(k, mov.as_f64x4(), src.as_f64x4()))
+}
+
+/// Duplicate even-indexed double-precision (64-bit) floating-point elements from a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_movedup_pd&expand=3839)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovddup))]
+pub unsafe fn _mm256_maskz_movedup_pd(k: __mmask8, a: __m256d) -> __m256d {
+ let mov = _mm256_movedup_pd(a);
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, mov.as_f64x4(), zero))
+}
+
+/// Duplicate even-indexed double-precision (64-bit) floating-point elements from a, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_movedup_pd&expand=3835)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovddup))]
+pub unsafe fn _mm_mask_movedup_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d {
+ let mov = _mm_movedup_pd(a);
+ transmute(simd_select_bitmask(k, mov.as_f64x2(), src.as_f64x2()))
+}
+
+/// Duplicate even-indexed double-precision (64-bit) floating-point elements from a, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_movedup_pd&expand=3836)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovddup))]
+pub unsafe fn _mm_maskz_movedup_pd(k: __mmask8, a: __m128d) -> __m128d {
+ let mov = _mm_movedup_pd(a);
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, mov.as_f64x2(), zero))
+}
+
+/// Copy a to dst, then insert 128 bits (composed of 4 packed 32-bit integers) from b into dst at the location specified by imm8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_inserti32x4&expand=3174)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinsertf32x4, IMM8 = 2))] //should be vinserti32x4
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_inserti32x4<const IMM8: i32>(a: __m512i, b: __m128i) -> __m512i {
+ static_assert_imm2!(IMM8);
+ let a = a.as_i32x16();
+ let b = _mm512_castsi128_si512(b).as_i32x16();
+ let ret: i32x16 = match IMM8 & 0b11 {
+ 0 => simd_shuffle16!(
+ a,
+ b,
+ [16, 17, 18, 19, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ ),
+ 1 => simd_shuffle16!(
+ a,
+ b,
+ [0, 1, 2, 3, 16, 17, 18, 19, 8, 9, 10, 11, 12, 13, 14, 15],
+ ),
+ 2 => simd_shuffle16!(
+ a,
+ b,
+ [0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 12, 13, 14, 15],
+ ),
+ _ => simd_shuffle16!(a, b, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19]),
+ };
+ transmute(ret)
+}
+
+/// Copy a to tmp, then insert 128 bits (composed of 4 packed 32-bit integers) from b into tmp at the location specified by imm8. Store tmp to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_inserti32x4&expand=3175)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinserti32x4, IMM8 = 2))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_inserti32x4<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m128i,
+) -> __m512i {
+ static_assert_imm2!(IMM8);
+ let r = _mm512_inserti32x4::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i32x16(), src.as_i32x16()))
+}
+
+/// Copy a to tmp, then insert 128 bits (composed of 4 packed 32-bit integers) from b into tmp at the location specified by imm8. Store tmp to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_inserti32x4&expand=3176)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinserti32x4, IMM8 = 2))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_inserti32x4<const IMM8: i32>(
+ k: __mmask16,
+ a: __m512i,
+ b: __m128i,
+) -> __m512i {
+ static_assert_imm2!(IMM8);
+ let r = _mm512_inserti32x4::<IMM8>(a, b);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, r.as_i32x16(), zero))
+}
+
+/// Copy a to dst, then insert 128 bits (composed of 4 packed 32-bit integers) from b into dst at the location specified by imm8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_inserti32x4&expand=3171)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vinsert, IMM8 = 1) //should be vinserti32x4
+)]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_inserti32x4<const IMM8: i32>(a: __m256i, b: __m128i) -> __m256i {
+ static_assert_imm1!(IMM8);
+ let a = a.as_i32x8();
+ let b = _mm256_castsi128_si256(b).as_i32x8();
+ let ret: i32x8 = match IMM8 & 0b1 {
+ 0 => simd_shuffle8!(a, b, [8, 9, 10, 11, 4, 5, 6, 7]),
+ _ => simd_shuffle8!(a, b, [0, 1, 2, 3, 8, 9, 10, 11]),
+ };
+ transmute(ret)
+}
+
+/// Copy a to tmp, then insert 128 bits (composed of 4 packed 32-bit integers) from b into tmp at the location specified by imm8. Store tmp to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_inserti32x4&expand=3172)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vinserti32x4, IMM8 = 1)
+)]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_inserti32x4<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m128i,
+) -> __m256i {
+ static_assert_imm1!(IMM8);
+ let r = _mm256_inserti32x4::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i32x8(), src.as_i32x8()))
+}
+
+/// Copy a to tmp, then insert 128 bits (composed of 4 packed 32-bit integers) from b into tmp at the location specified by imm8. Store tmp to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_inserti32x4&expand=3173)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vinserti32x4, IMM8 = 1)
+)]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_inserti32x4<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m128i,
+) -> __m256i {
+ static_assert_imm1!(IMM8);
+ let r = _mm256_inserti32x4::<IMM8>(a, b);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r.as_i32x8(), zero))
+}
+
+/// Copy a to dst, then insert 256 bits (composed of 4 packed 64-bit integers) from b into dst at the location specified by imm8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_inserti64x4&expand=3186)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinsertf64x4, IMM8 = 1))] //should be vinserti64x4
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_inserti64x4<const IMM8: i32>(a: __m512i, b: __m256i) -> __m512i {
+ static_assert_imm1!(IMM8);
+ let b = _mm512_castsi256_si512(b);
+ match IMM8 & 0b1 {
+ 0 => simd_shuffle8!(a, b, [8, 9, 10, 11, 4, 5, 6, 7]),
+ _ => simd_shuffle8!(a, b, [0, 1, 2, 3, 8, 9, 10, 11]),
+ }
+}
+
+/// Copy a to tmp, then insert 256 bits (composed of 4 packed 64-bit integers) from b into tmp at the location specified by imm8. Store tmp to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_inserti64x4&expand=3187)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinserti64x4, IMM8 = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_inserti64x4<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ b: __m256i,
+) -> __m512i {
+ static_assert_imm1!(IMM8);
+ let r = _mm512_inserti64x4::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i64x8(), src.as_i64x8()))
+}
+
+/// Copy a to tmp, then insert 256 bits (composed of 4 packed 64-bit integers) from b into tmp at the location specified by imm8. Store tmp to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_inserti64x4&expand=3188)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinserti64x4, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_inserti64x4<const IMM8: i32>(
+ k: __mmask8,
+ a: __m512i,
+ b: __m256i,
+) -> __m512i {
+ static_assert_imm1!(IMM8);
+ let r = _mm512_inserti64x4::<IMM8>(a, b);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, r.as_i64x8(), zero))
+}
+
+/// Copy a to dst, then insert 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from b into dst at the location specified by imm8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_insertf32x4&expand=3155)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinsertf32x4, IMM8 = 2))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_insertf32x4<const IMM8: i32>(a: __m512, b: __m128) -> __m512 {
+ static_assert_imm2!(IMM8);
+ let b = _mm512_castps128_ps512(b);
+ match IMM8 & 0b11 {
+ 0 => simd_shuffle16!(
+ a,
+ b,
+ [16, 17, 18, 19, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ ),
+ 1 => simd_shuffle16!(
+ a,
+ b,
+ [0, 1, 2, 3, 16, 17, 18, 19, 8, 9, 10, 11, 12, 13, 14, 15],
+ ),
+ 2 => simd_shuffle16!(
+ a,
+ b,
+ [0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 12, 13, 14, 15],
+ ),
+ _ => simd_shuffle16!(a, b, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19]),
+ }
+}
+
+/// Copy a to tmp, then insert 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from b into tmp at the location specified by imm8. Store tmp to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_insertf32x4&expand=3156)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinsertf32x4, IMM8 = 2))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_insertf32x4<const IMM8: i32>(
+ src: __m512,
+ k: __mmask16,
+ a: __m512,
+ b: __m128,
+) -> __m512 {
+ static_assert_imm2!(IMM8);
+ let r = _mm512_insertf32x4::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f32x16(), src.as_f32x16()))
+}
+
+/// Copy a to tmp, then insert 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from b into tmp at the location specified by imm8. Store tmp to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_insertf32x4&expand=3157)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinsertf32x4, IMM8 = 2))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_insertf32x4<const IMM8: i32>(
+ k: __mmask16,
+ a: __m512,
+ b: __m128,
+) -> __m512 {
+ static_assert_imm2!(IMM8);
+ let r = _mm512_insertf32x4::<IMM8>(a, b);
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, r.as_f32x16(), zero))
+}
+
+/// Copy a to dst, then insert 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from b into dst at the location specified by imm8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insertf32x4&expand=3152)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vinsert, IMM8 = 1) //should be vinsertf32x4
+)]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_insertf32x4<const IMM8: i32>(a: __m256, b: __m128) -> __m256 {
+ static_assert_imm1!(IMM8);
+ let b = _mm256_castps128_ps256(b);
+ match IMM8 & 0b1 {
+ 0 => simd_shuffle8!(a, b, [8, 9, 10, 11, 4, 5, 6, 7]),
+ _ => simd_shuffle8!(a, b, [0, 1, 2, 3, 8, 9, 10, 11]),
+ }
+}
+
+/// Copy a to tmp, then insert 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from b into tmp at the location specified by imm8. Store tmp to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_insertf32x4&expand=3153)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vinsertf32x4, IMM8 = 1)
+)]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_insertf32x4<const IMM8: i32>(
+ src: __m256,
+ k: __mmask8,
+ a: __m256,
+ b: __m128,
+) -> __m256 {
+ static_assert_imm1!(IMM8);
+ let r = _mm256_insertf32x4::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f32x8(), src.as_f32x8()))
+}
+
+/// Copy a to tmp, then insert 128 bits (composed of 4 packed single-precision (32-bit) floating-point elements) from b into tmp at the location specified by imm8. Store tmp to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_insertf32x4&expand=3154)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(vinsertf32x4, IMM8 = 1)
+)]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_insertf32x4<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256,
+ b: __m128,
+) -> __m256 {
+ static_assert_imm1!(IMM8);
+ let r = _mm256_insertf32x4::<IMM8>(a, b);
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, r.as_f32x8(), zero))
+}
+
+/// Copy a to dst, then insert 256 bits (composed of 4 packed double-precision (64-bit) floating-point elements) from b into dst at the location specified by imm8.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_insertf64x4&expand=3167)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinsertf64x4, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_insertf64x4<const IMM8: i32>(a: __m512d, b: __m256d) -> __m512d {
+ static_assert_imm1!(IMM8);
+ let b = _mm512_castpd256_pd512(b);
+ match IMM8 & 0b1 {
+ 0 => simd_shuffle8!(a, b, [8, 9, 10, 11, 4, 5, 6, 7]),
+ _ => simd_shuffle8!(a, b, [0, 1, 2, 3, 8, 9, 10, 11]),
+ }
+}
+
+/// Copy a to tmp, then insert 256 bits (composed of 4 packed double-precision (64-bit) floating-point elements) from b into tmp at the location specified by imm8. Store tmp to dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_insertf64x4&expand=3168)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinsertf64x4, IMM8 = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_insertf64x4<const IMM8: i32>(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m256d,
+) -> __m512d {
+ static_assert_imm1!(IMM8);
+ let r = _mm512_insertf64x4::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_f64x8(), src.as_f64x8()))
+}
+
+/// Copy a to tmp, then insert 256 bits (composed of 4 packed double-precision (64-bit) floating-point elements) from b into tmp at the location specified by imm8. Store tmp to dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_insertf64x4&expand=3169)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vinsertf64x4, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_insertf64x4<const IMM8: i32>(
+ k: __mmask8,
+ a: __m512d,
+ b: __m256d,
+) -> __m512d {
+ static_assert_imm1!(IMM8);
+ let r = _mm512_insertf64x4::<IMM8>(a, b);
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, r.as_f64x8(), zero))
+}
+
+/// Unpack and interleave 32-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpackhi_epi32&expand=6021)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpckhps))] //should be vpunpckhdq
+pub unsafe fn _mm512_unpackhi_epi32(a: __m512i, b: __m512i) -> __m512i {
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ #[rustfmt::skip]
+ let r: i32x16 = simd_shuffle16!(
+ a, b,
+ [ 2, 18, 3, 19,
+ 2 + 4, 18 + 4, 3 + 4, 19 + 4,
+ 2 + 8, 18 + 8, 3 + 8, 19 + 8,
+ 2 + 12, 18 + 12, 3 + 12, 19 + 12],
+ );
+ transmute(r)
+}
+
+/// Unpack and interleave 32-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpackhi_epi32&expand=6019)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpunpckhdq))]
+pub unsafe fn _mm512_mask_unpackhi_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let unpackhi = _mm512_unpackhi_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_i32x16()))
+}
+
+/// Unpack and interleave 32-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpackhi_epi32&expand=6020)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpunpckhdq))]
+pub unsafe fn _mm512_maskz_unpackhi_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let unpackhi = _mm512_unpackhi_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave 32-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpackhi_epi32&expand=6016)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckhdq))]
+pub unsafe fn _mm256_mask_unpackhi_epi32(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let unpackhi = _mm256_unpackhi_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_i32x8()))
+}
+
+/// Unpack and interleave 32-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpackhi_epi32&expand=6017)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckhdq))]
+pub unsafe fn _mm256_maskz_unpackhi_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let unpackhi = _mm256_unpackhi_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave 32-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpackhi_epi32&expand=6013)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckhdq))]
+pub unsafe fn _mm_mask_unpackhi_epi32(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let unpackhi = _mm_unpackhi_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_i32x4()))
+}
+
+/// Unpack and interleave 32-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpackhi_epi32&expand=6014)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckhdq))]
+pub unsafe fn _mm_maskz_unpackhi_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let unpackhi = _mm_unpackhi_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave 64-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpackhi_epi64&expand=6030)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpckhpd))] //should be vpunpckhqdq
+pub unsafe fn _mm512_unpackhi_epi64(a: __m512i, b: __m512i) -> __m512i {
+ simd_shuffle8!(a, b, [1, 9, 1 + 2, 9 + 2, 1 + 4, 9 + 4, 1 + 6, 9 + 6])
+}
+
+/// Unpack and interleave 64-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpackhi_epi64&expand=6028)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpunpckhqdq))]
+pub unsafe fn _mm512_mask_unpackhi_epi64(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let unpackhi = _mm512_unpackhi_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_i64x8()))
+}
+
+/// Unpack and interleave 64-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpackhi_epi64&expand=6029)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpunpckhqdq))]
+pub unsafe fn _mm512_maskz_unpackhi_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let unpackhi = _mm512_unpackhi_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave 64-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpackhi_epi64&expand=6025)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckhqdq))]
+pub unsafe fn _mm256_mask_unpackhi_epi64(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let unpackhi = _mm256_unpackhi_epi64(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_i64x4()))
+}
+
+/// Unpack and interleave 64-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpackhi_epi64&expand=6026)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckhqdq))]
+pub unsafe fn _mm256_maskz_unpackhi_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let unpackhi = _mm256_unpackhi_epi64(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave 64-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpackhi_epi64&expand=6022)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckhqdq))]
+pub unsafe fn _mm_mask_unpackhi_epi64(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let unpackhi = _mm_unpackhi_epi64(a, b).as_i64x2();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_i64x2()))
+}
+
+/// Unpack and interleave 64-bit integers from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpackhi_epi64&expand=6023)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckhqdq))]
+pub unsafe fn _mm_maskz_unpackhi_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let unpackhi = _mm_unpackhi_epi64(a, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpackhi_ps&expand=6060)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpckhps))]
+pub unsafe fn _mm512_unpackhi_ps(a: __m512, b: __m512) -> __m512 {
+ #[rustfmt::skip]
+ simd_shuffle16!(
+ a, b,
+ [ 2, 18, 3, 19,
+ 2 + 4, 18 + 4, 3 + 4, 19 + 4,
+ 2 + 8, 18 + 8, 3 + 8, 19 + 8,
+ 2 + 12, 18 + 12, 3 + 12, 19 + 12],
+ )
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpackhi_ps&expand=6058)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpckhps))]
+pub unsafe fn _mm512_mask_unpackhi_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let unpackhi = _mm512_unpackhi_ps(a, b).as_f32x16();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_f32x16()))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpackhi_ps&expand=6059)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpckhps))]
+pub unsafe fn _mm512_maskz_unpackhi_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let unpackhi = _mm512_unpackhi_ps(a, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpackhi_ps&expand=6055)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpckhps))]
+pub unsafe fn _mm256_mask_unpackhi_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let unpackhi = _mm256_unpackhi_ps(a, b).as_f32x8();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_f32x8()))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpackhi_ps&expand=6056)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpckhps))]
+pub unsafe fn _mm256_maskz_unpackhi_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let unpackhi = _mm256_unpackhi_ps(a, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpackhi_ps&expand=6052)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpckhps))]
+pub unsafe fn _mm_mask_unpackhi_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let unpackhi = _mm_unpackhi_ps(a, b).as_f32x4();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_f32x4()))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpackhi_ps&expand=6053)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpckhps))]
+pub unsafe fn _mm_maskz_unpackhi_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let unpackhi = _mm_unpackhi_ps(a, b).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpackhi_pd&expand=6048)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpckhpd))]
+pub unsafe fn _mm512_unpackhi_pd(a: __m512d, b: __m512d) -> __m512d {
+ simd_shuffle8!(a, b, [1, 9, 1 + 2, 9 + 2, 1 + 4, 9 + 4, 1 + 6, 9 + 6])
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpackhi_pd&expand=6046)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpckhpd))]
+pub unsafe fn _mm512_mask_unpackhi_pd(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ let unpackhi = _mm512_unpackhi_pd(a, b).as_f64x8();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_f64x8()))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpackhi_pd&expand=6047)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpckhpd))]
+pub unsafe fn _mm512_maskz_unpackhi_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let unpackhi = _mm512_unpackhi_pd(a, b).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpackhi_pd&expand=6043)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpckhpd))]
+pub unsafe fn _mm256_mask_unpackhi_pd(
+ src: __m256d,
+ k: __mmask8,
+ a: __m256d,
+ b: __m256d,
+) -> __m256d {
+ let unpackhi = _mm256_unpackhi_pd(a, b).as_f64x4();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_f64x4()))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpackhi_pd&expand=6044)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpckhpd))]
+pub unsafe fn _mm256_maskz_unpackhi_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let unpackhi = _mm256_unpackhi_pd(a, b).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpackhi_pd&expand=6040)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpckhpd))]
+pub unsafe fn _mm_mask_unpackhi_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let unpackhi = _mm_unpackhi_pd(a, b).as_f64x2();
+ transmute(simd_select_bitmask(k, unpackhi, src.as_f64x2()))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the high half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpackhi_pd&expand=6041)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpckhpd))]
+pub unsafe fn _mm_maskz_unpackhi_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let unpackhi = _mm_unpackhi_pd(a, b).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, unpackhi, zero))
+}
+
+/// Unpack and interleave 32-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpacklo_epi32&expand=6078)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpcklps))] //should be vpunpckldq
+pub unsafe fn _mm512_unpacklo_epi32(a: __m512i, b: __m512i) -> __m512i {
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ #[rustfmt::skip]
+ let r: i32x16 = simd_shuffle16!(
+ a, b,
+ [ 0, 16, 1, 17,
+ 0 + 4, 16 + 4, 1 + 4, 17 + 4,
+ 0 + 8, 16 + 8, 1 + 8, 17 + 8,
+ 0 + 12, 16 + 12, 1 + 12, 17 + 12],
+ );
+ transmute(r)
+}
+
+/// Unpack and interleave 32-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpacklo_epi32&expand=6076)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpunpckldq))]
+pub unsafe fn _mm512_mask_unpacklo_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let unpacklo = _mm512_unpacklo_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_i32x16()))
+}
+
+/// Unpack and interleave 32-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpacklo_epi32&expand=6077)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpunpckldq))]
+pub unsafe fn _mm512_maskz_unpacklo_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let unpacklo = _mm512_unpacklo_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave 32-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpacklo_epi32&expand=6073)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckldq))]
+pub unsafe fn _mm256_mask_unpacklo_epi32(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let unpacklo = _mm256_unpacklo_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_i32x8()))
+}
+
+/// Unpack and interleave 32-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpacklo_epi32&expand=6074)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckldq))]
+pub unsafe fn _mm256_maskz_unpacklo_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let unpacklo = _mm256_unpacklo_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave 32-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpacklo_epi32&expand=6070)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckldq))]
+pub unsafe fn _mm_mask_unpacklo_epi32(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let unpacklo = _mm_unpacklo_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_i32x4()))
+}
+
+/// Unpack and interleave 32-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpacklo_epi32&expand=6071)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpckldq))]
+pub unsafe fn _mm_maskz_unpacklo_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let unpacklo = _mm_unpacklo_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave 64-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpacklo_epi64&expand=6087)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpcklpd))] //should be vpunpcklqdq
+pub unsafe fn _mm512_unpacklo_epi64(a: __m512i, b: __m512i) -> __m512i {
+ simd_shuffle8!(a, b, [0, 8, 0 + 2, 8 + 2, 0 + 4, 8 + 4, 0 + 6, 8 + 6])
+}
+
+/// Unpack and interleave 64-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpacklo_epi64&expand=6085)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpunpcklqdq))]
+pub unsafe fn _mm512_mask_unpacklo_epi64(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let unpacklo = _mm512_unpacklo_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_i64x8()))
+}
+
+/// Unpack and interleave 64-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpacklo_epi64&expand=6086)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpunpcklqdq))]
+pub unsafe fn _mm512_maskz_unpacklo_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let unpacklo = _mm512_unpacklo_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave 64-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpacklo_epi64&expand=6082)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpcklqdq))]
+pub unsafe fn _mm256_mask_unpacklo_epi64(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let unpacklo = _mm256_unpacklo_epi64(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_i64x4()))
+}
+
+/// Unpack and interleave 64-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpacklo_epi64&expand=6083)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpcklqdq))]
+pub unsafe fn _mm256_maskz_unpacklo_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let unpacklo = _mm256_unpacklo_epi64(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave 64-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpacklo_epi64&expand=6079)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpcklqdq))]
+pub unsafe fn _mm_mask_unpacklo_epi64(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let unpacklo = _mm_unpacklo_epi64(a, b).as_i64x2();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_i64x2()))
+}
+
+/// Unpack and interleave 64-bit integers from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpacklo_epi64&expand=6080)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpunpcklqdq))]
+pub unsafe fn _mm_maskz_unpacklo_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let unpacklo = _mm_unpacklo_epi64(a, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpacklo_ps&expand=6117)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpcklps))]
+pub unsafe fn _mm512_unpacklo_ps(a: __m512, b: __m512) -> __m512 {
+ #[rustfmt::skip]
+ simd_shuffle16!(a, b,
+ [ 0, 16, 1, 17,
+ 0 + 4, 16 + 4, 1 + 4, 17 + 4,
+ 0 + 8, 16 + 8, 1 + 8, 17 + 8,
+ 0 + 12, 16 + 12, 1 + 12, 17 + 12],
+ )
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpacklo_ps&expand=6115)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpcklps))]
+pub unsafe fn _mm512_mask_unpacklo_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let unpacklo = _mm512_unpacklo_ps(a, b).as_f32x16();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_f32x16()))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpacklo_ps&expand=6116)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpcklps))]
+pub unsafe fn _mm512_maskz_unpacklo_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ let unpacklo = _mm512_unpacklo_ps(a, b).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpacklo_ps&expand=6112)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpcklps))]
+pub unsafe fn _mm256_mask_unpacklo_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let unpacklo = _mm256_unpacklo_ps(a, b).as_f32x8();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_f32x8()))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpacklo_ps&expand=6113)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpcklps))]
+pub unsafe fn _mm256_maskz_unpacklo_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ let unpacklo = _mm256_unpacklo_ps(a, b).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpacklo_ps&expand=6109)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpcklps))]
+pub unsafe fn _mm_mask_unpacklo_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let unpacklo = _mm_unpacklo_ps(a, b).as_f32x4();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_f32x4()))
+}
+
+/// Unpack and interleave single-precision (32-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpacklo_ps&expand=6110)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpcklps))]
+pub unsafe fn _mm_maskz_unpacklo_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let unpacklo = _mm_unpacklo_ps(a, b).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_unpacklo_pd&expand=6105)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpcklpd))]
+pub unsafe fn _mm512_unpacklo_pd(a: __m512d, b: __m512d) -> __m512d {
+ simd_shuffle8!(a, b, [0, 8, 0 + 2, 8 + 2, 0 + 4, 8 + 4, 0 + 6, 8 + 6])
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_unpacklo_pd&expand=6103)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpcklpd))]
+pub unsafe fn _mm512_mask_unpacklo_pd(
+ src: __m512d,
+ k: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __m512d {
+ let unpacklo = _mm512_unpacklo_pd(a, b).as_f64x8();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_f64x8()))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_unpacklo_pd&expand=6104)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vunpcklpd))]
+pub unsafe fn _mm512_maskz_unpacklo_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ let unpacklo = _mm512_unpacklo_pd(a, b).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_unpacklo_pd&expand=6100)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpcklpd))]
+pub unsafe fn _mm256_mask_unpacklo_pd(
+ src: __m256d,
+ k: __mmask8,
+ a: __m256d,
+ b: __m256d,
+) -> __m256d {
+ let unpacklo = _mm256_unpacklo_pd(a, b).as_f64x4();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_f64x4()))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_unpacklo_pd&expand=6101)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpcklpd))]
+pub unsafe fn _mm256_maskz_unpacklo_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ let unpacklo = _mm256_unpacklo_pd(a, b).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_unpacklo_pd&expand=6097)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpcklpd))]
+pub unsafe fn _mm_mask_unpacklo_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let unpacklo = _mm_unpacklo_pd(a, b).as_f64x2();
+ transmute(simd_select_bitmask(k, unpacklo, src.as_f64x2()))
+}
+
+/// Unpack and interleave double-precision (64-bit) floating-point elements from the low half of each 128-bit lane in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_unpacklo_pd&expand=6098)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vunpcklpd))]
+pub unsafe fn _mm_maskz_unpacklo_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let unpacklo = _mm_unpacklo_pd(a, b).as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ transmute(simd_select_bitmask(k, unpacklo, zero))
+}
+
+/// Cast vector of type __m128 to type __m512; the upper 384 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castps128_ps512&expand=621)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castps128_ps512(a: __m128) -> __m512 {
+ simd_shuffle16!(
+ a,
+ _mm_set1_ps(-1.),
+ [0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+ )
+}
+
+/// Cast vector of type __m256 to type __m512; the upper 256 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castps256_ps512&expand=623)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castps256_ps512(a: __m256) -> __m512 {
+ simd_shuffle16!(
+ a,
+ _mm256_set1_ps(-1.),
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8],
+ )
+}
+
+/// Cast vector of type __m128 to type __m512; the upper 384 bits of the result are zeroed. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_zextps128_ps512&expand=6196)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_zextps128_ps512(a: __m128) -> __m512 {
+ simd_shuffle16!(
+ a,
+ _mm_set1_ps(0.),
+ [0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+ )
+}
+
+/// Cast vector of type __m256 to type __m512; the upper 256 bits of the result are zeroed. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_zextps256_ps512&expand=6197)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_zextps256_ps512(a: __m256) -> __m512 {
+ simd_shuffle16!(
+ a,
+ _mm256_set1_ps(0.),
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8],
+ )
+}
+
+/// Cast vector of type __m512 to type __m128. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castps512_ps128&expand=624)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castps512_ps128(a: __m512) -> __m128 {
+ simd_shuffle4!(a, a, [0, 1, 2, 3])
+}
+
+/// Cast vector of type __m512 to type __m256. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castps512_ps256&expand=625)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castps512_ps256(a: __m512) -> __m256 {
+ simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Cast vector of type __m512 to type __m512d. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castps_pd&expand=616)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castps_pd(a: __m512) -> __m512d {
+ transmute(a.as_m512())
+}
+
+/// Cast vector of type __m512 to type __m512i. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castps_si512&expand=619)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castps_si512(a: __m512) -> __m512i {
+ transmute(a.as_m512())
+}
+
+/// Cast vector of type __m128d to type __m512d; the upper 384 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castpd128_pd512&expand=609)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castpd128_pd512(a: __m128d) -> __m512d {
+ simd_shuffle8!(a, _mm_set1_pd(-1.), [0, 1, 2, 2, 2, 2, 2, 2])
+}
+
+/// Cast vector of type __m256d to type __m512d; the upper 256 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castpd256_pd512&expand=611)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castpd256_pd512(a: __m256d) -> __m512d {
+ simd_shuffle8!(a, _mm256_set1_pd(-1.), [0, 1, 2, 3, 4, 4, 4, 4])
+}
+
+/// Cast vector of type __m128d to type __m512d; the upper 384 bits of the result are zeroed. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_zextpd128_pd512&expand=6193)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_zextpd128_pd512(a: __m128d) -> __m512d {
+ simd_shuffle8!(a, _mm_set1_pd(0.), [0, 1, 2, 2, 2, 2, 2, 2])
+}
+
+/// Cast vector of type __m256d to type __m512d; the upper 256 bits of the result are zeroed. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_zextpd256_pd512&expand=6194)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_zextpd256_pd512(a: __m256d) -> __m512d {
+ simd_shuffle8!(a, _mm256_set1_pd(0.), [0, 1, 2, 3, 4, 4, 4, 4])
+}
+
+/// Cast vector of type __m512d to type __m128d. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castpd512_pd128&expand=612)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castpd512_pd128(a: __m512d) -> __m128d {
+ simd_shuffle2!(a, a, [0, 1])
+}
+
+/// Cast vector of type __m512d to type __m256d. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castpd512_pd256&expand=613)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castpd512_pd256(a: __m512d) -> __m256d {
+ simd_shuffle4!(a, a, [0, 1, 2, 3])
+}
+
+/// Cast vector of type __m512d to type __m512. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castpd_ps&expand=604)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castpd_ps(a: __m512d) -> __m512 {
+ transmute(a.as_m512d())
+}
+
+/// Cast vector of type __m512d to type __m512i. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castpd_si512&expand=607)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castpd_si512(a: __m512d) -> __m512i {
+ transmute(a.as_m512d())
+}
+
+/// Cast vector of type __m128i to type __m512i; the upper 384 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castsi128_si512&expand=629)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castsi128_si512(a: __m128i) -> __m512i {
+ simd_shuffle8!(a, _mm_set1_epi64x(-1), [0, 1, 2, 2, 2, 2, 2, 2])
+}
+
+/// Cast vector of type __m256i to type __m512i; the upper 256 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castsi256_si512&expand=633)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castsi256_si512(a: __m256i) -> __m512i {
+ simd_shuffle8!(a, _mm256_set1_epi64x(-1), [0, 1, 2, 3, 4, 4, 4, 4])
+}
+
+/// Cast vector of type __m128i to type __m512i; the upper 384 bits of the result are zeroed. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_zextsi128_si512&expand=6199)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_zextsi128_si512(a: __m128i) -> __m512i {
+ simd_shuffle8!(a, _mm_set1_epi64x(0), [0, 1, 2, 2, 2, 2, 2, 2])
+}
+
+/// Cast vector of type __m256i to type __m512i; the upper 256 bits of the result are zeroed. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_zextsi256_si512&expand=6200)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_zextsi256_si512(a: __m256i) -> __m512i {
+ simd_shuffle8!(a, _mm256_set1_epi64x(0), [0, 1, 2, 3, 4, 4, 4, 4])
+}
+
+/// Cast vector of type __m512i to type __m128i. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castsi512_si128&expand=636)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castsi512_si128(a: __m512i) -> __m128i {
+ simd_shuffle2!(a, a, [0, 1])
+}
+
+/// Cast vector of type __m512i to type __m256i. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castsi512_si256&expand=637)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castsi512_si256(a: __m512i) -> __m256i {
+ simd_shuffle4!(a, a, [0, 1, 2, 3])
+}
+
+/// Cast vector of type __m512i to type __m512. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castsi512_ps&expand=635)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castsi512_ps(a: __m512i) -> __m512 {
+ transmute(a)
+}
+
+/// Cast vector of type __m512i to type __m512d. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_castsi512_pd&expand=634)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_castsi512_pd(a: __m512i) -> __m512d {
+ transmute(a)
+}
+
+/// Copy the lower 32-bit integer in a to dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cvtsi512_si32&expand=1882)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(vmovd))]
+pub unsafe fn _mm512_cvtsi512_si32(a: __m512i) -> i32 {
+ let extract: i32 = simd_extract(a.as_i32x16(), 0);
+ transmute(extract)
+}
+
+/// Broadcast the low packed 32-bit integer from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_broadcastd_epi32&expand=545)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vbroadcast))] //should be vpbroadcastd
+pub unsafe fn _mm512_broadcastd_epi32(a: __m128i) -> __m512i {
+ let a = _mm512_castsi128_si512(a).as_i32x16();
+ let ret: i32x16 = simd_shuffle16!(a, a, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+ transmute(ret)
+}
+
+/// Broadcast the low packed 32-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_broadcastd_epi32&expand=546)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd
+pub unsafe fn _mm512_mask_broadcastd_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m512i {
+ let broadcast = _mm512_broadcastd_epi32(a).as_i32x16();
+ transmute(simd_select_bitmask(k, broadcast, src.as_i32x16()))
+}
+
+/// Broadcast the low packed 32-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_broadcastd_epi32&expand=547)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd
+pub unsafe fn _mm512_maskz_broadcastd_epi32(k: __mmask16, a: __m128i) -> __m512i {
+ let broadcast = _mm512_broadcastd_epi32(a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the low packed 32-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_broadcastd_epi32&expand=543)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd
+pub unsafe fn _mm256_mask_broadcastd_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let broadcast = _mm256_broadcastd_epi32(a).as_i32x8();
+ transmute(simd_select_bitmask(k, broadcast, src.as_i32x8()))
+}
+
+/// Broadcast the low packed 32-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_broadcastd_epi32&expand=544)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd
+pub unsafe fn _mm256_maskz_broadcastd_epi32(k: __mmask8, a: __m128i) -> __m256i {
+ let broadcast = _mm256_broadcastd_epi32(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the low packed 32-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_broadcastd_epi32&expand=540)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd
+pub unsafe fn _mm_mask_broadcastd_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let broadcast = _mm_broadcastd_epi32(a).as_i32x4();
+ transmute(simd_select_bitmask(k, broadcast, src.as_i32x4()))
+}
+
+/// Broadcast the low packed 32-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_broadcastd_epi32&expand=541)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd
+pub unsafe fn _mm_maskz_broadcastd_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ let broadcast = _mm_broadcastd_epi32(a).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the low packed 64-bit integer from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_broadcastq_epi64&expand=560)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vbroadcas))] //should be vpbroadcastq
+pub unsafe fn _mm512_broadcastq_epi64(a: __m128i) -> __m512i {
+ simd_shuffle8!(a, a, [0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Broadcast the low packed 64-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_broadcastq_epi64&expand=561)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq
+pub unsafe fn _mm512_mask_broadcastq_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i {
+ let broadcast = _mm512_broadcastq_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, broadcast, src.as_i64x8()))
+}
+
+/// Broadcast the low packed 64-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_broadcastq_epi64&expand=562)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq
+pub unsafe fn _mm512_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m512i {
+ let broadcast = _mm512_broadcastq_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the low packed 64-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_broadcastq_epi64&expand=558)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq
+pub unsafe fn _mm256_mask_broadcastq_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let broadcast = _mm256_broadcastq_epi64(a).as_i64x4();
+ transmute(simd_select_bitmask(k, broadcast, src.as_i64x4()))
+}
+
+/// Broadcast the low packed 64-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_broadcastq_epi64&expand=559)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq
+pub unsafe fn _mm256_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m256i {
+ let broadcast = _mm256_broadcastq_epi64(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the low packed 64-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_broadcastq_epi64&expand=555)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq
+pub unsafe fn _mm_mask_broadcastq_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ let broadcast = _mm_broadcastq_epi64(a).as_i64x2();
+ transmute(simd_select_bitmask(k, broadcast, src.as_i64x2()))
+}
+
+/// Broadcast the low packed 64-bit integer from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_broadcastq_epi64&expand=556)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq
+pub unsafe fn _mm_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let broadcast = _mm_broadcastq_epi64(a).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the low single-precision (32-bit) floating-point element from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_broadcastss_ps&expand=578)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+pub unsafe fn _mm512_broadcastss_ps(a: __m128) -> __m512 {
+ simd_shuffle16!(a, a, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Broadcast the low single-precision (32-bit) floating-point element from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_broadcastss_ps&expand=579)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+pub unsafe fn _mm512_mask_broadcastss_ps(src: __m512, k: __mmask16, a: __m128) -> __m512 {
+ let broadcast = _mm512_broadcastss_ps(a).as_f32x16();
+ transmute(simd_select_bitmask(k, broadcast, src.as_f32x16()))
+}
+
+/// Broadcast the low single-precision (32-bit) floating-point element from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_broadcastss_ps&expand=580)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+pub unsafe fn _mm512_maskz_broadcastss_ps(k: __mmask16, a: __m128) -> __m512 {
+ let broadcast = _mm512_broadcastss_ps(a).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the low single-precision (32-bit) floating-point element from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_broadcastss_ps&expand=576)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+pub unsafe fn _mm256_mask_broadcastss_ps(src: __m256, k: __mmask8, a: __m128) -> __m256 {
+ let broadcast = _mm256_broadcastss_ps(a).as_f32x8();
+ transmute(simd_select_bitmask(k, broadcast, src.as_f32x8()))
+}
+
+/// Broadcast the low single-precision (32-bit) floating-point element from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_broadcastss_ps&expand=577)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+pub unsafe fn _mm256_maskz_broadcastss_ps(k: __mmask8, a: __m128) -> __m256 {
+ let broadcast = _mm256_broadcastss_ps(a).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the low single-precision (32-bit) floating-point element from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_broadcastss_ps&expand=573)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+pub unsafe fn _mm_mask_broadcastss_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 {
+ let broadcast = _mm_broadcastss_ps(a).as_f32x4();
+ transmute(simd_select_bitmask(k, broadcast, src.as_f32x4()))
+}
+
+/// Broadcast the low single-precision (32-bit) floating-point element from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_broadcastss_ps&expand=574)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vbroadcastss))]
+pub unsafe fn _mm_maskz_broadcastss_ps(k: __mmask8, a: __m128) -> __m128 {
+ let broadcast = _mm_broadcastss_ps(a).as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the low double-precision (64-bit) floating-point element from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_broadcastsd_pd&expand=567)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vbroadcastsd))]
+pub unsafe fn _mm512_broadcastsd_pd(a: __m128d) -> __m512d {
+ simd_shuffle8!(a, a, [0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Broadcast the low double-precision (64-bit) floating-point element from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_broadcastsd_pd&expand=568)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vbroadcastsd))]
+pub unsafe fn _mm512_mask_broadcastsd_pd(src: __m512d, k: __mmask8, a: __m128d) -> __m512d {
+ let broadcast = _mm512_broadcastsd_pd(a).as_f64x8();
+ transmute(simd_select_bitmask(k, broadcast, src.as_f64x8()))
+}
+
+/// Broadcast the low double-precision (64-bit) floating-point element from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_broadcastsd_pd&expand=569)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vbroadcastsd))]
+pub unsafe fn _mm512_maskz_broadcastsd_pd(k: __mmask8, a: __m128d) -> __m512d {
+ let broadcast = _mm512_broadcastsd_pd(a).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the low double-precision (64-bit) floating-point element from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_broadcastsd_pd&expand=565)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vbroadcastsd))]
+pub unsafe fn _mm256_mask_broadcastsd_pd(src: __m256d, k: __mmask8, a: __m128d) -> __m256d {
+ let broadcast = _mm256_broadcastsd_pd(a).as_f64x4();
+ transmute(simd_select_bitmask(k, broadcast, src.as_f64x4()))
+}
+
+/// Broadcast the low double-precision (64-bit) floating-point element from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_broadcastsd_pd&expand=566)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vbroadcastsd))]
+pub unsafe fn _mm256_maskz_broadcastsd_pd(k: __mmask8, a: __m128d) -> __m256d {
+ let broadcast = _mm256_broadcastsd_pd(a).as_f64x4();
+ let zero = _mm256_setzero_pd().as_f64x4();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the 4 packed 32-bit integers from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_broadcast_i32x4&expand=510)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcasti32x4, linux: vshuf
+pub unsafe fn _mm512_broadcast_i32x4(a: __m128i) -> __m512i {
+ let a = a.as_i32x4();
+ let ret: i32x16 = simd_shuffle16!(a, a, [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]);
+ transmute(ret)
+}
+
+/// Broadcast the 4 packed 32-bit integers from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_broadcast_i32x4&expand=511)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcasti32x4, linux: vshuf
+pub unsafe fn _mm512_mask_broadcast_i32x4(src: __m512i, k: __mmask16, a: __m128i) -> __m512i {
+ let broadcast = _mm512_broadcast_i32x4(a).as_i32x16();
+ transmute(simd_select_bitmask(k, broadcast, src.as_i32x16()))
+}
+
+/// Broadcast the 4 packed 32-bit integers from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_broadcast_i32x4&expand=512)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcasti32x4, linux: vshuf
+pub unsafe fn _mm512_maskz_broadcast_i32x4(k: __mmask16, a: __m128i) -> __m512i {
+ let broadcast = _mm512_broadcast_i32x4(a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the 4 packed 32-bit integers from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcast_i32x4&expand=507)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcasti32x4, linux: vshuf
+pub unsafe fn _mm256_broadcast_i32x4(a: __m128i) -> __m256i {
+ let a = a.as_i32x4();
+ let ret: i32x8 = simd_shuffle8!(a, a, [0, 1, 2, 3, 0, 1, 2, 3]);
+ transmute(ret)
+}
+
+/// Broadcast the 4 packed 32-bit integers from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_broadcast_i32x4&expand=508)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcasti32x4, linux: vshuf
+pub unsafe fn _mm256_mask_broadcast_i32x4(src: __m256i, k: __mmask8, a: __m128i) -> __m256i {
+ let broadcast = _mm256_broadcast_i32x4(a).as_i32x8();
+ transmute(simd_select_bitmask(k, broadcast, src.as_i32x8()))
+}
+
+/// Broadcast the 4 packed 32-bit integers from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_broadcast_i32x4&expand=509)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcasti32x4, linux: vshuf
+pub unsafe fn _mm256_maskz_broadcast_i32x4(k: __mmask8, a: __m128i) -> __m256i {
+ let broadcast = _mm256_broadcast_i32x4(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the 4 packed 64-bit integers from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_broadcast_i64x4&expand=522)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcasti64x4, linux: vperm
+pub unsafe fn _mm512_broadcast_i64x4(a: __m256i) -> __m512i {
+ simd_shuffle8!(a, a, [0, 1, 2, 3, 0, 1, 2, 3])
+}
+
+/// Broadcast the 4 packed 64-bit integers from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_mask_broadcast_i64x4&expand=523)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcasti64x4, linux: vperm
+pub unsafe fn _mm512_mask_broadcast_i64x4(src: __m512i, k: __mmask8, a: __m256i) -> __m512i {
+ let broadcast = _mm512_broadcast_i64x4(a).as_i64x8();
+ transmute(simd_select_bitmask(k, broadcast, src.as_i64x8()))
+}
+
+/// Broadcast the 4 packed 64-bit integers from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_maskz_broadcast_i64x4&expand=524)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcasti64x4, linux: vperm
+pub unsafe fn _mm512_maskz_broadcast_i64x4(k: __mmask8, a: __m256i) -> __m512i {
+ let broadcast = _mm512_broadcast_i64x4(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the 4 packed single-precision (32-bit) floating-point elements from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_broadcast_f32x4&expand=483)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcastf32x4, linux: vshuf
+pub unsafe fn _mm512_broadcast_f32x4(a: __m128) -> __m512 {
+ simd_shuffle16!(a, a, [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3])
+}
+
+/// Broadcast the 4 packed single-precision (32-bit) floating-point elements from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_broadcast_f32x4&expand=484)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcastf32x4, linux: vshu
+pub unsafe fn _mm512_mask_broadcast_f32x4(src: __m512, k: __mmask16, a: __m128) -> __m512 {
+ let broadcast = _mm512_broadcast_f32x4(a).as_f32x16();
+ transmute(simd_select_bitmask(k, broadcast, src.as_f32x16()))
+}
+
+/// Broadcast the 4 packed single-precision (32-bit) floating-point elements from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_broadcast_f32x4&expand=485)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcastf32x4, linux: vshu
+pub unsafe fn _mm512_maskz_broadcast_f32x4(k: __mmask16, a: __m128) -> __m512 {
+ let broadcast = _mm512_broadcast_f32x4(a).as_f32x16();
+ let zero = _mm512_setzero_ps().as_f32x16();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the 4 packed single-precision (32-bit) floating-point elements from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_broadcast_f32x4&expand=480)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcastf32x4, linux: vshuf
+pub unsafe fn _mm256_broadcast_f32x4(a: __m128) -> __m256 {
+ simd_shuffle8!(a, a, [0, 1, 2, 3, 0, 1, 2, 3])
+}
+
+/// Broadcast the 4 packed single-precision (32-bit) floating-point elements from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_broadcast_f32x4&expand=481)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcastf32x4, linux: vshu
+pub unsafe fn _mm256_mask_broadcast_f32x4(src: __m256, k: __mmask8, a: __m128) -> __m256 {
+ let broadcast = _mm256_broadcast_f32x4(a).as_f32x8();
+ transmute(simd_select_bitmask(k, broadcast, src.as_f32x8()))
+}
+
+/// Broadcast the 4 packed single-precision (32-bit) floating-point elements from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_broadcast_f32x4&expand=482)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcastf32x4, linux: vshu
+pub unsafe fn _mm256_maskz_broadcast_f32x4(k: __mmask8, a: __m128) -> __m256 {
+ let broadcast = _mm256_broadcast_f32x4(a).as_f32x8();
+ let zero = _mm256_setzero_ps().as_f32x8();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Broadcast the 4 packed double-precision (64-bit) floating-point elements from a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_broadcast_f64x4&expand=495)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcastf64x4, linux: vperm
+pub unsafe fn _mm512_broadcast_f64x4(a: __m256d) -> __m512d {
+ simd_shuffle8!(a, a, [0, 1, 2, 3, 0, 1, 2, 3])
+}
+
+/// Broadcast the 4 packed double-precision (64-bit) floating-point elements from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_mask_broadcast_f64x4&expand=496)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcastf64x4, linux: vper
+pub unsafe fn _mm512_mask_broadcast_f64x4(src: __m512d, k: __mmask8, a: __m256d) -> __m512d {
+ let broadcast = _mm512_broadcast_f64x4(a).as_f64x8();
+ transmute(simd_select_bitmask(k, broadcast, src.as_f64x8()))
+}
+
+/// Broadcast the 4 packed double-precision (64-bit) floating-point elements from a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_maskz_broadcast_f64x4&expand=497)
+#[inline]
+#[target_feature(enable = "avx512f")] //msvc: vbroadcastf64x4, linux: vper
+pub unsafe fn _mm512_maskz_broadcast_f64x4(k: __mmask8, a: __m256d) -> __m512d {
+ let broadcast = _mm512_broadcast_f64x4(a).as_f64x8();
+ let zero = _mm512_setzero_pd().as_f64x8();
+ transmute(simd_select_bitmask(k, broadcast, zero))
+}
+
+/// Blend packed 32-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_blend_epi32&expand=435)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovdqa32))] //should be vpblendmd
+pub unsafe fn _mm512_mask_blend_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_select_bitmask(k, b.as_i32x16(), a.as_i32x16()))
+}
+
+/// Blend packed 32-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_blend_epi32&expand=434)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa32))] //should be vpblendmd
+pub unsafe fn _mm256_mask_blend_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_select_bitmask(k, b.as_i32x8(), a.as_i32x8()))
+}
+
+/// Blend packed 32-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_blend_epi32&expand=432)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa32))] //should be vpblendmd
+pub unsafe fn _mm_mask_blend_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_select_bitmask(k, b.as_i32x4(), a.as_i32x4()))
+}
+
+/// Blend packed 64-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_blend_epi64&expand=438)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovdqa64))] //should be vpblendmq
+pub unsafe fn _mm512_mask_blend_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_select_bitmask(k, b.as_i64x8(), a.as_i64x8()))
+}
+
+/// Blend packed 64-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_blend_epi64&expand=437)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa64))] //should be vpblendmq
+pub unsafe fn _mm256_mask_blend_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_select_bitmask(k, b.as_i64x4(), a.as_i64x4()))
+}
+
+/// Blend packed 64-bit integers from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_blend_epi64&expand=436)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovdqa64))] //should be vpblendmq
+pub unsafe fn _mm_mask_blend_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_select_bitmask(k, b.as_i64x2(), a.as_i64x2()))
+}
+
+/// Blend packed single-precision (32-bit) floating-point elements from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_blend_ps&expand=451)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vpblendmps
+pub unsafe fn _mm512_mask_blend_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 {
+ transmute(simd_select_bitmask(k, b.as_f32x16(), a.as_f32x16()))
+}
+
+/// Blend packed single-precision (32-bit) floating-point elements from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_blend_ps&expand=450)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vpblendmps
+pub unsafe fn _mm256_mask_blend_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 {
+ transmute(simd_select_bitmask(k, b.as_f32x8(), a.as_f32x8()))
+}
+
+/// Blend packed single-precision (32-bit) floating-point elements from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_blend_ps&expand=448)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vpblendmps
+pub unsafe fn _mm_mask_blend_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(simd_select_bitmask(k, b.as_f32x4(), a.as_f32x4()))
+}
+
+/// Blend packed double-precision (64-bit) floating-point elements from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_blend_pd&expand=446)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovapd))] //should be vpblendmpd
+pub unsafe fn _mm512_mask_blend_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d {
+ transmute(simd_select_bitmask(k, b.as_f64x8(), a.as_f64x8()))
+}
+
+/// Blend packed double-precision (64-bit) floating-point elements from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_blend_pd&expand=445)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovapd))] //should be vpblendmpd
+pub unsafe fn _mm256_mask_blend_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d {
+ transmute(simd_select_bitmask(k, b.as_f64x4(), a.as_f64x4()))
+}
+
+/// Blend packed double-precision (64-bit) floating-point elements from a and b using control mask k, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_blend_pd&expand=443)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovapd))] //should be vpblendmpd
+pub unsafe fn _mm_mask_blend_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(simd_select_bitmask(k, b.as_f64x2(), a.as_f64x2()))
+}
+
+/// Concatenate a and b into a 128-byte immediate result, shift the result right by imm8 32-bit elements, and store the low 64 bytes (16 elements) in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_alignr_epi32&expand=245)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(valignd, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_alignr_epi32<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ let imm8: i32 = IMM8 % 16;
+ let r: i32x16 = match imm8 {
+ 0 => simd_shuffle16!(
+ a,
+ b,
+ [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,],
+ ),
+ 1 => simd_shuffle16!(
+ a,
+ b,
+ [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0,],
+ ),
+ 2 => simd_shuffle16!(
+ a,
+ b,
+ [18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1],
+ ),
+ 3 => simd_shuffle16!(
+ a,
+ b,
+ [19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2],
+ ),
+ 4 => simd_shuffle16!(
+ a,
+ b,
+ [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3],
+ ),
+ 5 => simd_shuffle16!(
+ a,
+ b,
+ [21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4],
+ ),
+ 6 => simd_shuffle16!(
+ a,
+ b,
+ [22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5],
+ ),
+ 7 => simd_shuffle16!(
+ a,
+ b,
+ [23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6],
+ ),
+ 8 => simd_shuffle16!(
+ a,
+ b,
+ [24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7],
+ ),
+ 9 => simd_shuffle16!(
+ a,
+ b,
+ [25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8],
+ ),
+ 10 => simd_shuffle16!(a, b, [26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]),
+ 11 => simd_shuffle16!(a, b, [27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
+ 12 => simd_shuffle16!(a, b, [28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),
+ 13 => simd_shuffle16!(a, b, [29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]),
+ 14 => simd_shuffle16!(a, b, [30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]),
+ _ => simd_shuffle16!(a, b, [31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]),
+ };
+ transmute(r)
+}
+
+/// Concatenate a and b into a 128-byte immediate result, shift the result right by imm8 32-bit elements, and store the low 64 bytes (16 elements) in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_mask_alignr_epi32&expand=246)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(valignd, IMM8 = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_alignr_epi32<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let r = _mm512_alignr_epi32::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i32x16(), src.as_i32x16()))
+}
+
+/// Concatenate a and b into a 128-byte immediate result, shift the result right by imm8 32-bit elements, and stores the low 64 bytes (16 elements) in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_maskz_alignr_epi32&expand=247)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(valignd, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_alignr_epi32<const IMM8: i32>(
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let r = _mm512_alignr_epi32::<IMM8>(a, b);
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, r.as_i32x16(), zero))
+}
+
+/// Concatenate a and b into a 64-byte immediate result, shift the result right by imm8 32-bit elements, and store the low 32 bytes (8 elements) in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_alignr_epi32&expand=242)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(valignd, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_alignr_epi32<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x8();
+ let b = b.as_i32x8();
+ let imm8: i32 = IMM8 % 16;
+ let r: i32x8 = match imm8 {
+ 0 => simd_shuffle8!(a, b, [8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle8!(a, b, [9, 10, 11, 12, 13, 14, 15, 0]),
+ 2 => simd_shuffle8!(a, b, [10, 11, 12, 13, 14, 15, 0, 1]),
+ 3 => simd_shuffle8!(a, b, [11, 12, 13, 14, 15, 0, 1, 2]),
+ 4 => simd_shuffle8!(a, b, [12, 13, 14, 15, 0, 1, 2, 3]),
+ 5 => simd_shuffle8!(a, b, [13, 14, 15, 0, 1, 2, 3, 4]),
+ 6 => simd_shuffle8!(a, b, [14, 15, 0, 1, 2, 3, 4, 5]),
+ 7 => simd_shuffle8!(a, b, [15, 0, 1, 2, 3, 4, 5, 6]),
+ 8 => simd_shuffle8!(a, b, [0, 1, 2, 3, 4, 5, 6, 7]),
+ 9 => simd_shuffle8!(a, b, [1, 2, 3, 4, 5, 6, 7, 8]),
+ 10 => simd_shuffle8!(a, b, [2, 3, 4, 5, 6, 7, 8, 9]),
+ 11 => simd_shuffle8!(a, b, [3, 4, 5, 6, 7, 8, 9, 10]),
+ 12 => simd_shuffle8!(a, b, [4, 5, 6, 7, 8, 9, 10, 11]),
+ 13 => simd_shuffle8!(a, b, [5, 6, 7, 8, 9, 10, 11, 12]),
+ 14 => simd_shuffle8!(a, b, [6, 7, 8, 9, 10, 11, 12, 13]),
+ _ => simd_shuffle8!(a, b, [7, 8, 9, 10, 11, 12, 13, 14]),
+ };
+ transmute(r)
+}
+
+/// Concatenate a and b into a 64-byte immediate result, shift the result right by imm8 32-bit elements, and store the low 32 bytes (8 elements) in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_alignr_epi32&expand=243)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(valignd, IMM8 = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_alignr_epi32<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let r = _mm256_alignr_epi32::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i32x8(), src.as_i32x8()))
+}
+
+/// Concatenate a and b into a 64-byte immediate result, shift the result right by imm8 32-bit elements, and store the low 32 bytes (8 elements) in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_alignr_epi32&expand=244)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(valignd, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_alignr_epi32<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let r = _mm256_alignr_epi32::<IMM8>(a, b);
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r.as_i32x8(), zero))
+}
+
+/// Concatenate a and b into a 32-byte immediate result, shift the result right by imm8 32-bit elements, and store the low 16 bytes (4 elements) in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_alignr_epi32&expand=239)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))] //should be valignd
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_alignr_epi32<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ let imm8: i32 = IMM8 % 8;
+ let r: i32x4 = match imm8 {
+ 0 => simd_shuffle4!(a, b, [4, 5, 6, 7]),
+ 1 => simd_shuffle4!(a, b, [5, 6, 7, 0]),
+ 2 => simd_shuffle4!(a, b, [6, 7, 0, 1]),
+ 3 => simd_shuffle4!(a, b, [7, 0, 1, 2]),
+ 4 => simd_shuffle4!(a, b, [0, 1, 2, 3]),
+ 5 => simd_shuffle4!(a, b, [1, 2, 3, 0]),
+ 6 => simd_shuffle4!(a, b, [2, 3, 0, 1]),
+ _ => simd_shuffle4!(a, b, [3, 0, 1, 2]),
+ };
+ transmute(r)
+}
+
+/// Concatenate a and b into a 32-byte immediate result, shift the result right by imm8 32-bit elements, and store the low 16 bytes (4 elements) in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_alignr_epi32&expand=240)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(valignd, IMM8 = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_alignr_epi32<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let r = _mm_alignr_epi32::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i32x4(), src.as_i32x4()))
+}
+
+/// Concatenate a and b into a 32-byte immediate result, shift the result right by imm8 32-bit elements, and store the low 16 bytes (4 elements) in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_alignr_epi32&expand=241)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(valignd, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_alignr_epi32<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let r = _mm_alignr_epi32::<IMM8>(a, b);
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r.as_i32x4(), zero))
+}
+
+/// Concatenate a and b into a 128-byte immediate result, shift the result right by imm8 64-bit elements, and store the low 64 bytes (8 elements) in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_alignr_epi64&expand=254)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(valignq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_alignr_epi64<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8: i32 = IMM8 % 8;
+ let r: i64x8 = match imm8 {
+ 0 => simd_shuffle8!(a, b, [8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle8!(a, b, [9, 10, 11, 12, 13, 14, 15, 0]),
+ 2 => simd_shuffle8!(a, b, [10, 11, 12, 13, 14, 15, 0, 1]),
+ 3 => simd_shuffle8!(a, b, [11, 12, 13, 14, 15, 0, 1, 2]),
+ 4 => simd_shuffle8!(a, b, [12, 13, 14, 15, 0, 1, 2, 3]),
+ 5 => simd_shuffle8!(a, b, [13, 14, 15, 0, 1, 2, 3, 4]),
+ 6 => simd_shuffle8!(a, b, [14, 15, 0, 1, 2, 3, 4, 5]),
+ _ => simd_shuffle8!(a, b, [15, 0, 1, 2, 3, 4, 5, 6]),
+ };
+ transmute(r)
+}
+
+/// Concatenate a and b into a 128-byte immediate result, shift the result right by imm8 64-bit elements, and store the low 64 bytes (8 elements) in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_mask_alignr_epi64&expand=255)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(valignq, IMM8 = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_alignr_epi64<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let r = _mm512_alignr_epi64::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i64x8(), src.as_i64x8()))
+}
+
+/// Concatenate a and b into a 128-byte immediate result, shift the result right by imm8 64-bit elements, and stores the low 64 bytes (8 elements) in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_maskz_alignr_epi64&expand=256)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(valignq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_alignr_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let r = _mm512_alignr_epi64::<IMM8>(a, b);
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, r.as_i64x8(), zero))
+}
+
+/// Concatenate a and b into a 64-byte immediate result, shift the result right by imm8 64-bit elements, and store the low 32 bytes (4 elements) in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_alignr_epi64&expand=251)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(valignq, IMM8 = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_alignr_epi64<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8: i32 = IMM8 % 8;
+ let r: i64x4 = match imm8 {
+ 0 => simd_shuffle4!(a, b, [4, 5, 6, 7]),
+ 1 => simd_shuffle4!(a, b, [5, 6, 7, 0]),
+ 2 => simd_shuffle4!(a, b, [6, 7, 0, 1]),
+ 3 => simd_shuffle4!(a, b, [7, 0, 1, 2]),
+ 4 => simd_shuffle4!(a, b, [0, 1, 2, 3]),
+ 5 => simd_shuffle4!(a, b, [1, 2, 3, 4]),
+ 6 => simd_shuffle4!(a, b, [2, 3, 4, 5]),
+ _ => simd_shuffle4!(a, b, [3, 4, 5, 6]),
+ };
+ transmute(r)
+}
+
+/// Concatenate a and b into a 64-byte immediate result, shift the result right by imm8 64-bit elements, and store the low 32 bytes (4 elements) in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_alignr_epi64&expand=252)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(valignq, IMM8 = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_alignr_epi64<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let r = _mm256_alignr_epi64::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i64x4(), src.as_i64x4()))
+}
+
+/// Concatenate a and b into a 64-byte immediate result, shift the result right by imm8 64-bit elements, and store the low 32 bytes (4 elements) in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_alignr_epi64&expand=253)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(valignq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_alignr_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let r = _mm256_alignr_epi64::<IMM8>(a, b);
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, r.as_i64x4(), zero))
+}
+
+/// Concatenate a and b into a 32-byte immediate result, shift the result right by imm8 64-bit elements, and store the low 16 bytes (2 elements) in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_alignr_epi64&expand=248)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))] //should be valignq
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_alignr_epi64<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8: i32 = IMM8 % 4;
+ let r: i64x2 = match imm8 {
+ 0 => simd_shuffle2!(a, b, [2, 3]),
+ 1 => simd_shuffle2!(a, b, [3, 0]),
+ 2 => simd_shuffle2!(a, b, [0, 1]),
+ _ => simd_shuffle2!(a, b, [1, 2]),
+ };
+ transmute(r)
+}
+
+/// Concatenate a and b into a 32-byte immediate result, shift the result right by imm8 64-bit elements, and store the low 16 bytes (2 elements) in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_alignr_epi64&expand=249)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(valignq, IMM8 = 1))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_alignr_epi64<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let r = _mm_alignr_epi64::<IMM8>(a, b);
+ transmute(simd_select_bitmask(k, r.as_i64x2(), src.as_i64x2()))
+}
+
+/// Concatenate a and b into a 32-byte immediate result, shift the result right by imm8 64-bit elements, and store the low 16 bytes (2 elements) in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_alignr_epi64&expand=250)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(valignq, IMM8 = 1))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_alignr_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let r = _mm_alignr_epi64::<IMM8>(a, b);
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, r.as_i64x2(), zero))
+}
+
+/// Compute the bitwise AND of packed 32-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_and_epi32&expand=272)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandq))] //should be vpandd, but generate vpandq
+pub unsafe fn _mm512_and_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_and(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Performs element-by-element bitwise AND between packed 32-bit integer elements of a and b, storing the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_and_epi32&expand=273)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandd))]
+pub unsafe fn _mm512_mask_and_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let and = _mm512_and_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, and, src.as_i32x16()))
+}
+
+/// Compute the bitwise AND of packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_and_epi32&expand=274)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandd))]
+pub unsafe fn _mm512_maskz_and_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let and = _mm512_and_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, and, zero))
+}
+
+/// Performs element-by-element bitwise AND between packed 32-bit integer elements of a and b, storing the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_and_epi32&expand=270)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandd))]
+pub unsafe fn _mm256_mask_and_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let and = simd_and(a.as_i32x8(), b.as_i32x8());
+ transmute(simd_select_bitmask(k, and, src.as_i32x8()))
+}
+
+/// Compute the bitwise AND of packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_and_epi32&expand=271)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandd))]
+pub unsafe fn _mm256_maskz_and_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let and = simd_and(a.as_i32x8(), b.as_i32x8());
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, and, zero))
+}
+
+/// Performs element-by-element bitwise AND between packed 32-bit integer elements of a and b, storing the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_and_epi32&expand=268)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandd))]
+pub unsafe fn _mm_mask_and_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let and = simd_and(a.as_i32x4(), b.as_i32x4());
+ transmute(simd_select_bitmask(k, and, src.as_i32x4()))
+}
+
+/// Compute the bitwise AND of packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_and_epi32&expand=269)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandd))]
+pub unsafe fn _mm_maskz_and_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let and = simd_and(a.as_i32x4(), b.as_i32x4());
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, and, zero))
+}
+
+/// Compute the bitwise AND of 512 bits (composed of packed 64-bit integers) in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_and_epi64&expand=279)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm512_and_epi64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_and(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_and_epi64&expand=280)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm512_mask_and_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let and = _mm512_and_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, and, src.as_i64x8()))
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_and_epi64&expand=281)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm512_maskz_and_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let and = _mm512_and_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, and, zero))
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_and_epi64&expand=277)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm256_mask_and_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let and = simd_and(a.as_i64x4(), b.as_i64x4());
+ transmute(simd_select_bitmask(k, and, src.as_i64x4()))
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_and_epi64&expand=278)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm256_maskz_and_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let and = simd_and(a.as_i64x4(), b.as_i64x4());
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, and, zero))
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_and_epi64&expand=275)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm_mask_and_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let and = simd_and(a.as_i64x2(), b.as_i64x2());
+ transmute(simd_select_bitmask(k, and, src.as_i64x2()))
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_and_epi64&expand=276)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm_maskz_and_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let and = simd_and(a.as_i64x2(), b.as_i64x2());
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, and, zero))
+}
+
+/// Compute the bitwise AND of 512 bits (representing integer data) in a and b, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_and_si512&expand=302)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandq))]
+pub unsafe fn _mm512_and_si512(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_and(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compute the bitwise OR of packed 32-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_or_epi32&expand=4042)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vporq))]
+pub unsafe fn _mm512_or_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_or(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compute the bitwise OR of packed 32-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_or_epi32&expand=4040)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpord))]
+pub unsafe fn _mm512_mask_or_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let or = _mm512_or_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, or, src.as_i32x16()))
+}
+
+/// Compute the bitwise OR of packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_or_epi32&expand=4041)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpord))]
+pub unsafe fn _mm512_maskz_or_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let or = _mm512_or_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, or, zero))
+}
+
+/// Compute the bitwise OR of packed 32-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_or_epi32&expand=4039)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vor))] //should be vpord
+pub unsafe fn _mm256_or_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_or(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compute the bitwise OR of packed 32-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_or_epi32&expand=4037)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpord))]
+pub unsafe fn _mm256_mask_or_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let or = _mm256_or_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, or, src.as_i32x8()))
+}
+
+/// Compute the bitwise OR of packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_or_epi32&expand=4038)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpord))]
+pub unsafe fn _mm256_maskz_or_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let or = _mm256_or_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, or, zero))
+}
+
+/// Compute the bitwise OR of packed 32-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_or_epi32&expand=4036)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vor))] //should be vpord
+pub unsafe fn _mm_or_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_or(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compute the bitwise OR of packed 32-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_or_epi32&expand=4034)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpord))]
+pub unsafe fn _mm_mask_or_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let or = _mm_or_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, or, src.as_i32x4()))
+}
+
+/// Compute the bitwise OR of packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_or_epi32&expand=4035)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpord))]
+pub unsafe fn _mm_maskz_or_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let or = _mm_or_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, or, zero))
+}
+
+/// Compute the bitwise OR of packed 64-bit integers in a and b, and store the resut in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_or_epi64&expand=4051)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vporq))]
+pub unsafe fn _mm512_or_epi64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_or(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compute the bitwise OR of packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_or_epi64&expand=4049)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vporq))]
+pub unsafe fn _mm512_mask_or_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let or = _mm512_or_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, or, src.as_i64x8()))
+}
+
+/// Compute the bitwise OR of packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_or_epi64&expand=4050)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vporq))]
+pub unsafe fn _mm512_maskz_or_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let or = _mm512_or_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, or, zero))
+}
+
+/// Compute the bitwise OR of packed 64-bit integers in a and b, and store the resut in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_or_epi64&expand=4048)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vor))] //should be vporq
+pub unsafe fn _mm256_or_epi64(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_or(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compute the bitwise OR of packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_or_epi64&expand=4046)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vporq))]
+pub unsafe fn _mm256_mask_or_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let or = _mm256_or_epi64(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, or, src.as_i64x4()))
+}
+
+/// Compute the bitwise OR of packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_or_epi64&expand=4047)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vporq))]
+pub unsafe fn _mm256_maskz_or_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let or = _mm256_or_epi64(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, or, zero))
+}
+
+/// Compute the bitwise OR of packed 64-bit integers in a and b, and store the resut in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_or_epi64&expand=4045)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vor))] //should be vporq
+pub unsafe fn _mm_or_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_or(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Compute the bitwise OR of packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_or_epi64&expand=4043)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vporq))]
+pub unsafe fn _mm_mask_or_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let or = _mm_or_epi64(a, b).as_i64x2();
+ transmute(simd_select_bitmask(k, or, src.as_i64x2()))
+}
+
+/// Compute the bitwise OR of packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_or_epi64&expand=4044)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vporq))]
+pub unsafe fn _mm_maskz_or_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let or = _mm_or_epi64(a, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, or, zero))
+}
+
+/// Compute the bitwise OR of 512 bits (representing integer data) in a and b, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_or_si512&expand=4072)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vporq))]
+pub unsafe fn _mm512_or_si512(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_or(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compute the bitwise XOR of packed 32-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_xor_epi32&expand=6142)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpxorq))] //should be vpxord
+pub unsafe fn _mm512_xor_epi32(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_xor(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compute the bitwise XOR of packed 32-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_xor_epi32&expand=6140)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpxord))]
+pub unsafe fn _mm512_mask_xor_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let xor = _mm512_xor_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, xor, src.as_i32x16()))
+}
+
+/// Compute the bitwise XOR of packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_xor_epi32&expand=6141)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpxord))]
+pub unsafe fn _mm512_maskz_xor_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let xor = _mm512_xor_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, xor, zero))
+}
+
+/// Compute the bitwise XOR of packed 32-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_xor_epi32&expand=6139)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vxor))] //should be vpxord
+pub unsafe fn _mm256_xor_epi32(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_xor(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compute the bitwise XOR of packed 32-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_xor_epi32&expand=6137)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpxord))]
+pub unsafe fn _mm256_mask_xor_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let xor = _mm256_xor_epi32(a, b).as_i32x8();
+ transmute(simd_select_bitmask(k, xor, src.as_i32x8()))
+}
+
+/// Compute the bitwise XOR of packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_xor_epi32&expand=6138)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpxord))]
+pub unsafe fn _mm256_maskz_xor_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let xor = _mm256_xor_epi32(a, b).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, xor, zero))
+}
+
+/// Compute the bitwise XOR of packed 32-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_xor_epi32&expand=6136)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vxor))] //should be vpxord
+pub unsafe fn _mm_xor_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_xor(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compute the bitwise XOR of packed 32-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_xor_epi32&expand=6134)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpxord))]
+pub unsafe fn _mm_mask_xor_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let xor = _mm_xor_epi32(a, b).as_i32x4();
+ transmute(simd_select_bitmask(k, xor, src.as_i32x4()))
+}
+
+/// Compute the bitwise XOR of packed 32-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_xor_epi32&expand=6135)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpxord))]
+pub unsafe fn _mm_maskz_xor_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let xor = _mm_xor_epi32(a, b).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, xor, zero))
+}
+
+/// Compute the bitwise XOR of packed 64-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_xor_epi64&expand=6151)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpxorq))]
+pub unsafe fn _mm512_xor_epi64(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_xor(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compute the bitwise XOR of packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_xor_epi64&expand=6149)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpxorq))]
+pub unsafe fn _mm512_mask_xor_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let xor = _mm512_xor_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, xor, src.as_i64x8()))
+}
+
+/// Compute the bitwise XOR of packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_xor_epi64&expand=6150)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpxorq))]
+pub unsafe fn _mm512_maskz_xor_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let xor = _mm512_xor_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, xor, zero))
+}
+
+/// Compute the bitwise XOR of packed 64-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_xor_epi64&expand=6148)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vxor))] //should be vpxorq
+pub unsafe fn _mm256_xor_epi64(a: __m256i, b: __m256i) -> __m256i {
+ transmute(simd_xor(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compute the bitwise XOR of packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_xor_epi64&expand=6146)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpxorq))]
+pub unsafe fn _mm256_mask_xor_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let xor = _mm256_xor_epi64(a, b).as_i64x4();
+ transmute(simd_select_bitmask(k, xor, src.as_i64x4()))
+}
+
+/// Compute the bitwise XOR of packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_xor_epi64&expand=6147)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpxorq))]
+pub unsafe fn _mm256_maskz_xor_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let xor = _mm256_xor_epi64(a, b).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, xor, zero))
+}
+
+/// Compute the bitwise XOR of packed 64-bit integers in a and b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_xor_epi64&expand=6145)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vxor))] //should be vpxorq
+pub unsafe fn _mm_xor_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_xor(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Compute the bitwise XOR of packed 64-bit integers in a and b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_xor_epi64&expand=6143)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpxorq))]
+pub unsafe fn _mm_mask_xor_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let xor = _mm_xor_epi64(a, b).as_i64x2();
+ transmute(simd_select_bitmask(k, xor, src.as_i64x2()))
+}
+
+/// Compute the bitwise XOR of packed 64-bit integers in a and b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_xor_epi64&expand=6144)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpxorq))]
+pub unsafe fn _mm_maskz_xor_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let xor = _mm_xor_epi64(a, b).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, xor, zero))
+}
+
+/// Compute the bitwise XOR of 512 bits (representing integer data) in a and b, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_xor_si512&expand=6172)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpxorq))]
+pub unsafe fn _mm512_xor_si512(a: __m512i, b: __m512i) -> __m512i {
+ transmute(simd_xor(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compute the bitwise NOT of packed 32-bit integers in a and then AND with b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_andnot_epi32&expand=310)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandnq))] //should be vpandnd
+pub unsafe fn _mm512_andnot_epi32(a: __m512i, b: __m512i) -> __m512i {
+ _mm512_and_epi32(_mm512_xor_epi32(a, _mm512_set1_epi32(u32::MAX as i32)), b)
+}
+
+/// Compute the bitwise NOT of packed 32-bit integers in a and then AND with b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_andnot_epi32&expand=311)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandnd))]
+pub unsafe fn _mm512_mask_andnot_epi32(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let andnot = _mm512_andnot_epi32(a, b).as_i32x16();
+ transmute(simd_select_bitmask(k, andnot, src.as_i32x16()))
+}
+
+/// Compute the bitwise NOT of packed 32-bit integers in a and then AND with b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_andnot_epi32&expand=312)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandnd))]
+pub unsafe fn _mm512_maskz_andnot_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i {
+ let andnot = _mm512_andnot_epi32(a, b).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, andnot, zero))
+}
+
+/// Compute the bitwise NOT of packed 32-bit integers in a and then AND with b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_andnot_epi32&expand=308)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandnd))]
+pub unsafe fn _mm256_mask_andnot_epi32(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let not = _mm256_xor_epi32(a, _mm256_set1_epi32(u32::MAX as i32));
+ let andnot = simd_and(not.as_i32x8(), b.as_i32x8());
+ transmute(simd_select_bitmask(k, andnot, src.as_i32x8()))
+}
+
+/// Compute the bitwise NOT of packed 32-bit integers in a and then AND with b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_andnot_epi32&expand=309)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandnd))]
+pub unsafe fn _mm256_maskz_andnot_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let not = _mm256_xor_epi32(a, _mm256_set1_epi32(u32::MAX as i32));
+ let andnot = simd_and(not.as_i32x8(), b.as_i32x8());
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, andnot, zero))
+}
+
+/// Compute the bitwise NOT of packed 32-bit integers in a and then AND with b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_andnot_epi32&expand=306)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandnd))]
+pub unsafe fn _mm_mask_andnot_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let not = _mm_xor_epi32(a, _mm_set1_epi32(u32::MAX as i32));
+ let andnot = simd_and(not.as_i32x4(), b.as_i32x4());
+ transmute(simd_select_bitmask(k, andnot, src.as_i32x4()))
+}
+
+/// Compute the bitwise NOT of packed 32-bit integers in a and then AND with b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_andnot_epi32&expand=307)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandnd))]
+pub unsafe fn _mm_maskz_andnot_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let not = _mm_xor_epi32(a, _mm_set1_epi32(u32::MAX as i32));
+ let andnot = simd_and(not.as_i32x4(), b.as_i32x4());
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, andnot, zero))
+}
+
+/// Compute the bitwise NOT of 512 bits (composed of packed 64-bit integers) in a and then AND with b, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_andnot_epi64&expand=317)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandnq))] //should be vpandnd
+pub unsafe fn _mm512_andnot_epi64(a: __m512i, b: __m512i) -> __m512i {
+ _mm512_and_epi64(_mm512_xor_epi64(a, _mm512_set1_epi64(u64::MAX as i64)), b)
+}
+
+/// Compute the bitwise NOT of packed 64-bit integers in a and then AND with b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_andnot_epi64&expand=318)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandnq))]
+pub unsafe fn _mm512_mask_andnot_epi64(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let andnot = _mm512_andnot_epi64(a, b).as_i64x8();
+ transmute(simd_select_bitmask(k, andnot, src.as_i64x8()))
+}
+
+/// Compute the bitwise NOT of packed 64-bit integers in a and then AND with b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_andnot_epi64&expand=319)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandnq))]
+pub unsafe fn _mm512_maskz_andnot_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i {
+ let andnot = _mm512_andnot_epi64(a, b).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, andnot, zero))
+}
+
+/// Compute the bitwise NOT of packed 64-bit integers in a and then AND with b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_andnot_epi64&expand=315)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandnq))]
+pub unsafe fn _mm256_mask_andnot_epi64(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let not = _mm256_xor_epi64(a, _mm256_set1_epi64x(u64::MAX as i64));
+ let andnot = simd_and(not.as_i64x4(), b.as_i64x4());
+ transmute(simd_select_bitmask(k, andnot, src.as_i64x4()))
+}
+
+/// Compute the bitwise NOT of packed 64-bit integers in a and then AND with b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_andnot_epi64&expand=316)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandnq))]
+pub unsafe fn _mm256_maskz_andnot_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i {
+ let not = _mm256_xor_epi64(a, _mm256_set1_epi64x(u64::MAX as i64));
+ let andnot = simd_and(not.as_i64x4(), b.as_i64x4());
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, andnot, zero))
+}
+
+/// Compute the bitwise NOT of packed 64-bit integers in a and then AND with b, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_andnot_epi64&expand=313)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandnq))]
+pub unsafe fn _mm_mask_andnot_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let not = _mm_xor_epi64(a, _mm_set1_epi64x(u64::MAX as i64));
+ let andnot = simd_and(not.as_i64x2(), b.as_i64x2());
+ transmute(simd_select_bitmask(k, andnot, src.as_i64x2()))
+}
+
+/// Compute the bitwise NOT of packed 64-bit integers in a and then AND with b, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_andnot_epi64&expand=314)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpandnq))]
+pub unsafe fn _mm_maskz_andnot_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i {
+ let not = _mm_xor_epi64(a, _mm_set1_epi64x(u64::MAX as i64));
+ let andnot = simd_and(not.as_i64x2(), b.as_i64x2());
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, andnot, zero))
+}
+
+/// Compute the bitwise NOT of 512 bits (representing integer data) in a and then AND with b, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_andnot_si512&expand=340)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpandnq))]
+pub unsafe fn _mm512_andnot_si512(a: __m512i, b: __m512i) -> __m512i {
+ _mm512_and_epi64(_mm512_xor_epi64(a, _mm512_set1_epi64(u64::MAX as i64)), b)
+}
+
+/// Compute the bitwise AND of 16-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=kand_mask16&expand=3212)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(and))] // generate normal and code instead of kandw
+pub unsafe fn _kand_mask16(a: __mmask16, b: __mmask16) -> __mmask16 {
+ transmute(a & b)
+}
+
+/// Compute the bitwise AND of 16-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_kand&expand=3210)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(and))] // generate normal and code instead of kandw
+pub unsafe fn _mm512_kand(a: __mmask16, b: __mmask16) -> __mmask16 {
+ transmute(a & b)
+}
+
+/// Compute the bitwise OR of 16-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=kor_mask16&expand=3239)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(or))] // generate normal or code instead of korw
+pub unsafe fn _kor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 {
+ transmute(a | b)
+}
+
+/// Compute the bitwise OR of 16-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_kor&expand=3237)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(or))] // generate normal or code instead of korw
+pub unsafe fn _mm512_kor(a: __mmask16, b: __mmask16) -> __mmask16 {
+ transmute(a | b)
+}
+
+/// Compute the bitwise XOR of 16-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=kxor_mask16&expand=3291)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(xor))] // generate normal xor code instead of kxorw
+pub unsafe fn _kxor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 {
+ transmute(a ^ b)
+}
+
+/// Compute the bitwise XOR of 16-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_kxor&expand=3289)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(xor))] // generate normal xor code instead of kxorw
+pub unsafe fn _mm512_kxor(a: __mmask16, b: __mmask16) -> __mmask16 {
+ transmute(a ^ b)
+}
+
+/// Compute the bitwise NOT of 16-bit mask a, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=knot_mask16&expand=3233)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _knot_mask16(a: __mmask16) -> __mmask16 {
+ transmute(a ^ 0b11111111_11111111)
+}
+
+/// Compute the bitwise NOT of 16-bit mask a, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_knot&expand=3231)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_knot(a: __mmask16) -> __mmask16 {
+ transmute(a ^ 0b11111111_11111111)
+}
+
+/// Compute the bitwise NOT of 16-bit masks a and then AND with b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=kandn_mask16&expand=3218)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(not))] // generate normal and, not code instead of kandnw
+pub unsafe fn _kandn_mask16(a: __mmask16, b: __mmask16) -> __mmask16 {
+ _mm512_kand(_mm512_knot(a), b)
+}
+
+/// Compute the bitwise NOT of 16-bit masks a and then AND with b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_kandn&expand=3216)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(not))] // generate normal and code instead of kandw
+pub unsafe fn _mm512_kandn(a: __mmask16, b: __mmask16) -> __mmask16 {
+ _mm512_kand(_mm512_knot(a), b)
+}
+
+/// Compute the bitwise XNOR of 16-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=kxnor_mask16&expand=3285)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(xor))] // generate normal xor, not code instead of kxnorw
+pub unsafe fn _kxnor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 {
+ _mm512_knot(_mm512_kxor(a, b))
+}
+
+/// Compute the bitwise XNOR of 16-bit masks a and b, and store the result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_kxnor&expand=3283)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(xor))] // generate normal and code instead of kandw
+pub unsafe fn _mm512_kxnor(a: __mmask16, b: __mmask16) -> __mmask16 {
+ _mm512_knot(_mm512_kxor(a, b))
+}
+
+/// Copy 16-bit mask a to k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm512_kmov&expand=3228)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kmovw
+pub unsafe fn _mm512_kmov(a: __mmask16) -> __mmask16 {
+ let r: u16 = a;
+ transmute(r)
+}
+
+/// Converts integer mask into bitmask, storing the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_int2mask&expand=3189)
+#[inline]
+#[target_feature(enable = "avx512f")] // generate normal and code instead of kmovw
+pub unsafe fn _mm512_int2mask(mask: i32) -> __mmask16 {
+ let r: u16 = mask as u16;
+ transmute(r)
+}
+
+/// Converts bit mask k1 into an integer value, storing the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_mask2int&expand=3544)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kmovw
+pub unsafe fn _mm512_mask2int(k1: __mmask16) -> i32 {
+ let r: i32 = k1 as i32;
+ transmute(r)
+}
+
+/// Unpack and interleave 8 bits from masks a and b, and store the 16-bit result in k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_kunpackb&expand=3280)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kunpckbw
+pub unsafe fn _mm512_kunpackb(a: __mmask16, b: __mmask16) -> __mmask16 {
+ let a = a & 0b00000000_11111111;
+ let b = b & 0b11111111_00000000;
+ transmute(a | b)
+}
+
+/// Performs bitwise OR between k1 and k2, storing the result in dst. CF flag is set if dst consists of all 1's.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_kortestc&expand=3247)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(cmp))] // generate normal and code instead of kortestw
+pub unsafe fn _mm512_kortestc(a: __mmask16, b: __mmask16) -> i32 {
+ let r = a | b;
+ if r == 0b11111111_11111111 {
+ 1
+ } else {
+ 0
+ }
+}
+
+/// Compute the bitwise AND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_test_epi32_mask&expand=5890)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vptestmd))]
+pub unsafe fn _mm512_test_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ let and = _mm512_and_epi32(a, b);
+ let zero = _mm512_setzero_si512();
+ _mm512_cmpneq_epi32_mask(and, zero)
+}
+
+/// Compute the bitwise AND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_test_epi32_mask&expand=5889)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vptestmd))]
+pub unsafe fn _mm512_mask_test_epi32_mask(k: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ let and = _mm512_and_epi32(a, b);
+ let zero = _mm512_setzero_si512();
+ _mm512_mask_cmpneq_epi32_mask(k, and, zero)
+}
+
+/// Compute the bitwise AND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_test_epi32_mask&expand=5888)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestmd))]
+pub unsafe fn _mm256_test_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ let and = _mm256_and_si256(a, b);
+ let zero = _mm256_setzero_si256();
+ _mm256_cmpneq_epi32_mask(and, zero)
+}
+
+/// Compute the bitwise AND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_test_epi32_mask&expand=5887)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestmd))]
+pub unsafe fn _mm256_mask_test_epi32_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ let and = _mm256_and_si256(a, b);
+ let zero = _mm256_setzero_si256();
+ _mm256_mask_cmpneq_epi32_mask(k, and, zero)
+}
+
+/// Compute the bitwise AND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_test_epi32_mask&expand=5886)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestmd))]
+pub unsafe fn _mm_test_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ let and = _mm_and_si128(a, b);
+ let zero = _mm_setzero_si128();
+ _mm_cmpneq_epi32_mask(and, zero)
+}
+
+/// Compute the bitwise AND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_test_epi32_mask&expand=5885)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestmd))]
+pub unsafe fn _mm_mask_test_epi32_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ let and = _mm_and_si128(a, b);
+ let zero = _mm_setzero_si128();
+ _mm_mask_cmpneq_epi32_mask(k, and, zero)
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_test_epi64_mask&expand=5896)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vptestmq))]
+pub unsafe fn _mm512_test_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ let and = _mm512_and_epi64(a, b);
+ let zero = _mm512_setzero_si512();
+ _mm512_cmpneq_epi64_mask(and, zero)
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_test_epi64_mask&expand=5895)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vptestmq))]
+pub unsafe fn _mm512_mask_test_epi64_mask(k: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ let and = _mm512_and_epi64(a, b);
+ let zero = _mm512_setzero_si512();
+ _mm512_mask_cmpneq_epi64_mask(k, and, zero)
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_test_epi64_mask&expand=5894)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestmq))]
+pub unsafe fn _mm256_test_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ let and = _mm256_and_si256(a, b);
+ let zero = _mm256_setzero_si256();
+ _mm256_cmpneq_epi64_mask(and, zero)
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_test_epi64_mask&expand=5893)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestmq))]
+pub unsafe fn _mm256_mask_test_epi64_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ let and = _mm256_and_si256(a, b);
+ let zero = _mm256_setzero_si256();
+ _mm256_mask_cmpneq_epi64_mask(k, and, zero)
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_test_epi64_mask&expand=5892)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestmq))]
+pub unsafe fn _mm_test_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ let and = _mm_and_si128(a, b);
+ let zero = _mm_setzero_si128();
+ _mm_cmpneq_epi64_mask(and, zero)
+}
+
+/// Compute the bitwise AND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_test_epi64_mask&expand=5891)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestmq))]
+pub unsafe fn _mm_mask_test_epi64_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ let and = _mm_and_si128(a, b);
+ let zero = _mm_setzero_si128();
+ _mm_mask_cmpneq_epi64_mask(k, and, zero)
+}
+
+/// Compute the bitwise NAND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_testn_epi32_mask&expand=5921)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vptestnmd))]
+pub unsafe fn _mm512_testn_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ let and = _mm512_and_epi32(a, b);
+ let zero = _mm512_setzero_si512();
+ _mm512_cmpeq_epi32_mask(and, zero)
+}
+
+/// Compute the bitwise NAND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_testn_epi32_mask&expand=5920)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vptestnmd))]
+pub unsafe fn _mm512_mask_testn_epi32_mask(k: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ let and = _mm512_and_epi32(a, b);
+ let zero = _mm512_setzero_si512();
+ _mm512_mask_cmpeq_epi32_mask(k, and, zero)
+}
+
+/// Compute the bitwise NAND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testn_epi32_mask&expand=5919)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestnmd))]
+pub unsafe fn _mm256_testn_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ let and = _mm256_and_si256(a, b);
+ let zero = _mm256_setzero_si256();
+ _mm256_cmpeq_epi32_mask(and, zero)
+}
+
+/// Compute the bitwise NAND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_testn_epi32_mask&expand=5918)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestnmd))]
+pub unsafe fn _mm256_mask_testn_epi32_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ let and = _mm256_and_si256(a, b);
+ let zero = _mm256_setzero_si256();
+ _mm256_mask_cmpeq_epi32_mask(k, and, zero)
+}
+
+/// Compute the bitwise NAND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testn_epi32_mask&expand=5917)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestnmd))]
+pub unsafe fn _mm_testn_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ let and = _mm_and_si128(a, b);
+ let zero = _mm_setzero_si128();
+ _mm_cmpeq_epi32_mask(and, zero)
+}
+
+/// Compute the bitwise NAND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_testn_epi32_mask&expand=5916)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestnmd))]
+pub unsafe fn _mm_mask_testn_epi32_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ let and = _mm_and_si128(a, b);
+ let zero = _mm_setzero_si128();
+ _mm_mask_cmpeq_epi32_mask(k, and, zero)
+}
+
+/// Compute the bitwise NAND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_testn_epi64_mask&expand=5927)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vptestnmq))]
+pub unsafe fn _mm512_testn_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ let and = _mm512_and_epi64(a, b);
+ let zero = _mm512_setzero_si512();
+ _mm512_cmpeq_epi64_mask(and, zero)
+}
+
+/// Compute the bitwise NAND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_testn_epi64_mask&expand=5926)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vptestnmq))]
+pub unsafe fn _mm512_mask_testn_epi64_mask(k: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ let and = _mm512_and_epi64(a, b);
+ let zero = _mm512_setzero_si512();
+ _mm512_mask_cmpeq_epi64_mask(k, and, zero)
+}
+
+/// Compute the bitwise NAND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_testn_epi64_mask&expand=5925)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestnmq))]
+pub unsafe fn _mm256_testn_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ let and = _mm256_and_si256(a, b);
+ let zero = _mm256_setzero_si256();
+ _mm256_cmpeq_epi64_mask(and, zero)
+}
+
+/// Compute the bitwise NAND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_testn_epi64_mask&expand=5924)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestnmq))]
+pub unsafe fn _mm256_mask_testn_epi64_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ let and = _mm256_and_si256(a, b);
+ let zero = _mm256_setzero_si256();
+ _mm256_mask_cmpeq_epi64_mask(k, and, zero)
+}
+
+/// Compute the bitwise NAND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testn_epi64_mask&expand=5923)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestnmq))]
+pub unsafe fn _mm_testn_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ let and = _mm_and_si128(a, b);
+ let zero = _mm_setzero_si128();
+ _mm_cmpeq_epi64_mask(and, zero)
+}
+
+/// Compute the bitwise NAND of packed 64-bit integers in a and b, producing intermediate 64-bit values, and set the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_testn_epi64_mask&expand=5922)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vptestnmq))]
+pub unsafe fn _mm_mask_testn_epi64_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ let and = _mm_and_si128(a, b);
+ let zero = _mm_setzero_si128();
+ _mm_mask_cmpeq_epi64_mask(k, and, zero)
+}
+
+/// Store 512-bits (composed of 16 packed single-precision (32-bit) floating-point elements) from a into memory using a non-temporal memory hint. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_stream_ps&expand=5671)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovntps))]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm512_stream_ps(mem_addr: *mut f32, a: __m512) {
+ intrinsics::nontemporal_store(mem_addr as *mut __m512, a);
+}
+
+/// Store 512-bits (composed of 8 packed double-precision (64-bit) floating-point elements) from a into memory using a non-temporal memory hint. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_stream_pd&expand=5667)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovntps))] //should be vmovntpd
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm512_stream_pd(mem_addr: *mut f64, a: __m512d) {
+ intrinsics::nontemporal_store(mem_addr as *mut __m512d, a);
+}
+
+/// Store 512-bits of integer data from a into memory using a non-temporal memory hint. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_stream_si512&expand=5675)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovntps))] //should be vmovntdq
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm512_stream_si512(mem_addr: *mut i64, a: __m512i) {
+ intrinsics::nontemporal_store(mem_addr as *mut __m512i, a);
+}
+
+/// Sets packed 32-bit integers in `dst` with the supplied values.
+///
+/// [Intel's documentation]( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set_ps&expand=4931)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set_ps(
+ e0: f32,
+ e1: f32,
+ e2: f32,
+ e3: f32,
+ e4: f32,
+ e5: f32,
+ e6: f32,
+ e7: f32,
+ e8: f32,
+ e9: f32,
+ e10: f32,
+ e11: f32,
+ e12: f32,
+ e13: f32,
+ e14: f32,
+ e15: f32,
+) -> __m512 {
+ _mm512_setr_ps(
+ e15, e14, e13, e12, e11, e10, e9, e8, e7, e6, e5, e4, e3, e2, e1, e0,
+ )
+}
+
+/// Sets packed 32-bit integers in `dst` with the supplied values in
+/// reverse order.
+///
+/// [Intel's documentation]( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setr_ps&expand=5008)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_setr_ps(
+ e0: f32,
+ e1: f32,
+ e2: f32,
+ e3: f32,
+ e4: f32,
+ e5: f32,
+ e6: f32,
+ e7: f32,
+ e8: f32,
+ e9: f32,
+ e10: f32,
+ e11: f32,
+ e12: f32,
+ e13: f32,
+ e14: f32,
+ e15: f32,
+) -> __m512 {
+ let r = f32x16::new(
+ e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15,
+ );
+ transmute(r)
+}
+
+/// Broadcast 64-bit float `a` to all elements of `dst`.
+///
+/// [Intel's documentation]( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set1_pd&expand=4975)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set1_pd(a: f64) -> __m512d {
+ transmute(f64x8::splat(a))
+}
+
+/// Broadcast 32-bit float `a` to all elements of `dst`.
+///
+/// [Intel's documentation]( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set1_ps&expand=4981)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set1_ps(a: f32) -> __m512 {
+ transmute(f32x16::splat(a))
+}
+
+/// Sets packed 32-bit integers in `dst` with the supplied values.
+///
+/// [Intel's documentation]( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set_epi32&expand=4908)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set_epi32(
+ e15: i32,
+ e14: i32,
+ e13: i32,
+ e12: i32,
+ e11: i32,
+ e10: i32,
+ e9: i32,
+ e8: i32,
+ e7: i32,
+ e6: i32,
+ e5: i32,
+ e4: i32,
+ e3: i32,
+ e2: i32,
+ e1: i32,
+ e0: i32,
+) -> __m512i {
+ _mm512_setr_epi32(
+ e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15,
+ )
+}
+
+/// Broadcast 8-bit integer a to all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set1_epi8&expand=4972)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set1_epi8(a: i8) -> __m512i {
+ transmute(i8x64::splat(a))
+}
+
+/// Broadcast the low packed 16-bit integer from a to all all elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set1_epi16&expand=4944)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set1_epi16(a: i16) -> __m512i {
+ transmute(i16x32::splat(a))
+}
+
+/// Broadcast 32-bit integer `a` to all elements of `dst`.
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set1_epi32(a: i32) -> __m512i {
+ transmute(i32x16::splat(a))
+}
+
+/// Broadcast 32-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_set1_epi32&expand=4951)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpbroadcastd))]
+pub unsafe fn _mm512_mask_set1_epi32(src: __m512i, k: __mmask16, a: i32) -> __m512i {
+ let r = _mm512_set1_epi32(a).as_i32x16();
+ transmute(simd_select_bitmask(k, r, src.as_i32x16()))
+}
+
+/// Broadcast 32-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_set1_epi32&expand=4952)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpbroadcastd))]
+pub unsafe fn _mm512_maskz_set1_epi32(k: __mmask16, a: i32) -> __m512i {
+ let r = _mm512_set1_epi32(a).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Broadcast 32-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_set1_epi32&expand=4948)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastd))]
+pub unsafe fn _mm256_mask_set1_epi32(src: __m256i, k: __mmask8, a: i32) -> __m256i {
+ let r = _mm256_set1_epi32(a).as_i32x8();
+ transmute(simd_select_bitmask(k, r, src.as_i32x8()))
+}
+
+/// Broadcast 32-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_set1_epi32&expand=4949)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastd))]
+pub unsafe fn _mm256_maskz_set1_epi32(k: __mmask8, a: i32) -> __m256i {
+ let r = _mm256_set1_epi32(a).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Broadcast 32-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_set1_epi32&expand=4945)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastd))]
+pub unsafe fn _mm_mask_set1_epi32(src: __m128i, k: __mmask8, a: i32) -> __m128i {
+ let r = _mm_set1_epi32(a).as_i32x4();
+ transmute(simd_select_bitmask(k, r, src.as_i32x4()))
+}
+
+/// Broadcast 32-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_set1_epi32&expand=4946)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastd))]
+pub unsafe fn _mm_maskz_set1_epi32(k: __mmask8, a: i32) -> __m128i {
+ let r = _mm_set1_epi32(a).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Broadcast 64-bit integer `a` to all elements of `dst`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set1_epi64&expand=4961)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set1_epi64(a: i64) -> __m512i {
+ transmute(i64x8::splat(a))
+}
+
+/// Broadcast 64-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_set1_epi64&expand=4959)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpbroadcastq))]
+pub unsafe fn _mm512_mask_set1_epi64(src: __m512i, k: __mmask8, a: i64) -> __m512i {
+ let r = _mm512_set1_epi64(a).as_i64x8();
+ transmute(simd_select_bitmask(k, r, src.as_i64x8()))
+}
+
+/// Broadcast 64-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_set1_epi64&expand=4960)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpbroadcastq))]
+pub unsafe fn _mm512_maskz_set1_epi64(k: __mmask8, a: i64) -> __m512i {
+ let r = _mm512_set1_epi64(a).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Broadcast 64-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_set1_epi64&expand=4957)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastq))]
+pub unsafe fn _mm256_mask_set1_epi64(src: __m256i, k: __mmask8, a: i64) -> __m256i {
+ let r = _mm256_set1_epi64x(a).as_i64x4();
+ transmute(simd_select_bitmask(k, r, src.as_i64x4()))
+}
+
+/// Broadcast 64-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_set1_epi64&expand=4958)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastq))]
+pub unsafe fn _mm256_maskz_set1_epi64(k: __mmask8, a: i64) -> __m256i {
+ let r = _mm256_set1_epi64x(a).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Broadcast 64-bit integer a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_set1_epi64&expand=4954)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastq))]
+pub unsafe fn _mm_mask_set1_epi64(src: __m128i, k: __mmask8, a: i64) -> __m128i {
+ let r = _mm_set1_epi64x(a).as_i64x2();
+ transmute(simd_select_bitmask(k, r, src.as_i64x2()))
+}
+
+/// Broadcast 64-bit integer a to all elements of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_set1_epi64&expand=4955)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpbroadcastq))]
+pub unsafe fn _mm_maskz_set1_epi64(k: __mmask8, a: i64) -> __m128i {
+ let r = _mm_set1_epi64x(a).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Set packed 64-bit integers in dst with the repeated 4 element sequence.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set4_epi64&expand=4983)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set4_epi64(d: i64, c: i64, b: i64, a: i64) -> __m512i {
+ let r = i64x8::new(d, c, b, a, d, c, b, a);
+ transmute(r)
+}
+
+/// Set packed 64-bit integers in dst with the repeated 4 element sequence in reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setr4_epi64&expand=5010)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_setr4_epi64(d: i64, c: i64, b: i64, a: i64) -> __m512i {
+ let r = i64x8::new(a, b, c, d, a, b, c, d);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmplt_ps_mask&expand=1074)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_cmplt_ps_mask(a: __m512, b: __m512) -> __mmask16 {
+ _mm512_cmp_ps_mask::<_CMP_LT_OS>(a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmplt_ps_mask&expand=1075)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_mask_cmplt_ps_mask(k1: __mmask16, a: __m512, b: __m512) -> __mmask16 {
+ _mm512_mask_cmp_ps_mask::<_CMP_LT_OS>(k1, a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for not-less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpnlt_ps_mask&expand=1154)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_cmpnlt_ps_mask(a: __m512, b: __m512) -> __mmask16 {
+ _mm512_cmp_ps_mask::<_CMP_NLT_US>(a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for not-less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpnlt_ps_mask&expand=1155)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_mask_cmpnlt_ps_mask(k1: __mmask16, a: __m512, b: __m512) -> __mmask16 {
+ _mm512_mask_cmp_ps_mask::<_CMP_NLT_US>(k1, a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmple_ps_mask&expand=1013)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_cmple_ps_mask(a: __m512, b: __m512) -> __mmask16 {
+ _mm512_cmp_ps_mask::<_CMP_LE_OS>(a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmple_ps_mask&expand=1014)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_mask_cmple_ps_mask(k1: __mmask16, a: __m512, b: __m512) -> __mmask16 {
+ _mm512_mask_cmp_ps_mask::<_CMP_LE_OS>(k1, a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for not-less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpnle_ps_mask&expand=1146)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_cmpnle_ps_mask(a: __m512, b: __m512) -> __mmask16 {
+ _mm512_cmp_ps_mask::<_CMP_NLE_US>(a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for not-less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpnle_ps_mask&expand=1147)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_mask_cmpnle_ps_mask(k1: __mmask16, a: __m512, b: __m512) -> __mmask16 {
+ _mm512_mask_cmp_ps_mask::<_CMP_NLE_US>(k1, a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpeq_ps_mask&expand=828)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_cmpeq_ps_mask(a: __m512, b: __m512) -> __mmask16 {
+ _mm512_cmp_ps_mask::<_CMP_EQ_OQ>(a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpeq_ps_mask&expand=829)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_mask_cmpeq_ps_mask(k1: __mmask16, a: __m512, b: __m512) -> __mmask16 {
+ _mm512_mask_cmp_ps_mask::<_CMP_EQ_OQ>(k1, a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpneq_ps_mask&expand=1130)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_cmpneq_ps_mask(a: __m512, b: __m512) -> __mmask16 {
+ _mm512_cmp_ps_mask::<_CMP_NEQ_UQ>(a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpneq_ps_mask&expand=1131)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_mask_cmpneq_ps_mask(k1: __mmask16, a: __m512, b: __m512) -> __mmask16 {
+ _mm512_mask_cmp_ps_mask::<_CMP_NEQ_UQ>(k1, a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_ps_mask&expand=749)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm512_cmp_ps_mask<const IMM8: i32>(a: __m512, b: __m512) -> __mmask16 {
+ static_assert_imm5!(IMM8);
+ let neg_one = -1;
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vcmpps(a, b, IMM8, neg_one, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_ps_mask&expand=750)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm512_mask_cmp_ps_mask<const IMM8: i32>(
+ k1: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __mmask16 {
+ static_assert_imm5!(IMM8);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vcmpps(a, b, IMM8, k1 as i16, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_ps_mask&expand=747)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm256_cmp_ps_mask<const IMM8: i32>(a: __m256, b: __m256) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let neg_one = -1;
+ let a = a.as_f32x8();
+ let b = b.as_f32x8();
+ let r = vcmpps256(a, b, IMM8, neg_one);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmp_ps_mask&expand=748)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm256_mask_cmp_ps_mask<const IMM8: i32>(
+ k1: __mmask8,
+ a: __m256,
+ b: __m256,
+) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let a = a.as_f32x8();
+ let b = b.as_f32x8();
+ let r = vcmpps256(a, b, IMM8, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_ps_mask&expand=745)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm_cmp_ps_mask<const IMM8: i32>(a: __m128, b: __m128) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let neg_one = -1;
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let r = vcmpps128(a, b, IMM8, neg_one);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_ps_mask&expand=746)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm_mask_cmp_ps_mask<const IMM8: i32>(
+ k1: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let r = vcmpps128(a, b, IMM8, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_round_ps_mask&expand=753)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp, IMM5 = 0, SAE = 4))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm512_cmp_round_ps_mask<const IMM5: i32, const SAE: i32>(
+ a: __m512,
+ b: __m512,
+) -> __mmask16 {
+ static_assert_imm5!(IMM5);
+ static_assert_mantissas_sae!(SAE);
+ let neg_one = -1;
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vcmpps(a, b, IMM5, neg_one, SAE);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_round_ps_mask&expand=754)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp, IMM5 = 0, SAE = 4))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm512_mask_cmp_round_ps_mask<const IMM5: i32, const SAE: i32>(
+ m: __mmask16,
+ a: __m512,
+ b: __m512,
+) -> __mmask16 {
+ static_assert_imm5!(IMM5);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x16();
+ let b = b.as_f32x16();
+ let r = vcmpps(a, b, IMM5, m as i16, SAE);
+ transmute(r)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b to see if neither is NaN, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpord_ps_mask&expand=1162)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmps
+pub unsafe fn _mm512_cmpord_ps_mask(a: __m512, b: __m512) -> __mmask16 {
+ _mm512_cmp_ps_mask::<_CMP_ORD_Q>(a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b to see if neither is NaN, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpord_ps_mask&expand=1163)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_mask_cmpord_ps_mask(k1: __mmask16, a: __m512, b: __m512) -> __mmask16 {
+ _mm512_mask_cmp_ps_mask::<_CMP_ORD_Q>(k1, a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b to see if either is NaN, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpunord_ps_mask&expand=1170)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_cmpunord_ps_mask(a: __m512, b: __m512) -> __mmask16 {
+ _mm512_cmp_ps_mask::<_CMP_UNORD_Q>(a, b)
+}
+
+/// Compare packed single-precision (32-bit) floating-point elements in a and b to see if either is NaN, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpunord_ps_mask&expand=1171)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmpps
+pub unsafe fn _mm512_mask_cmpunord_ps_mask(k1: __mmask16, a: __m512, b: __m512) -> __mmask16 {
+ _mm512_mask_cmp_ps_mask::<_CMP_UNORD_Q>(k1, a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmplt_pd_mask&expand=1071)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_cmplt_pd_mask(a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_cmp_pd_mask::<_CMP_LT_OS>(a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmplt_pd_mask&expand=1072)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_mask_cmplt_pd_mask(k1: __mmask8, a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_mask_cmp_pd_mask::<_CMP_LT_OS>(k1, a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for not-less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpnlt_pd_mask&expand=1151)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_cmpnlt_pd_mask(a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_cmp_pd_mask::<_CMP_NLT_US>(a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for not-less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpnlt_pd_mask&expand=1152)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_mask_cmpnlt_pd_mask(m: __mmask8, a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_mask_cmp_pd_mask::<_CMP_NLT_US>(m, a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmple_pd_mask&expand=1010)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_cmple_pd_mask(a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_cmp_pd_mask::<_CMP_LE_OS>(a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmple_pd_mask&expand=1011)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_mask_cmple_pd_mask(k1: __mmask8, a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_mask_cmp_pd_mask::<_CMP_LE_OS>(k1, a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for not-less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpnle_pd_mask&expand=1143)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_cmpnle_pd_mask(a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_cmp_pd_mask::<_CMP_NLE_US>(a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for not-less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpnle_pd_mask&expand=1144)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_mask_cmpnle_pd_mask(k1: __mmask8, a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_mask_cmp_pd_mask::<_CMP_NLE_US>(k1, a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpeq_pd_mask&expand=822)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_cmpeq_pd_mask(a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_cmp_pd_mask::<_CMP_EQ_OQ>(a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpeq_pd_mask&expand=823)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_mask_cmpeq_pd_mask(k1: __mmask8, a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_mask_cmp_pd_mask::<_CMP_EQ_OQ>(k1, a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpneq_pd_mask&expand=1127)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_cmpneq_pd_mask(a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_cmp_pd_mask::<_CMP_NEQ_UQ>(a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpneq_pd_mask&expand=1128)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_mask_cmpneq_pd_mask(k1: __mmask8, a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_mask_cmp_pd_mask::<_CMP_NEQ_UQ>(k1, a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_pd_mask&expand=741)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm512_cmp_pd_mask<const IMM8: i32>(a: __m512d, b: __m512d) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let neg_one = -1;
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vcmppd(a, b, IMM8, neg_one, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_pd_mask&expand=742)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm512_mask_cmp_pd_mask<const IMM8: i32>(
+ k1: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vcmppd(a, b, IMM8, k1 as i8, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_pd_mask&expand=739)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm256_cmp_pd_mask<const IMM8: i32>(a: __m256d, b: __m256d) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let neg_one = -1;
+ let a = a.as_f64x4();
+ let b = b.as_f64x4();
+ let r = vcmppd256(a, b, IMM8, neg_one);
+ transmute(r)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmp_pd_mask&expand=740)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm256_mask_cmp_pd_mask<const IMM8: i32>(
+ k1: __mmask8,
+ a: __m256d,
+ b: __m256d,
+) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let a = a.as_f64x4();
+ let b = b.as_f64x4();
+ let r = vcmppd256(a, b, IMM8, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_pd_mask&expand=737)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm_cmp_pd_mask<const IMM8: i32>(a: __m128d, b: __m128d) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let neg_one = -1;
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let r = vcmppd128(a, b, IMM8, neg_one);
+ transmute(r)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_pd_mask&expand=738)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm_mask_cmp_pd_mask<const IMM8: i32>(
+ k1: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let r = vcmppd128(a, b, IMM8, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_round_pd_mask&expand=751)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp, IMM5 = 0, SAE = 4))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm512_cmp_round_pd_mask<const IMM5: i32, const SAE: i32>(
+ a: __m512d,
+ b: __m512d,
+) -> __mmask8 {
+ static_assert_imm5!(IMM5);
+ static_assert_mantissas_sae!(SAE);
+ let neg_one = -1;
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vcmppd(a, b, IMM5, neg_one, SAE);
+ transmute(r)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_round_pd_mask&expand=752)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp, IMM5 = 0, SAE = 4))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm512_mask_cmp_round_pd_mask<const IMM5: i32, const SAE: i32>(
+ k1: __mmask8,
+ a: __m512d,
+ b: __m512d,
+) -> __mmask8 {
+ static_assert_imm5!(IMM5);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x8();
+ let b = b.as_f64x8();
+ let r = vcmppd(a, b, IMM5, k1 as i8, SAE);
+ transmute(r)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b to see if neither is NaN, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpord_pd_mask&expand=1159)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_cmpord_pd_mask(a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_cmp_pd_mask::<_CMP_ORD_Q>(a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b to see if neither is NaN, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpord_pd_mask&expand=1160)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_mask_cmpord_pd_mask(k1: __mmask8, a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_mask_cmp_pd_mask::<_CMP_ORD_Q>(k1, a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b to see if either is NaN, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpunord_pd_mask&expand=1167)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_cmpunord_pd_mask(a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_cmp_pd_mask::<_CMP_UNORD_Q>(a, b)
+}
+
+/// Compare packed double-precision (64-bit) floating-point elements in a and b to see if either is NaN, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpunord_pd_mask&expand=1168)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp))] //should be vcmppd
+pub unsafe fn _mm512_mask_cmpunord_pd_mask(k1: __mmask8, a: __m512d, b: __m512d) -> __mmask8 {
+ _mm512_mask_cmp_pd_mask::<_CMP_UNORD_Q>(k1, a, b)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point element in a and b based on the comparison operand specified by imm8, and store the result in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_ss_mask&expand=763)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm_cmp_ss_mask<const IMM8: i32>(a: __m128, b: __m128) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let neg_one = -1;
+ let r = vcmpss(a, b, IMM8, neg_one, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point element in a and b based on the comparison operand specified by imm8, and store the result in mask vector k using zeromask k1 (the element is zeroed out when mask bit 0 is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_ss_mask&expand=764)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm_mask_cmp_ss_mask<const IMM8: i32>(
+ k1: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let r = vcmpss(a, b, IMM8, k1 as i8, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point element in a and b based on the comparison operand specified by imm8, and store the result in mask vector k.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_round_ss_mask&expand=757)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp, IMM5 = 0, SAE = 4))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm_cmp_round_ss_mask<const IMM5: i32, const SAE: i32>(
+ a: __m128,
+ b: __m128,
+) -> __mmask8 {
+ static_assert_imm5!(IMM5);
+ static_assert_mantissas_sae!(SAE);
+ let neg_one = -1;
+ let r = vcmpss(a, b, IMM5, neg_one, SAE);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point element in a and b based on the comparison operand specified by imm8, and store the result in mask vector k using zeromask k1 (the element is zeroed out when mask bit 0 is not seti).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_round_ss_mask&expand=758)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp, IMM5 = 0, SAE = 4))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm_mask_cmp_round_ss_mask<const IMM5: i32, const SAE: i32>(
+ k1: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __mmask8 {
+ static_assert_imm5!(IMM5);
+ static_assert_mantissas_sae!(SAE);
+ let r = vcmpss(a, b, IMM5, k1 as i8, SAE);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point element in a and b based on the comparison operand specified by imm8, and store the result in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_sd_mask&expand=760)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm_cmp_sd_mask<const IMM8: i32>(a: __m128d, b: __m128d) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let neg_one = -1;
+ let r = vcmpsd(a, b, IMM8, neg_one, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point element in a and b based on the comparison operand specified by imm8, and store the result in mask vector k using zeromask k1 (the element is zeroed out when mask bit 0 is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_sd_mask&expand=761)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vcmp, IMM8 = 0))]
+pub unsafe fn _mm_mask_cmp_sd_mask<const IMM8: i32>(
+ k1: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __mmask8 {
+ static_assert_imm5!(IMM8);
+ let r = vcmpsd(a, b, IMM8, k1 as i8, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point element in a and b based on the comparison operand specified by imm8, and store the result in mask vector k.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_round_sd_mask&expand=755)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp, IMM5 = 0, SAE = 4))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm_cmp_round_sd_mask<const IMM5: i32, const SAE: i32>(
+ a: __m128d,
+ b: __m128d,
+) -> __mmask8 {
+ static_assert_imm5!(IMM5);
+ static_assert_mantissas_sae!(SAE);
+ let neg_one = -1;
+ let r = vcmpsd(a, b, IMM5, neg_one, SAE);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point element in a and b based on the comparison operand specified by imm8, and store the result in mask vector k using zeromask k1 (the element is zeroed out when mask bit 0 is not set).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_round_sd_mask&expand=756)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp, IMM5 = 0, SAE = 4))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm_mask_cmp_round_sd_mask<const IMM5: i32, const SAE: i32>(
+ k1: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __mmask8 {
+ static_assert_imm5!(IMM5);
+ static_assert_mantissas_sae!(SAE);
+ let r = vcmpsd(a, b, IMM5, k1 as i8, SAE);
+ transmute(r)
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmplt_epu32_mask&expand=1056)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_cmplt_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<u32x16, _>(simd_lt(a.as_u32x16(), b.as_u32x16()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmplt_epu32_mask&expand=1057)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_mask_cmplt_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmplt_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmplt_epu32_mask&expand=1054)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_cmplt_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<u32x8, _>(simd_lt(a.as_u32x8(), b.as_u32x8()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmplt_epu32_mask&expand=1055)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_mask_cmplt_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmplt_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epu32_mask&expand=1052)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_cmplt_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<u32x4, _>(simd_lt(a.as_u32x4(), b.as_u32x4()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmplt_epu32_mask&expand=1053)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_mask_cmplt_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmplt_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpgt_epu32_mask&expand=933)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_cmpgt_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<u32x16, _>(simd_gt(a.as_u32x16(), b.as_u32x16()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpgt_epu32_mask&expand=934)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_mask_cmpgt_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmpgt_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epu32_mask&expand=931)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_cmpgt_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<u32x8, _>(simd_gt(a.as_u32x8(), b.as_u32x8()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpgt_epu32_mask&expand=932)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_mask_cmpgt_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpgt_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epu32_mask&expand=929)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_cmpgt_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<u32x4, _>(simd_gt(a.as_u32x4(), b.as_u32x4()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpgt_epu32_mask&expand=930)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_mask_cmpgt_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpgt_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmple_epu32_mask&expand=995)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_cmple_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<u32x16, _>(simd_le(a.as_u32x16(), b.as_u32x16()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmple_epu32_mask&expand=996)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_mask_cmple_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmple_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmple_epu32_mask&expand=993)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_cmple_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<u32x8, _>(simd_le(a.as_u32x8(), b.as_u32x8()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmple_epu32_mask&expand=994)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_mask_cmple_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmple_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_epu32_mask&expand=991)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_cmple_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<u32x4, _>(simd_le(a.as_u32x4(), b.as_u32x4()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmple_epu32_mask&expand=992)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_mask_cmple_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmple_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpge_epu32_mask&expand=873)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_cmpge_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<u32x16, _>(simd_ge(a.as_u32x16(), b.as_u32x16()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpge_epu32_mask&expand=874)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_mask_cmpge_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmpge_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpge_epu32_mask&expand=871)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_cmpge_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<u32x8, _>(simd_ge(a.as_u32x8(), b.as_u32x8()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpge_epu32_mask&expand=872)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_mask_cmpge_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpge_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_epu32_mask&expand=869)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_cmpge_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<u32x4, _>(simd_ge(a.as_u32x4(), b.as_u32x4()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpge_epu32_mask&expand=870)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_mask_cmpge_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpge_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpeq_epu32_mask&expand=807)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_cmpeq_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<u32x16, _>(simd_eq(a.as_u32x16(), b.as_u32x16()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpeq_epu32_mask&expand=808)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_mask_cmpeq_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmpeq_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epu32_mask&expand=805)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_cmpeq_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<u32x8, _>(simd_eq(a.as_u32x8(), b.as_u32x8()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpeq_epu32_mask&expand=806)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_mask_cmpeq_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpeq_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epu32_mask&expand=803)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_cmpeq_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<u32x4, _>(simd_eq(a.as_u32x4(), b.as_u32x4()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpeq_epu32_mask&expand=804)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_mask_cmpeq_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpeq_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpneq_epu32_mask&expand=1112)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_cmpneq_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<u32x16, _>(simd_ne(a.as_u32x16(), b.as_u32x16()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpneq_epu32_mask&expand=1113)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm512_mask_cmpneq_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmpneq_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpneq_epu32_mask&expand=1110)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_cmpneq_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<u32x8, _>(simd_ne(a.as_u32x8(), b.as_u32x8()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpneq_epu32_mask&expand=1111)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm256_mask_cmpneq_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpneq_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_epu32_mask&expand=1108)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_cmpneq_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<u32x4, _>(simd_ne(a.as_u32x4(), b.as_u32x4()))
+}
+
+/// Compare packed unsigned 32-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpneq_epu32_mask&expand=1109)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud
+pub unsafe fn _mm_mask_cmpneq_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpneq_epu32_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_epu32_mask&expand=721)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm512_cmp_epu32_mask<const IMM3: _MM_CMPINT_ENUM>(
+ a: __m512i,
+ b: __m512i,
+) -> __mmask16 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ let r = vpcmpud(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed unsigned 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_epu32_mask&expand=722)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm512_mask_cmp_epu32_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __mmask16 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ let r = vpcmpud(a, b, IMM3, k1 as i16);
+ transmute(r)
+}
+
+/// Compare packed unsigned 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_epu32_mask&expand=719)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm256_cmp_epu32_mask<const IMM3: _MM_CMPINT_ENUM>(
+ a: __m256i,
+ b: __m256i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i32x8();
+ let b = b.as_i32x8();
+ let r = vpcmpud256(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed unsigned 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmp_epu32_mask&expand=720)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm256_mask_cmp_epu32_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i32x8();
+ let b = b.as_i32x8();
+ let r = vpcmpud256(a, b, IMM3, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed unsigned 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_epu32_mask&expand=717)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm_cmp_epu32_mask<const IMM3: _MM_CMPINT_ENUM>(a: __m128i, b: __m128i) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ let r = vpcmpud128(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed unsigned 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_epu32_mask&expand=718)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm_mask_cmp_epu32_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ let r = vpcmpud128(a, b, IMM3, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmplt_epi32_mask&expand=1029)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_cmplt_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<i32x16, _>(simd_lt(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmplt_epi32_mask&expand=1031)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_mask_cmplt_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmplt_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmplt_epi32_mask&expand=1027)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_cmplt_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<i32x8, _>(simd_lt(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmplt_epi32_mask&expand=1028)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_mask_cmplt_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmplt_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epi32_mask&expand=1025)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_cmplt_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<i32x4, _>(simd_lt(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmplt_epi32_mask&expand=1026)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_mask_cmplt_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmplt_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpgt_epi32_mask&expand=905)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_cmpgt_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<i32x16, _>(simd_gt(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpgt_epi32_mask&expand=906)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_mask_cmpgt_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmpgt_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epi32_mask&expand=903)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_cmpgt_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<i32x8, _>(simd_gt(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpgt_epi32_mask&expand=904)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_mask_cmpgt_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpgt_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epi32_mask&expand=901)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_cmpgt_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<i32x4, _>(simd_gt(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpgt_epi32_mask&expand=902)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_mask_cmpgt_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpgt_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmple_epi32_mask&expand=971)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_cmple_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<i32x16, _>(simd_le(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmple_epi32_mask&expand=972)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_mask_cmple_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmple_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmple_epi32_mask&expand=969)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_cmple_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<i32x8, _>(simd_le(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmple_epi32_mask&expand=970)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_mask_cmple_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmple_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_epi32_mask&expand=967)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_cmple_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<i32x4, _>(simd_le(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmple_epi32_mask&expand=968)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_mask_cmple_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmple_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpge_epi32_mask&expand=849)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_cmpge_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<i32x16, _>(simd_ge(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpge_epi32_mask&expand=850)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_mask_cmpge_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmpge_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpge_epi32_mask&expand=847)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_cmpge_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<i32x8, _>(simd_ge(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpge_epi32_mask&expand=848)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_mask_cmpge_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpge_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_epi32_mask&expand=845)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_cmpge_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<i32x4, _>(simd_ge(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compare packed signed 32-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpge_epi32_mask&expand=846)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_mask_cmpge_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpge_epi32_mask(a, b) & k1
+}
+
+/// Compare packed 32-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpeq_epi32_mask&expand=779)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_cmpeq_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<i32x16, _>(simd_eq(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compare packed 32-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpeq_epi32_mask&expand=780)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_mask_cmpeq_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmpeq_epi32_mask(a, b) & k1
+}
+
+/// Compare packed 32-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epi32_mask&expand=777)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_cmpeq_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<i32x8, _>(simd_eq(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compare packed 32-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpeq_epi32_mask&expand=778)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_mask_cmpeq_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpeq_epi32_mask(a, b) & k1
+}
+
+/// Compare packed 32-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epi32_mask&expand=775)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_cmpeq_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<i32x4, _>(simd_eq(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compare packed 32-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpeq_epi32_mask&expand=776)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_mask_cmpeq_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpeq_epi32_mask(a, b) & k1
+}
+
+/// Compare packed 32-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpneq_epi32_mask&expand=1088)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_cmpneq_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 {
+ simd_bitmask::<i32x16, _>(simd_ne(a.as_i32x16(), b.as_i32x16()))
+}
+
+/// Compare packed 32-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpneq_epi32_mask&expand=1089)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm512_mask_cmpneq_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 {
+ _mm512_cmpneq_epi32_mask(a, b) & k1
+}
+
+/// Compare packed 32-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpneq_epi32_mask&expand=1086)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_cmpneq_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<i32x8, _>(simd_ne(a.as_i32x8(), b.as_i32x8()))
+}
+
+/// Compare packed 32-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpneq_epi32_mask&expand=1087)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm256_mask_cmpneq_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpneq_epi32_mask(a, b) & k1
+}
+
+/// Compare packed 32-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_epi32_mask&expand=1084)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_cmpneq_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<i32x4, _>(simd_ne(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compare packed 32-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpneq_epi32_mask&expand=1085)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd
+pub unsafe fn _mm_mask_cmpneq_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpneq_epi32_mask(a, b) & k1
+}
+
+/// Compare packed signed 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_epi32_mask&expand=697)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm512_cmp_epi32_mask<const IMM3: _MM_CMPINT_ENUM>(
+ a: __m512i,
+ b: __m512i,
+) -> __mmask16 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ let r = vpcmpd(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed signed 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_epi32_mask&expand=698)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm512_mask_cmp_epi32_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __mmask16 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i32x16();
+ let b = b.as_i32x16();
+ let r = vpcmpd(a, b, IMM3, k1 as i16);
+ transmute(r)
+}
+
+/// Compare packed signed 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=#text=_mm256_cmp_epi32_mask&expand=695)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm256_cmp_epi32_mask<const IMM3: _MM_CMPINT_ENUM>(
+ a: __m256i,
+ b: __m256i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i32x8();
+ let b = b.as_i32x8();
+ let r = vpcmpd256(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed signed 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmp_epi32_mask&expand=696)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm256_mask_cmp_epi32_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i32x8();
+ let b = b.as_i32x8();
+ let r = vpcmpd256(a, b, IMM3, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed signed 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_epi32_mask&expand=693)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm_cmp_epi32_mask<const IMM3: _MM_CMPINT_ENUM>(a: __m128i, b: __m128i) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ let r = vpcmpd128(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed signed 32-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_epi32_mask&expand=694)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm_mask_cmp_epi32_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ let r = vpcmpd128(a, b, IMM3, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmplt_epu64_mask&expand=1062)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_cmplt_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_lt(a.as_u64x8(), b.as_u64x8()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmplt_epu64_mask&expand=1063)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_mask_cmplt_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmplt_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmplt_epu64_mask&expand=1060)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_cmplt_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_lt(a.as_u64x4(), b.as_u64x4()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmplt_epu64_mask&expand=1061)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_mask_cmplt_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmplt_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epu64_mask&expand=1058)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_cmplt_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_lt(a.as_u64x2(), b.as_u64x2()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmplt_epu64_mask&expand=1059)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_mask_cmplt_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmplt_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpgt_epu64_mask&expand=939)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_cmpgt_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_gt(a.as_u64x8(), b.as_u64x8()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpgt_epu64_mask&expand=940)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmpgt_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epu64_mask&expand=937)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_cmpgt_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_gt(a.as_u64x4(), b.as_u64x4()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpgt_epu64_mask&expand=938)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpgt_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epu64_mask&expand=935)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_cmpgt_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_gt(a.as_u64x2(), b.as_u64x2()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpgt_epu64_mask&expand=936)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpgt_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmple_epu64_mask&expand=1001)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_cmple_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_le(a.as_u64x8(), b.as_u64x8()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmple_epu64_mask&expand=1002)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_mask_cmple_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmple_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmple_epu64_mask&expand=999)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_cmple_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_le(a.as_u64x4(), b.as_u64x4()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmple_epu64_mask&expand=1000)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_mask_cmple_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmple_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_epu64_mask&expand=997)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_cmple_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_le(a.as_u64x2(), b.as_u64x2()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmple_epu64_mask&expand=998)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_mask_cmple_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmple_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpge_epu64_mask&expand=879)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_cmpge_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_ge(a.as_u64x8(), b.as_u64x8()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpge_epu64_mask&expand=880)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_mask_cmpge_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmpge_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpge_epu64_mask&expand=877)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_cmpge_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_ge(a.as_u64x4(), b.as_u64x4()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpge_epu64_mask&expand=878)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_mask_cmpge_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpge_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_epu64_mask&expand=875)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_cmpge_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_ge(a.as_u64x2(), b.as_u64x2()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpge_epu64_mask&expand=876)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_mask_cmpge_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpge_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpeq_epu64_mask&expand=813)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_cmpeq_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_eq(a.as_u64x8(), b.as_u64x8()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpeq_epu64_mask&expand=814)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmpeq_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epu64_mask&expand=811)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_cmpeq_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_eq(a.as_u64x4(), b.as_u64x4()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpeq_epu64_mask&expand=812)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpeq_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epu64_mask&expand=809)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_cmpeq_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_eq(a.as_u64x2(), b.as_u64x2()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpeq_epu64_mask&expand=810)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpeq_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpneq_epu64_mask&expand=1118)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_cmpneq_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_ne(a.as_u64x8(), b.as_u64x8()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpneq_epu64_mask&expand=1119)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm512_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmpneq_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpneq_epu64_mask&expand=1116)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_cmpneq_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_ne(a.as_u64x4(), b.as_u64x4()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpneq_epu64_mask&expand=1117)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm256_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpneq_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_epu64_mask&expand=1114)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_cmpneq_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_ne(a.as_u64x2(), b.as_u64x2()))
+}
+
+/// Compare packed unsigned 64-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpneq_epu64_mask&expand=1115)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq
+pub unsafe fn _mm_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpneq_epu64_mask(a, b) & k1
+}
+
+/// Compare packed unsigned 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_epu64_mask&expand=727)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm512_cmp_epu64_mask<const IMM3: _MM_CMPINT_ENUM>(
+ a: __m512i,
+ b: __m512i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i64x8();
+ let b = b.as_i64x8();
+ let r = vpcmpuq(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed unsigned 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_epu64_mask&expand=728)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm512_mask_cmp_epu64_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i64x8();
+ let b = b.as_i64x8();
+ let r = vpcmpuq(a, b, IMM3, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed unsigned 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_epu64_mask&expand=725)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm256_cmp_epu64_mask<const IMM3: _MM_CMPINT_ENUM>(
+ a: __m256i,
+ b: __m256i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i64x4();
+ let b = b.as_i64x4();
+ let r = vpcmpuq256(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed unsigned 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmp_epu64_mask&expand=726)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm256_mask_cmp_epu64_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i64x4();
+ let b = b.as_i64x4();
+ let r = vpcmpuq256(a, b, IMM3, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed unsigned 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_epu64_mask&expand=723)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm_cmp_epu64_mask<const IMM3: _MM_CMPINT_ENUM>(a: __m128i, b: __m128i) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i64x2();
+ let b = b.as_i64x2();
+ let r = vpcmpuq128(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed unsigned 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_epu64_mask&expand=724)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm_mask_cmp_epu64_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i64x2();
+ let b = b.as_i64x2();
+ let r = vpcmpuq128(a, b, IMM3, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmplt_epi64_mask&expand=1037)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_cmplt_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_lt(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmplt_epi64_mask&expand=1038)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_mask_cmplt_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmplt_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmplt_epi64_mask&expand=1035)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_cmplt_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_lt(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmplt_epi64_mask&expand=1036)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_mask_cmplt_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmplt_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epi64_mask&expand=1033)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_cmplt_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_lt(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmplt_epi64_mask&expand=1034)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_mask_cmplt_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmplt_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpgt_epi64_mask&expand=913)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_cmpgt_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_gt(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpgt_epi64_mask&expand=914)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmpgt_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpgt_epi64_mask&expand=911)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_cmpgt_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_gt(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpgt_epi64_mask&expand=912)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpgt_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epi64_mask&expand=909)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_cmpgt_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_gt(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpgt_epi64_mask&expand=910)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpgt_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmple_epi64_mask&expand=977)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_cmple_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_le(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmple_epi64_mask&expand=978)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_mask_cmple_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmple_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmple_epi64_mask&expand=975)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_cmple_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_le(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmple_epi64_mask&expand=976)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_mask_cmple_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmple_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_epi64_mask&expand=973)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_cmple_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_le(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmple_epi64_mask&expand=974)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_mask_cmple_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmple_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpge_epi64_mask&expand=855)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_cmpge_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_ge(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpge_epi64_mask&expand=856)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_mask_cmpge_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmpge_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpge_epi64_mask&expand=853)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_cmpge_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_ge(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpge_epi64_mask&expand=854)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_mask_cmpge_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpge_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_epi64_mask&expand=851)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_cmpge_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_ge(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpge_epi64_mask&expand=852)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_mask_cmpge_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpge_epi64_mask(a, b) & k1
+}
+
+/// Compare packed 64-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpeq_epi64_mask&expand=787)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_cmpeq_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_eq(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compare packed 64-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpeq_epi64_mask&expand=788)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmpeq_epi64_mask(a, b) & k1
+}
+
+/// Compare packed 64-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpeq_epi64_mask&expand=785)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_cmpeq_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_eq(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compare packed 64-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpeq_epi64_mask&expand=786)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpeq_epi64_mask(a, b) & k1
+}
+
+/// Compare packed 64-bit integers in a and b for equality, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epi64_mask&expand=783)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_cmpeq_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_eq(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Compare packed 64-bit integers in a and b for equality, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpeq_epi64_mask&expand=784)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpeq_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmpneq_epi64_mask&expand=1094)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_cmpneq_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 {
+ simd_bitmask::<__m512i, _>(simd_ne(a.as_i64x8(), b.as_i64x8()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmpneq_epi64_mask&expand=1095)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm512_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 {
+ _mm512_cmpneq_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmpneq_epi64_mask&expand=1092)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_cmpneq_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 {
+ simd_bitmask::<__m256i, _>(simd_ne(a.as_i64x4(), b.as_i64x4()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmpneq_epi64_mask&expand=1093)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm256_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 {
+ _mm256_cmpneq_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b for not-equal, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_epi64_mask&expand=1090)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_cmpneq_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 {
+ simd_bitmask::<__m128i, _>(simd_ne(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Compare packed signed 64-bit integers in a and b for not-equal, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmpneq_epi64_mask&expand=1091)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq
+pub unsafe fn _mm_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 {
+ _mm_cmpneq_epi64_mask(a, b) & k1
+}
+
+/// Compare packed signed 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_cmp_epi64_mask&expand=703)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm512_cmp_epi64_mask<const IMM3: _MM_CMPINT_ENUM>(
+ a: __m512i,
+ b: __m512i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i64x8();
+ let b = b.as_i64x8();
+ let r = vpcmpq(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed signed 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cmp_epi64_mask&expand=704)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm512_mask_cmp_epi64_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i64x8();
+ let b = b.as_i64x8();
+ let r = vpcmpq(a, b, IMM3, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed signed 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cmp_epi64_mask&expand=701)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm256_cmp_epi64_mask<const IMM3: _MM_CMPINT_ENUM>(
+ a: __m256i,
+ b: __m256i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i64x4();
+ let b = b.as_i64x4();
+ let r = vpcmpq256(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed signed 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cmp_epi64_mask&expand=702)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm256_mask_cmp_epi64_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i64x4();
+ let b = b.as_i64x4();
+ let r = vpcmpq256(a, b, IMM3, k1 as i8);
+ transmute(r)
+}
+
+/// Compare packed signed 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_epi64_mask&expand=699)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm_cmp_epi64_mask<const IMM3: _MM_CMPINT_ENUM>(a: __m128i, b: __m128i) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let neg_one = -1;
+ let a = a.as_i64x2();
+ let b = b.as_i64x2();
+ let r = vpcmpq128(a, b, IMM3, neg_one);
+ transmute(r)
+}
+
+/// Compare packed signed 64-bit integers in a and b based on the comparison operand specified by imm8, and store the results in mask vector k using zeromask k1 (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cmp_epi64_mask&expand=700)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))]
+pub unsafe fn _mm_mask_cmp_epi64_mask<const IMM3: _MM_CMPINT_ENUM>(
+ k1: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __mmask8 {
+ static_assert_imm3!(IMM3);
+ let a = a.as_i64x2();
+ let b = b.as_i64x2();
+ let r = vpcmpq128(a, b, IMM3, k1 as i8);
+ transmute(r)
+}
+
+/// Reduce the packed 32-bit integers in a by addition. Returns the sum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_add_epi32&expand=4556)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_add_epi32(a: __m512i) -> i32 {
+ simd_reduce_add_unordered(a.as_i32x16())
+}
+
+/// Reduce the packed 32-bit integers in a by addition using mask k. Returns the sum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_add_epi32&expand=4555)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_add_epi32(k: __mmask16, a: __m512i) -> i32 {
+ simd_reduce_add_unordered(simd_select_bitmask(
+ k,
+ a.as_i32x16(),
+ _mm512_setzero_si512().as_i32x16(),
+ ))
+}
+
+/// Reduce the packed 64-bit integers in a by addition. Returns the sum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_add_epi64&expand=4558)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_add_epi64(a: __m512i) -> i64 {
+ simd_reduce_add_unordered(a.as_i64x8())
+}
+
+/// Reduce the packed 64-bit integers in a by addition using mask k. Returns the sum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_add_epi64&expand=4557)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_add_epi64(k: __mmask8, a: __m512i) -> i64 {
+ simd_reduce_add_unordered(simd_select_bitmask(
+ k,
+ a.as_i64x8(),
+ _mm512_setzero_si512().as_i64x8(),
+ ))
+}
+
+/// Reduce the packed single-precision (32-bit) floating-point elements in a by addition. Returns the sum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_add_ps&expand=4562)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_add_ps(a: __m512) -> f32 {
+ simd_reduce_add_unordered(a.as_f32x16())
+}
+
+/// Reduce the packed single-precision (32-bit) floating-point elements in a by addition using mask k. Returns the sum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_add_ps&expand=4561)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_add_ps(k: __mmask16, a: __m512) -> f32 {
+ simd_reduce_add_unordered(simd_select_bitmask(
+ k,
+ a.as_f32x16(),
+ _mm512_setzero_ps().as_f32x16(),
+ ))
+}
+
+/// Reduce the packed double-precision (64-bit) floating-point elements in a by addition. Returns the sum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_add_pd&expand=4560)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_add_pd(a: __m512d) -> f64 {
+ simd_reduce_add_unordered(a.as_f64x8())
+}
+
+/// Reduce the packed double-precision (64-bit) floating-point elements in a by addition using mask k. Returns the sum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_add_pd&expand=4559)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_add_pd(k: __mmask8, a: __m512d) -> f64 {
+ simd_reduce_add_unordered(simd_select_bitmask(
+ k,
+ a.as_f64x8(),
+ _mm512_setzero_pd().as_f64x8(),
+ ))
+}
+
+/// Reduce the packed 32-bit integers in a by multiplication. Returns the product of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_mul_epi32&expand=4600)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_mul_epi32(a: __m512i) -> i32 {
+ simd_reduce_mul_unordered(a.as_i32x16())
+}
+
+/// Reduce the packed 32-bit integers in a by multiplication using mask k. Returns the product of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_mul_epi32&expand=4599)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_mul_epi32(k: __mmask16, a: __m512i) -> i32 {
+ simd_reduce_mul_unordered(simd_select_bitmask(
+ k,
+ a.as_i32x16(),
+ _mm512_set1_epi32(1).as_i32x16(),
+ ))
+}
+
+/// Reduce the packed 64-bit integers in a by multiplication. Returns the product of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_mul_epi64&expand=4602)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_mul_epi64(a: __m512i) -> i64 {
+ simd_reduce_mul_unordered(a.as_i64x8())
+}
+
+/// Reduce the packed 64-bit integers in a by multiplication using mask k. Returns the product of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_mul_epi64&expand=4601)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_mul_epi64(k: __mmask8, a: __m512i) -> i64 {
+ simd_reduce_mul_unordered(simd_select_bitmask(
+ k,
+ a.as_i64x8(),
+ _mm512_set1_epi64(1).as_i64x8(),
+ ))
+}
+
+/// Reduce the packed single-precision (32-bit) floating-point elements in a by multiplication. Returns the product of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_mul_ps&expand=4606)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_mul_ps(a: __m512) -> f32 {
+ simd_reduce_mul_unordered(a.as_f32x16())
+}
+
+/// Reduce the packed single-precision (32-bit) floating-point elements in a by multiplication using mask k. Returns the product of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_mul_ps&expand=4605)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_mul_ps(k: __mmask16, a: __m512) -> f32 {
+ simd_reduce_mul_unordered(simd_select_bitmask(
+ k,
+ a.as_f32x16(),
+ _mm512_set1_ps(1.).as_f32x16(),
+ ))
+}
+
+/// Reduce the packed double-precision (64-bit) floating-point elements in a by multiplication. Returns the product of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_mul_pd&expand=4604)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_mul_pd(a: __m512d) -> f64 {
+ simd_reduce_mul_unordered(a.as_f64x8())
+}
+
+/// Reduce the packed double-precision (64-bit) floating-point elements in a by multiplication using mask k. Returns the product of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_mul_pd&expand=4603)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_mul_pd(k: __mmask8, a: __m512d) -> f64 {
+ simd_reduce_mul_unordered(simd_select_bitmask(
+ k,
+ a.as_f64x8(),
+ _mm512_set1_pd(1.).as_f64x8(),
+ ))
+}
+
+/// Reduce the packed signed 32-bit integers in a by maximum. Returns the maximum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_max_epi32&expand=4576)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_max_epi32(a: __m512i) -> i32 {
+ simd_reduce_max(a.as_i32x16())
+}
+
+/// Reduce the packed signed 32-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_max_epi32&expand=4575)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_max_epi32(k: __mmask16, a: __m512i) -> i32 {
+ simd_reduce_max(simd_select_bitmask(
+ k,
+ a.as_i32x16(),
+ _mm512_undefined_epi32().as_i32x16(),
+ ))
+}
+
+/// Reduce the packed signed 64-bit integers in a by maximum. Returns the maximum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_max_epi64&expand=4578)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_max_epi64(a: __m512i) -> i64 {
+ simd_reduce_max(a.as_i64x8())
+}
+
+/// Reduce the packed signed 64-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_max_epi64&expand=4577)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_max_epi64(k: __mmask8, a: __m512i) -> i64 {
+ simd_reduce_max(simd_select_bitmask(
+ k,
+ a.as_i64x8(),
+ _mm512_set1_epi64(0).as_i64x8(),
+ ))
+}
+
+/// Reduce the packed unsigned 32-bit integers in a by maximum. Returns the maximum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_max_epu32&expand=4580)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_max_epu32(a: __m512i) -> u32 {
+ simd_reduce_max(a.as_u32x16())
+}
+
+/// Reduce the packed unsigned 32-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_max_epu32&expand=4579)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_max_epu32(k: __mmask16, a: __m512i) -> u32 {
+ simd_reduce_max(simd_select_bitmask(
+ k,
+ a.as_u32x16(),
+ _mm512_undefined_epi32().as_u32x16(),
+ ))
+}
+
+/// Reduce the packed unsigned 64-bit integers in a by maximum. Returns the maximum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_max_epu64&expand=4582)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_max_epu64(a: __m512i) -> u64 {
+ simd_reduce_max(a.as_u64x8())
+}
+
+/// Reduce the packed unsigned 64-bit integers in a by maximum using mask k. Returns the maximum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_max_epu64&expand=4581)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_max_epu64(k: __mmask8, a: __m512i) -> u64 {
+ simd_reduce_max(simd_select_bitmask(
+ k,
+ a.as_u64x8(),
+ _mm512_set1_epi64(0).as_u64x8(),
+ ))
+}
+
+/// Reduce the packed single-precision (32-bit) floating-point elements in a by maximum. Returns the maximum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_max_ps&expand=4586)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_max_ps(a: __m512) -> f32 {
+ simd_reduce_max(a.as_f32x16())
+}
+
+/// Reduce the packed single-precision (32-bit) floating-point elements in a by maximum using mask k. Returns the maximum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_max_ps&expand=4585)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_max_ps(k: __mmask16, a: __m512) -> f32 {
+ simd_reduce_max(simd_select_bitmask(
+ k,
+ a.as_f32x16(),
+ _mm512_undefined_ps().as_f32x16(),
+ ))
+}
+
+/// Reduce the packed double-precision (64-bit) floating-point elements in a by maximum. Returns the maximum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_max_pd&expand=4584)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_max_pd(a: __m512d) -> f64 {
+ simd_reduce_max(a.as_f64x8())
+}
+
+/// Reduce the packed double-precision (64-bit) floating-point elements in a by maximum using mask k. Returns the maximum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_max_pd&expand=4583)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_max_pd(k: __mmask8, a: __m512d) -> f64 {
+ simd_reduce_max(simd_select_bitmask(
+ k,
+ a.as_f64x8(),
+ _mm512_undefined_pd().as_f64x8(),
+ ))
+}
+
+/// Reduce the packed signed 32-bit integers in a by minimum. Returns the minimum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_min_epi32&expand=4588)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_min_epi32(a: __m512i) -> i32 {
+ simd_reduce_min(a.as_i32x16())
+}
+
+/// Reduce the packed signed 32-bit integers in a by maximum using mask k. Returns the minimum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_min_epi32&expand=4587)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_min_epi32(k: __mmask16, a: __m512i) -> i32 {
+ simd_reduce_min(simd_select_bitmask(
+ k,
+ a.as_i32x16(),
+ _mm512_undefined_epi32().as_i32x16(),
+ ))
+}
+
+/// Reduce the packed signed 64-bit integers in a by minimum. Returns the minimum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_min_epi64&expand=4590)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_min_epi64(a: __m512i) -> i64 {
+ simd_reduce_min(a.as_i64x8())
+}
+
+/// Reduce the packed signed 64-bit integers in a by maximum using mask k. Returns the minimum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_min_epi64&expand=4589)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_min_epi64(k: __mmask8, a: __m512i) -> i64 {
+ simd_reduce_min(simd_select_bitmask(
+ k,
+ a.as_i64x8(),
+ _mm512_set1_epi64(0).as_i64x8(),
+ ))
+}
+
+/// Reduce the packed unsigned 32-bit integers in a by minimum. Returns the minimum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_min_epu32&expand=4592)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_min_epu32(a: __m512i) -> u32 {
+ simd_reduce_min(a.as_u32x16())
+}
+
+/// Reduce the packed unsigned 32-bit integers in a by maximum using mask k. Returns the minimum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_min_epu32&expand=4591)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_min_epu32(k: __mmask16, a: __m512i) -> u32 {
+ simd_reduce_min(simd_select_bitmask(
+ k,
+ a.as_u32x16(),
+ _mm512_undefined_epi32().as_u32x16(),
+ ))
+}
+
+/// Reduce the packed unsigned 64-bit integers in a by minimum. Returns the minimum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_min_epu64&expand=4594)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_min_epu64(a: __m512i) -> u64 {
+ simd_reduce_min(a.as_u64x8())
+}
+
+/// Reduce the packed signed 64-bit integers in a by maximum using mask k. Returns the minimum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_min_epi64&expand=4589)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_min_epu64(k: __mmask8, a: __m512i) -> u64 {
+ simd_reduce_min(simd_select_bitmask(
+ k,
+ a.as_u64x8(),
+ _mm512_set1_epi64(0).as_u64x8(),
+ ))
+}
+
+/// Reduce the packed single-precision (32-bit) floating-point elements in a by minimum. Returns the minimum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_min_ps&expand=4598)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_min_ps(a: __m512) -> f32 {
+ simd_reduce_min(a.as_f32x16())
+}
+
+/// Reduce the packed single-precision (32-bit) floating-point elements in a by maximum using mask k. Returns the minimum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_min_ps&expand=4597)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_min_ps(k: __mmask16, a: __m512) -> f32 {
+ simd_reduce_min(simd_select_bitmask(
+ k,
+ a.as_f32x16(),
+ _mm512_undefined_ps().as_f32x16(),
+ ))
+}
+
+/// Reduce the packed double-precision (64-bit) floating-point elements in a by minimum. Returns the minimum of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_min_pd&expand=4596)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_min_pd(a: __m512d) -> f64 {
+ simd_reduce_min(a.as_f64x8())
+}
+
+/// Reduce the packed double-precision (64-bit) floating-point elements in a by maximum using mask k. Returns the minimum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_min_pd&expand=4595)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_min_pd(k: __mmask8, a: __m512d) -> f64 {
+ simd_reduce_min(simd_select_bitmask(
+ k,
+ a.as_f64x8(),
+ _mm512_undefined_pd().as_f64x8(),
+ ))
+}
+
+/// Reduce the packed 32-bit integers in a by bitwise AND. Returns the bitwise AND of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_and_epi32&expand=4564)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_and_epi32(a: __m512i) -> i32 {
+ simd_reduce_and(a.as_i32x16())
+}
+
+/// Reduce the packed 32-bit integers in a by bitwise AND using mask k. Returns the bitwise AND of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_and_epi32&expand=4563)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_and_epi32(k: __mmask16, a: __m512i) -> i32 {
+ simd_reduce_and(simd_select_bitmask(
+ k,
+ a.as_i32x16(),
+ _mm512_set1_epi32(0xFF).as_i32x16(),
+ ))
+}
+
+/// Reduce the packed 64-bit integers in a by bitwise AND. Returns the bitwise AND of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_and_epi64&expand=4566)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_and_epi64(a: __m512i) -> i64 {
+ simd_reduce_and(a.as_i64x8())
+}
+
+/// Reduce the packed 64-bit integers in a by addition using mask k. Returns the sum of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_add_epi64&expand=4557)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_and_epi64(k: __mmask8, a: __m512i) -> i64 {
+ simd_reduce_and(simd_select_bitmask(
+ k,
+ a.as_i64x8(),
+ _mm512_set1_epi64(1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7)
+ .as_i64x8(),
+ ))
+}
+
+/// Reduce the packed 32-bit integers in a by bitwise OR. Returns the bitwise OR of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_or_epi32&expand=4608)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_or_epi32(a: __m512i) -> i32 {
+ simd_reduce_or(a.as_i32x16())
+}
+
+/// Reduce the packed 32-bit integers in a by bitwise OR using mask k. Returns the bitwise OR of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_or_epi32&expand=4607)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_or_epi32(k: __mmask16, a: __m512i) -> i32 {
+ simd_reduce_or(simd_select_bitmask(
+ k,
+ a.as_i32x16(),
+ _mm512_setzero_si512().as_i32x16(),
+ ))
+}
+
+/// Reduce the packed 64-bit integers in a by bitwise OR. Returns the bitwise OR of all elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_reduce_or_epi64&expand=4610)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_reduce_or_epi64(a: __m512i) -> i64 {
+ simd_reduce_or(a.as_i64x8())
+}
+
+/// Reduce the packed 64-bit integers in a by bitwise OR using mask k. Returns the bitwise OR of all active elements in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_reduce_or_epi64&expand=4609)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_reduce_or_epi64(k: __mmask8, a: __m512i) -> i64 {
+ simd_reduce_or(simd_select_bitmask(
+ k,
+ a.as_i64x8(),
+ _mm512_setzero_si512().as_i64x8(),
+ ))
+}
+
+/// Returns vector of type `__m512d` with undefined elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_undefined_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+// This intrinsic has no corresponding instruction.
+pub unsafe fn _mm512_undefined_pd() -> __m512d {
+ _mm512_set1_pd(0.0)
+}
+
+/// Returns vector of type `__m512` with undefined elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_undefined_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+// This intrinsic has no corresponding instruction.
+pub unsafe fn _mm512_undefined_ps() -> __m512 {
+ _mm512_set1_ps(0.0)
+}
+
+/// Return vector of type __m512i with undefined elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_undefined_epi32&expand=5995)
+#[inline]
+#[target_feature(enable = "avx512f")]
+// This intrinsic has no corresponding instruction.
+pub unsafe fn _mm512_undefined_epi32() -> __m512i {
+ _mm512_set1_epi32(0)
+}
+
+/// Return vector of type __m512 with undefined elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_undefined&expand=5994)
+#[inline]
+#[target_feature(enable = "avx512f")]
+// This intrinsic has no corresponding instruction.
+pub unsafe fn _mm512_undefined() -> __m512 {
+ _mm512_set1_ps(0.0)
+}
+
+/// Load 512-bits (composed of 16 packed 32-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_loadu_epi32&expand=3377)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32
+pub unsafe fn _mm512_loadu_epi32(mem_addr: *const i32) -> __m512i {
+ ptr::read_unaligned(mem_addr as *const __m512i)
+}
+
+/// Load 256-bits (composed of 8 packed 32-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_loadu_epi32&expand=3374)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32
+pub unsafe fn _mm256_loadu_epi32(mem_addr: *const i32) -> __m256i {
+ ptr::read_unaligned(mem_addr as *const __m256i)
+}
+
+/// Load 128-bits (composed of 4 packed 32-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadu_epi32&expand=3371)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32
+pub unsafe fn _mm_loadu_epi32(mem_addr: *const i32) -> __m128i {
+ ptr::read_unaligned(mem_addr as *const __m128i)
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi32_storeu_epi16&expand=1460)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm512_mask_cvtepi32_storeu_epi16(mem_addr: *mut i8, k: __mmask16, a: __m512i) {
+ vpmovdwmem(mem_addr as *mut i8, a.as_i32x16(), k);
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi32_storeu_epi8&expand=1462)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm256_mask_cvtepi32_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovdwmem256(mem_addr as *mut i8, a.as_i32x8(), k);
+}
+
+/// Convert packed 32-bit integers in a to packed 16-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi32_storeu_epi8&expand=1461)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdw))]
+pub unsafe fn _mm_mask_cvtepi32_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovdwmem128(mem_addr as *mut i8, a.as_i32x4(), k);
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi32_storeu_epi16&expand=1833)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm512_mask_cvtsepi32_storeu_epi16(mem_addr: *mut i8, k: __mmask16, a: __m512i) {
+ vpmovsdwmem(mem_addr as *mut i8, a.as_i32x16(), k);
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi32_storeu_epi16&expand=1832)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm256_mask_cvtsepi32_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovsdwmem256(mem_addr as *mut i8, a.as_i32x8(), k);
+}
+
+/// Convert packed signed 32-bit integers in a to packed 16-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi32_storeu_epi16&expand=1831)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdw))]
+pub unsafe fn _mm_mask_cvtsepi32_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovsdwmem128(mem_addr as *mut i8, a.as_i32x4(), k);
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed 16-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi32_storeu_epi16&expand=2068)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm512_mask_cvtusepi32_storeu_epi16(mem_addr: *mut i8, k: __mmask16, a: __m512i) {
+ vpmovusdwmem(mem_addr as *mut i8, a.as_i32x16(), k);
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi32_storeu_epi16&expand=2067)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm256_mask_cvtusepi32_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovusdwmem256(mem_addr as *mut i8, a.as_i32x8(), k);
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed unsigned 16-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi32_storeu_epi16&expand=2066)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdw))]
+pub unsafe fn _mm_mask_cvtusepi32_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovusdwmem128(mem_addr as *mut i8, a.as_i32x4(), k);
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi32_storeu_epi8&expand=1463)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm512_mask_cvtepi32_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m512i) {
+ vpmovdbmem(mem_addr as *mut i8, a.as_i32x16(), k);
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi32_storeu_epi8&expand=1462)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm256_mask_cvtepi32_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovdbmem256(mem_addr as *mut i8, a.as_i32x8(), k);
+}
+
+/// Convert packed 32-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi32_storeu_epi8&expand=1461)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovdb))]
+pub unsafe fn _mm_mask_cvtepi32_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovdbmem128(mem_addr as *mut i8, a.as_i32x4(), k);
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi32_storeu_epi8&expand=1836)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm512_mask_cvtsepi32_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m512i) {
+ vpmovsdbmem(mem_addr as *mut i8, a.as_i32x16(), k);
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi32_storeu_epi8&expand=1835)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm256_mask_cvtsepi32_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovsdbmem256(mem_addr as *mut i8, a.as_i32x8(), k);
+}
+
+/// Convert packed signed 32-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi32_storeu_epi8&expand=1834)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsdb))]
+pub unsafe fn _mm_mask_cvtsepi32_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovsdbmem128(mem_addr as *mut i8, a.as_i32x4(), k);
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi32_storeu_epi8&expand=2071)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm512_mask_cvtusepi32_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m512i) {
+ vpmovusdbmem(mem_addr as *mut i8, a.as_i32x16(), k);
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi32_storeu_epi8&expand=2070)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm256_mask_cvtusepi32_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovusdbmem256(mem_addr as *mut i8, a.as_i32x8(), k);
+}
+
+/// Convert packed unsigned 32-bit integers in a to packed 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi32_storeu_epi8&expand=2069)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusdb))]
+pub unsafe fn _mm_mask_cvtusepi32_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovusdbmem128(mem_addr as *mut i8, a.as_i32x4(), k);
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi64_storeu_epi16&expand=1513)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm512_mask_cvtepi64_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m512i) {
+ vpmovqwmem(mem_addr as *mut i8, a.as_i64x8(), k);
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi64_storeu_epi16&expand=1512)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm256_mask_cvtepi64_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovqwmem256(mem_addr as *mut i8, a.as_i64x4(), k);
+}
+
+/// Convert packed 64-bit integers in a to packed 16-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi64_storeu_epi16&expand=1511)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqw))]
+pub unsafe fn _mm_mask_cvtepi64_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovqwmem128(mem_addr as *mut i8, a.as_i64x2(), k);
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi64_storeu_epi16&expand=1866)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm512_mask_cvtsepi64_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m512i) {
+ vpmovsqwmem(mem_addr as *mut i8, a.as_i64x8(), k);
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi64_storeu_epi16&expand=1865)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm256_mask_cvtsepi64_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovsqwmem256(mem_addr as *mut i8, a.as_i64x4(), k);
+}
+
+/// Convert packed signed 64-bit integers in a to packed 16-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi64_storeu_epi16&expand=1864)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqw))]
+pub unsafe fn _mm_mask_cvtsepi64_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovsqwmem128(mem_addr as *mut i8, a.as_i64x2(), k);
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed 16-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi64_storeu_epi16&expand=2101)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm512_mask_cvtusepi64_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m512i) {
+ vpmovusqwmem(mem_addr as *mut i8, a.as_i64x8(), k);
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed 16-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi64_storeu_epi16&expand=2100)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm256_mask_cvtusepi64_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovusqwmem256(mem_addr as *mut i8, a.as_i64x4(), k);
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed 16-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi64_storeu_epi16&expand=2099)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqw))]
+pub unsafe fn _mm_mask_cvtusepi64_storeu_epi16(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovusqwmem128(mem_addr as *mut i8, a.as_i64x2(), k);
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi64_storeu_epi8&expand=1519)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm512_mask_cvtepi64_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m512i) {
+ vpmovqbmem(mem_addr as *mut i8, a.as_i64x8(), k);
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi64_storeu_epi8&expand=1518)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm256_mask_cvtepi64_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovqbmem256(mem_addr as *mut i8, a.as_i64x4(), k);
+}
+
+/// Convert packed 64-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi64_storeu_epi8&expand=1517)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqb))]
+pub unsafe fn _mm_mask_cvtepi64_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovqbmem128(mem_addr as *mut i8, a.as_i64x2(), k);
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi64_storeu_epi8&expand=1872)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm512_mask_cvtsepi64_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m512i) {
+ vpmovsqbmem(mem_addr as *mut i8, a.as_i64x8(), k);
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi64_storeu_epi8&expand=1871)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm256_mask_cvtsepi64_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovsqbmem256(mem_addr as *mut i8, a.as_i64x4(), k);
+}
+
+/// Convert packed signed 64-bit integers in a to packed 8-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi64_storeu_epi8&expand=1870)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqb))]
+pub unsafe fn _mm_mask_cvtsepi64_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovsqbmem128(mem_addr as *mut i8, a.as_i64x2(), k);
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi64_storeu_epi8&expand=2107)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm512_mask_cvtusepi64_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m512i) {
+ vpmovusqbmem(mem_addr as *mut i8, a.as_i64x8(), k);
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi64_storeu_epi8&expand=2106)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm256_mask_cvtusepi64_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovusqbmem256(mem_addr as *mut i8, a.as_i64x4(), k);
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi64_storeu_epi8&expand=2105)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqb))]
+pub unsafe fn _mm_mask_cvtusepi64_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovusqbmem128(mem_addr as *mut i8, a.as_i64x2(), k);
+}
+
+///Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtepi64_storeu_epi32&expand=1516)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm512_mask_cvtepi64_storeu_epi32(mem_addr: *mut i8, k: __mmask8, a: __m512i) {
+ vpmovqdmem(mem_addr as *mut i8, a.as_i64x8(), k);
+}
+
+///Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtepi64_storeu_epi32&expand=1515)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm256_mask_cvtepi64_storeu_epi32(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovqdmem256(mem_addr as *mut i8, a.as_i64x4(), k);
+}
+
+///Convert packed 64-bit integers in a to packed 32-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtepi64_storeu_epi32&expand=1514)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovqd))]
+pub unsafe fn _mm_mask_cvtepi64_storeu_epi32(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovqdmem128(mem_addr as *mut i8, a.as_i64x2(), k);
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtsepi64_storeu_epi32&expand=1869)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm512_mask_cvtsepi64_storeu_epi32(mem_addr: *mut i8, k: __mmask8, a: __m512i) {
+ vpmovsqdmem(mem_addr as *mut i8, a.as_i64x8(), k);
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtsepi64_storeu_epi32&expand=1868)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm256_mask_cvtsepi64_storeu_epi32(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovsqdmem256(mem_addr as *mut i8, a.as_i64x4(), k);
+}
+
+/// Convert packed signed 64-bit integers in a to packed 32-bit integers with signed saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtsepi64_storeu_epi32&expand=1867)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovsqd))]
+pub unsafe fn _mm_mask_cvtsepi64_storeu_epi32(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovsqdmem128(mem_addr as *mut i8, a.as_i64x2(), k);
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed 32-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_cvtusepi64_storeu_epi32&expand=2104)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm512_mask_cvtusepi64_storeu_epi32(mem_addr: *mut i8, k: __mmask8, a: __m512i) {
+ vpmovusqdmem(mem_addr as *mut i8, a.as_i64x8(), k);
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed 32-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_cvtusepi64_storeu_epi32&expand=2103)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm256_mask_cvtusepi64_storeu_epi32(mem_addr: *mut i8, k: __mmask8, a: __m256i) {
+ vpmovusqdmem256(mem_addr as *mut i8, a.as_i64x4(), k);
+}
+
+/// Convert packed unsigned 64-bit integers in a to packed 32-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_cvtusepi64_storeu_epi32&expand=2102)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmovusqd))]
+pub unsafe fn _mm_mask_cvtusepi64_storeu_epi32(mem_addr: *mut i8, k: __mmask8, a: __m128i) {
+ vpmovusqdmem128(mem_addr as *mut i8, a.as_i64x2(), k);
+}
+
+/// Store 512-bits (composed of 16 packed 32-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_storeu_epi32&expand=5628)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32
+pub unsafe fn _mm512_storeu_epi32(mem_addr: *mut i32, a: __m512i) {
+ ptr::write_unaligned(mem_addr as *mut __m512i, a);
+}
+
+/// Store 256-bits (composed of 8 packed 32-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_storeu_epi32&expand=5626)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32
+pub unsafe fn _mm256_storeu_epi32(mem_addr: *mut i32, a: __m256i) {
+ ptr::write_unaligned(mem_addr as *mut __m256i, a);
+}
+
+/// Store 128-bits (composed of 4 packed 32-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storeu_epi32&expand=5624)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32
+pub unsafe fn _mm_storeu_epi32(mem_addr: *mut i32, a: __m128i) {
+ ptr::write_unaligned(mem_addr as *mut __m128i, a);
+}
+
+/// Load 512-bits (composed of 8 packed 64-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_loadu_epi64&expand=3386)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64
+pub unsafe fn _mm512_loadu_epi64(mem_addr: *const i64) -> __m512i {
+ ptr::read_unaligned(mem_addr as *const __m512i)
+}
+
+/// Load 256-bits (composed of 4 packed 64-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_loadu_epi64&expand=3383)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64
+pub unsafe fn _mm256_loadu_epi64(mem_addr: *const i64) -> __m256i {
+ ptr::read_unaligned(mem_addr as *const __m256i)
+}
+
+/// Load 128-bits (composed of 2 packed 64-bit integers) from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadu_epi64&expand=3380)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64
+pub unsafe fn _mm_loadu_epi64(mem_addr: *const i64) -> __m128i {
+ ptr::read_unaligned(mem_addr as *const __m128i)
+}
+
+/// Store 512-bits (composed of 8 packed 64-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_storeu_epi64&expand=5634)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64
+pub unsafe fn _mm512_storeu_epi64(mem_addr: *mut i64, a: __m512i) {
+ ptr::write_unaligned(mem_addr as *mut __m512i, a);
+}
+
+/// Store 256-bits (composed of 4 packed 64-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_storeu_epi64&expand=5632)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64
+pub unsafe fn _mm256_storeu_epi64(mem_addr: *mut i64, a: __m256i) {
+ ptr::write_unaligned(mem_addr as *mut __m256i, a);
+}
+
+/// Store 128-bits (composed of 2 packed 64-bit integers) from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storeu_epi64&expand=5630)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64
+pub unsafe fn _mm_storeu_epi64(mem_addr: *mut i64, a: __m128i) {
+ ptr::write_unaligned(mem_addr as *mut __m128i, a);
+}
+
+/// Load 512-bits of integer data from memory into dst. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_loadu_si512&expand=3420)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32
+pub unsafe fn _mm512_loadu_si512(mem_addr: *const i32) -> __m512i {
+ ptr::read_unaligned(mem_addr as *const __m512i)
+}
+
+/// Store 512-bits of integer data from a into memory. mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_storeu_si512&expand=5657)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32
+pub unsafe fn _mm512_storeu_si512(mem_addr: *mut i32, a: __m512i) {
+ ptr::write_unaligned(mem_addr as *mut __m512i, a);
+}
+
+/// Loads 512-bits (composed of 8 packed double-precision (64-bit)
+/// floating-point elements) from memory into result.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_loadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovups))]
+pub unsafe fn _mm512_loadu_pd(mem_addr: *const f64) -> __m512d {
+ ptr::read_unaligned(mem_addr as *const __m512d)
+}
+
+/// Stores 512-bits (composed of 8 packed double-precision (64-bit)
+/// floating-point elements) from `a` into memory.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_storeu_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovups))]
+pub unsafe fn _mm512_storeu_pd(mem_addr: *mut f64, a: __m512d) {
+ ptr::write_unaligned(mem_addr as *mut __m512d, a);
+}
+
+/// Loads 512-bits (composed of 16 packed single-precision (32-bit)
+/// floating-point elements) from memory into result.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_loadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovups))]
+pub unsafe fn _mm512_loadu_ps(mem_addr: *const f32) -> __m512 {
+ ptr::read_unaligned(mem_addr as *const __m512)
+}
+
+/// Stores 512-bits (composed of 16 packed single-precision (32-bit)
+/// floating-point elements) from `a` into memory.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_storeu_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovups))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm512_storeu_ps(mem_addr: *mut f32, a: __m512) {
+ ptr::write_unaligned(mem_addr as *mut __m512, a);
+}
+
+/// Load 512-bits of integer data from memory into dst. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_load_si512&expand=3345)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa32
+pub unsafe fn _mm512_load_si512(mem_addr: *const i32) -> __m512i {
+ ptr::read(mem_addr as *const __m512i)
+}
+
+/// Store 512-bits of integer data from a into memory. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_store_si512&expand=5598)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa32
+pub unsafe fn _mm512_store_si512(mem_addr: *mut i32, a: __m512i) {
+ ptr::write(mem_addr as *mut __m512i, a);
+}
+
+/// Load 512-bits (composed of 16 packed 32-bit integers) from memory into dst. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_load_epi32&expand=3304)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa32
+pub unsafe fn _mm512_load_epi32(mem_addr: *const i32) -> __m512i {
+ ptr::read(mem_addr as *const __m512i)
+}
+
+/// Load 256-bits (composed of 8 packed 32-bit integers) from memory into dst. mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_load_epi32&expand=3301)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa32
+pub unsafe fn _mm256_load_epi32(mem_addr: *const i32) -> __m256i {
+ ptr::read(mem_addr as *const __m256i)
+}
+
+/// Load 128-bits (composed of 4 packed 32-bit integers) from memory into dst. mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load_epi32&expand=3298)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa32
+pub unsafe fn _mm_load_epi32(mem_addr: *const i32) -> __m128i {
+ ptr::read(mem_addr as *const __m128i)
+}
+
+/// Store 512-bits (composed of 16 packed 32-bit integers) from a into memory. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=512_store_epi32&expand=5569)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa32
+pub unsafe fn _mm512_store_epi32(mem_addr: *mut i32, a: __m512i) {
+ ptr::write(mem_addr as *mut __m512i, a);
+}
+
+/// Store 256-bits (composed of 8 packed 32-bit integers) from a into memory. mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_store_epi32&expand=5567)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa32
+pub unsafe fn _mm256_store_epi32(mem_addr: *mut i32, a: __m256i) {
+ ptr::write(mem_addr as *mut __m256i, a);
+}
+
+/// Store 128-bits (composed of 4 packed 32-bit integers) from a into memory. mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store_epi32&expand=5565)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa32
+pub unsafe fn _mm_store_epi32(mem_addr: *mut i32, a: __m128i) {
+ ptr::write(mem_addr as *mut __m128i, a);
+}
+
+/// Load 512-bits (composed of 8 packed 64-bit integers) from memory into dst. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_load_epi64&expand=3313)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa64
+pub unsafe fn _mm512_load_epi64(mem_addr: *const i64) -> __m512i {
+ ptr::read(mem_addr as *const __m512i)
+}
+
+/// Load 256-bits (composed of 4 packed 64-bit integers) from memory into dst. mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_load_epi64&expand=3310)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa64
+pub unsafe fn _mm256_load_epi64(mem_addr: *const i64) -> __m256i {
+ ptr::read(mem_addr as *const __m256i)
+}
+
+/// Load 128-bits (composed of 2 packed 64-bit integers) from memory into dst. mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load_epi64&expand=3307)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa64
+pub unsafe fn _mm_load_epi64(mem_addr: *const i64) -> __m128i {
+ ptr::read(mem_addr as *const __m128i)
+}
+
+/// Store 512-bits (composed of 8 packed 64-bit integers) from a into memory. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_store_epi64&expand=5575)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa64
+pub unsafe fn _mm512_store_epi64(mem_addr: *mut i64, a: __m512i) {
+ ptr::write(mem_addr as *mut __m512i, a);
+}
+
+/// Store 256-bits (composed of 4 packed 64-bit integers) from a into memory. mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_store_epi64&expand=5573)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa64
+pub unsafe fn _mm256_store_epi64(mem_addr: *mut i64, a: __m256i) {
+ ptr::write(mem_addr as *mut __m256i, a);
+}
+
+/// Store 128-bits (composed of 2 packed 64-bit integers) from a into memory. mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store_epi64&expand=5571)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa64
+pub unsafe fn _mm_store_epi64(mem_addr: *mut i64, a: __m128i) {
+ ptr::write(mem_addr as *mut __m128i, a);
+}
+
+/// Load 512-bits (composed of 16 packed single-precision (32-bit) floating-point elements) from memory into dst. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_load_ps&expand=3336)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))]
+pub unsafe fn _mm512_load_ps(mem_addr: *const f32) -> __m512 {
+ ptr::read(mem_addr as *const __m512)
+}
+
+/// Store 512-bits of integer data from a into memory. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_store_ps&expand=5592)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))]
+pub unsafe fn _mm512_store_ps(mem_addr: *mut f32, a: __m512) {
+ ptr::write(mem_addr as *mut __m512, a);
+}
+
+/// Load 512-bits (composed of 8 packed double-precision (64-bit) floating-point elements) from memory into dst. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_load_pd&expand=3326)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovapd
+pub unsafe fn _mm512_load_pd(mem_addr: *const f64) -> __m512d {
+ ptr::read(mem_addr as *const __m512d)
+}
+
+/// Store 512-bits (composed of 8 packed double-precision (64-bit) floating-point elements) from a into memory. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_store_pd&expand=5585)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovapd
+pub unsafe fn _mm512_store_pd(mem_addr: *mut f64, a: __m512d) {
+ ptr::write(mem_addr as *mut __m512d, a);
+}
+
+/// Load packed 32-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_loadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_loadu_epi32(src: __m512i, k: __mmask16, mem_addr: *const i32) -> __m512i {
+ let mut dst: __m512i = src;
+ asm!(
+ vpl!("vmovdqu32 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_loadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_loadu_epi32(k: __mmask16, mem_addr: *const i32) -> __m512i {
+ let mut dst: __m512i;
+ asm!(
+ vpl!("vmovdqu32 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_loadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_loadu_epi64(src: __m512i, k: __mmask8, mem_addr: *const i64) -> __m512i {
+ let mut dst: __m512i = src;
+ asm!(
+ vpl!("vmovdqu64 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_loadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m512i {
+ let mut dst: __m512i;
+ asm!(
+ vpl!("vmovdqu64 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_loadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_loadu_ps(src: __m512, k: __mmask16, mem_addr: *const f32) -> __m512 {
+ let mut dst: __m512 = src;
+ asm!(
+ vpl!("vmovups {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_loadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_loadu_ps(k: __mmask16, mem_addr: *const f32) -> __m512 {
+ let mut dst: __m512;
+ asm!(
+ vpl!("vmovups {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_loadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_loadu_pd(src: __m512d, k: __mmask8, mem_addr: *const f64) -> __m512d {
+ let mut dst: __m512d = src;
+ asm!(
+ vpl!("vmovupd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_loadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m512d {
+ let mut dst: __m512d;
+ asm!(
+ vpl!("vmovupd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_loadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_loadu_epi32(src: __m256i, k: __mmask8, mem_addr: *const i32) -> __m256i {
+ let mut dst: __m256i = src;
+ asm!(
+ vpl!("vmovdqu32 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_loadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_loadu_epi32(k: __mmask8, mem_addr: *const i32) -> __m256i {
+ let mut dst: __m256i;
+ asm!(
+ vpl!("vmovdqu32 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_loadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_loadu_epi64(src: __m256i, k: __mmask8, mem_addr: *const i64) -> __m256i {
+ let mut dst: __m256i = src;
+ asm!(
+ vpl!("vmovdqu64 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_loadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m256i {
+ let mut dst: __m256i;
+ asm!(
+ vpl!("vmovdqu64 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_loadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_loadu_ps(src: __m256, k: __mmask8, mem_addr: *const f32) -> __m256 {
+ let mut dst: __m256 = src;
+ asm!(
+ vpl!("vmovups {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_loadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_loadu_ps(k: __mmask8, mem_addr: *const f32) -> __m256 {
+ let mut dst: __m256;
+ asm!(
+ vpl!("vmovups {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_loadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_loadu_pd(src: __m256d, k: __mmask8, mem_addr: *const f64) -> __m256d {
+ let mut dst: __m256d = src;
+ asm!(
+ vpl!("vmovupd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_loadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m256d {
+ let mut dst: __m256d;
+ asm!(
+ vpl!("vmovupd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_loadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_loadu_epi32(src: __m128i, k: __mmask8, mem_addr: *const i32) -> __m128i {
+ let mut dst: __m128i = src;
+ asm!(
+ vpl!("vmovdqu32 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_loadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_loadu_epi32(k: __mmask8, mem_addr: *const i32) -> __m128i {
+ let mut dst: __m128i;
+ asm!(
+ vpl!("vmovdqu32 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_loadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_loadu_epi64(src: __m128i, k: __mmask8, mem_addr: *const i64) -> __m128i {
+ let mut dst: __m128i = src;
+ asm!(
+ vpl!("vmovdqu64 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_loadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m128i {
+ let mut dst: __m128i;
+ asm!(
+ vpl!("vmovdqu64 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_loadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_loadu_ps(src: __m128, k: __mmask8, mem_addr: *const f32) -> __m128 {
+ let mut dst: __m128 = src;
+ asm!(
+ vpl!("vmovups {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_loadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_loadu_ps(k: __mmask8, mem_addr: *const f32) -> __m128 {
+ let mut dst: __m128;
+ asm!(
+ vpl!("vmovups {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_loadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_loadu_pd(src: __m128d, k: __mmask8, mem_addr: *const f64) -> __m128d {
+ let mut dst: __m128d = src;
+ asm!(
+ vpl!("vmovupd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_loadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m128d {
+ let mut dst: __m128d;
+ asm!(
+ vpl!("vmovupd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_load_epi32)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_load_epi32(src: __m512i, k: __mmask16, mem_addr: *const i32) -> __m512i {
+ let mut dst: __m512i = src;
+ asm!(
+ vpl!("vmovdqa32 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_load_epi32)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_load_epi32(k: __mmask16, mem_addr: *const i32) -> __m512i {
+ let mut dst: __m512i;
+ asm!(
+ vpl!("vmovdqa32 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_load_epi64)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_load_epi64(src: __m512i, k: __mmask8, mem_addr: *const i64) -> __m512i {
+ let mut dst: __m512i = src;
+ asm!(
+ vpl!("vmovdqa64 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_load_epi64)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m512i {
+ let mut dst: __m512i;
+ asm!(
+ vpl!("vmovdqa64 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_load_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_load_ps(src: __m512, k: __mmask16, mem_addr: *const f32) -> __m512 {
+ let mut dst: __m512 = src;
+ asm!(
+ vpl!("vmovaps {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_load_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_load_ps(k: __mmask16, mem_addr: *const f32) -> __m512 {
+ let mut dst: __m512;
+ asm!(
+ vpl!("vmovaps {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_load_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_load_pd(src: __m512d, k: __mmask8, mem_addr: *const f64) -> __m512d {
+ let mut dst: __m512d = src;
+ asm!(
+ vpl!("vmovapd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_load_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m512d {
+ let mut dst: __m512d;
+ asm!(
+ vpl!("vmovapd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_load_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_load_epi32(src: __m256i, k: __mmask8, mem_addr: *const i32) -> __m256i {
+ let mut dst: __m256i = src;
+ asm!(
+ vpl!("vmovdqa32 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_load_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_load_epi32(k: __mmask8, mem_addr: *const i32) -> __m256i {
+ let mut dst: __m256i;
+ asm!(
+ vpl!("vmovdqa32 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_load_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_load_epi64(src: __m256i, k: __mmask8, mem_addr: *const i64) -> __m256i {
+ let mut dst: __m256i = src;
+ asm!(
+ vpl!("vmovdqa64 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_load_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m256i {
+ let mut dst: __m256i;
+ asm!(
+ vpl!("vmovdqa64 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_load_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_load_ps(src: __m256, k: __mmask8, mem_addr: *const f32) -> __m256 {
+ let mut dst: __m256 = src;
+ asm!(
+ vpl!("vmovaps {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_load_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_load_ps(k: __mmask8, mem_addr: *const f32) -> __m256 {
+ let mut dst: __m256;
+ asm!(
+ vpl!("vmovaps {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_load_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_load_pd(src: __m256d, k: __mmask8, mem_addr: *const f64) -> __m256d {
+ let mut dst: __m256d = src;
+ asm!(
+ vpl!("vmovapd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_load_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m256d {
+ let mut dst: __m256d;
+ asm!(
+ vpl!("vmovapd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_load_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_load_epi32(src: __m128i, k: __mmask8, mem_addr: *const i32) -> __m128i {
+ let mut dst: __m128i = src;
+ asm!(
+ vpl!("vmovdqa32 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 32-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_load_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_load_epi32(k: __mmask8, mem_addr: *const i32) -> __m128i {
+ let mut dst: __m128i;
+ asm!(
+ vpl!("vmovdqa32 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_load_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_load_epi64(src: __m128i, k: __mmask8, mem_addr: *const i64) -> __m128i {
+ let mut dst: __m128i = src;
+ asm!(
+ vpl!("vmovdqa64 {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed 64-bit integers from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_load_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m128i {
+ let mut dst: __m128i;
+ asm!(
+ vpl!("vmovdqa64 {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_load_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_load_ps(src: __m128, k: __mmask8, mem_addr: *const f32) -> __m128 {
+ let mut dst: __m128 = src;
+ asm!(
+ vpl!("vmovaps {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed single-precision (32-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_load_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_load_ps(k: __mmask8, mem_addr: *const f32) -> __m128 {
+ let mut dst: __m128;
+ asm!(
+ vpl!("vmovaps {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using writemask k
+/// (elements are copied from src when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_load_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_load_pd(src: __m128d, k: __mmask8, mem_addr: *const f64) -> __m128d {
+ let mut dst: __m128d = src;
+ asm!(
+ vpl!("vmovapd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load packed double-precision (64-bit) floating-point elements from memory into dst using zeromask k
+/// (elements are zeroed out when the corresponding mask bit is not set).
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_load_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m128d {
+ let mut dst: __m128d;
+ asm!(
+ vpl!("vmovapd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Store packed 32-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_storeu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask16, a: __m512i) {
+ asm!(
+ vps!("vmovdqu32", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(zmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 64-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_storeu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m512i) {
+ asm!(
+ vps!("vmovdqu64", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(zmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed single-precision (32-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_storeu_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask16, a: __m512) {
+ asm!(
+ vps!("vmovups", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(zmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed double-precision (64-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_storeu_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m512d) {
+ asm!(
+ vps!("vmovupd", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(zmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 32-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_storeu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m256i) {
+ asm!(
+ vps!("vmovdqu32", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(ymm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 64-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_storeu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m256i) {
+ asm!(
+ vps!("vmovdqu64", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(ymm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed single-precision (32-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_storeu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask8, a: __m256) {
+ asm!(
+ vps!("vmovups", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(ymm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed double-precision (64-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_storeu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m256d) {
+ asm!(
+ vps!("vmovupd", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(ymm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 32-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_storeu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m128i) {
+ asm!(
+ vps!("vmovdqu32", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(xmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 64-bit integers from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_storeu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m128i) {
+ asm!(
+ vps!("vmovdqu64", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(xmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed single-precision (32-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_storeu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask8, a: __m128) {
+ asm!(
+ vps!("vmovups", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(xmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed double-precision (64-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_storeu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m128d) {
+ asm!(
+ vps!("vmovupd", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(xmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 32-bit integers from a into memory using writemask k.
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_store_epi32)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_store_epi32(mem_addr: *mut i32, mask: __mmask16, a: __m512i) {
+ asm!(
+ vps!("vmovdqa32", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(zmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 64-bit integers from a into memory using writemask k.
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_store_epi64)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m512i) {
+ asm!(
+ vps!("vmovdqa64", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(zmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed single-precision (32-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_store_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_store_ps(mem_addr: *mut f32, mask: __mmask16, a: __m512) {
+ asm!(
+ vps!("vmovaps", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(zmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed double-precision (64-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_store_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m512d) {
+ asm!(
+ vps!("vmovapd", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(zmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 32-bit integers from a into memory using writemask k.
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_store_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_store_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m256i) {
+ asm!(
+ vps!("vmovdqa32", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(ymm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 64-bit integers from a into memory using writemask k.
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_store_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m256i) {
+ asm!(
+ vps!("vmovdqa64", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(ymm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed single-precision (32-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_store_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_store_ps(mem_addr: *mut f32, mask: __mmask8, a: __m256) {
+ asm!(
+ vps!("vmovaps", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(ymm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed double-precision (64-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr must be aligned on a 32-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_store_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m256d) {
+ asm!(
+ vps!("vmovapd", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(ymm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 32-bit integers from a into memory using writemask k.
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_store_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_store_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m128i) {
+ asm!(
+ vps!("vmovdqa32", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(xmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed 64-bit integers from a into memory using writemask k.
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_store_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m128i) {
+ asm!(
+ vps!("vmovdqa64", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(xmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed single-precision (32-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_store_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_store_ps(mem_addr: *mut f32, mask: __mmask8, a: __m128) {
+ asm!(
+ vps!("vmovaps", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(xmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Store packed double-precision (64-bit) floating-point elements from a into memory using writemask k.
+/// mem_addr must be aligned on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_store_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m128d) {
+ asm!(
+ vps!("vmovapd", "{{{mask}}}, {a}"),
+ p = in(reg) mem_addr,
+ mask = in(kreg) mask,
+ a = in(xmm_reg) a,
+ options(nostack)
+ );
+}
+
+/// Load contiguous active 32-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expandloadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_expandloadu_epi32(
+ src: __m512i,
+ k: __mmask16,
+ mem_addr: *const i32,
+) -> __m512i {
+ let mut dst: __m512i = src;
+ asm!(
+ vpl!("vpexpandd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 32-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expandloadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_expandloadu_epi32(k: __mmask16, mem_addr: *const i32) -> __m512i {
+ let mut dst: __m512i;
+ asm!(
+ vpl!("vpexpandd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 32-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expandloadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_expandloadu_epi32(
+ src: __m256i,
+ k: __mmask8,
+ mem_addr: *const i32,
+) -> __m256i {
+ let mut dst: __m256i = src;
+ asm!(
+ vpl!("vpexpandd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 32-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expandloadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_expandloadu_epi32(k: __mmask8, mem_addr: *const i32) -> __m256i {
+ let mut dst: __m256i;
+ asm!(
+ vpl!("vpexpandd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 32-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expandloadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_expandloadu_epi32(
+ src: __m128i,
+ k: __mmask8,
+ mem_addr: *const i32,
+) -> __m128i {
+ let mut dst: __m128i = src;
+ asm!(
+ vpl!("vpexpandd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 32-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expandloadu_epi32)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_expandloadu_epi32(k: __mmask8, mem_addr: *const i32) -> __m128i {
+ let mut dst: __m128i;
+ asm!(
+ vpl!("vpexpandd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 64-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expandloadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_expandloadu_epi64(
+ src: __m512i,
+ k: __mmask8,
+ mem_addr: *const i64,
+) -> __m512i {
+ let mut dst: __m512i = src;
+ asm!(
+ vpl!("vpexpandq {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 64-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expandloadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_expandloadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m512i {
+ let mut dst: __m512i;
+ asm!(
+ vpl!("vpexpandq {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 64-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expandloadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_expandloadu_epi64(
+ src: __m256i,
+ k: __mmask8,
+ mem_addr: *const i64,
+) -> __m256i {
+ let mut dst: __m256i = src;
+ asm!(
+ vpl!("vpexpandq {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 64-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expandloadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_expandloadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m256i {
+ let mut dst: __m256i;
+ asm!(
+ vpl!("vpexpandq {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 64-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expandloadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_expandloadu_epi64(
+ src: __m128i,
+ k: __mmask8,
+ mem_addr: *const i64,
+) -> __m128i {
+ let mut dst: __m128i = src;
+ asm!(
+ vpl!("vpexpandq {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 64-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expandloadu_epi64)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_expandloadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m128i {
+ let mut dst: __m128i;
+ asm!(
+ vpl!("vpexpandq {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expandloadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_expandloadu_ps(
+ src: __m512,
+ k: __mmask16,
+ mem_addr: *const f32,
+) -> __m512 {
+ let mut dst: __m512 = src;
+ asm!(
+ vpl!("vexpandps {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expandloadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_expandloadu_ps(k: __mmask16, mem_addr: *const f32) -> __m512 {
+ let mut dst: __m512;
+ asm!(
+ vpl!("vexpandps {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expandloadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_expandloadu_ps(src: __m256, k: __mmask8, mem_addr: *const f32) -> __m256 {
+ let mut dst: __m256 = src;
+ asm!(
+ vpl!("vexpandps {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expandloadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_expandloadu_ps(k: __mmask8, mem_addr: *const f32) -> __m256 {
+ let mut dst: __m256;
+ asm!(
+ vpl!("vexpandps {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expandloadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_expandloadu_ps(src: __m128, k: __mmask8, mem_addr: *const f32) -> __m128 {
+ let mut dst: __m128 = src;
+ asm!(
+ vpl!("vexpandps {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (32-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expandloadu_ps)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_expandloadu_ps(k: __mmask8, mem_addr: *const f32) -> __m128 {
+ let mut dst: __m128;
+ asm!(
+ vpl!("vexpandps {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (64-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expandloadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_mask_expandloadu_pd(
+ src: __m512d,
+ k: __mmask8,
+ mem_addr: *const f64,
+) -> __m512d {
+ let mut dst: __m512d = src;
+ asm!(
+ vpl!("vexpandpd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (64-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expandloadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_maskz_expandloadu_pd(k: __mmask8, mem_addr: *const f64) -> __m512d {
+ let mut dst: __m512d;
+ asm!(
+ vpl!("vexpandpd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (64-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expandloadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_mask_expandloadu_pd(
+ src: __m256d,
+ k: __mmask8,
+ mem_addr: *const f64,
+) -> __m256d {
+ let mut dst: __m256d = src;
+ asm!(
+ vpl!("vexpandpd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (64-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expandloadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_expandloadu_pd(k: __mmask8, mem_addr: *const f64) -> __m256d {
+ let mut dst: __m256d;
+ asm!(
+ vpl!("vexpandpd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (64-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expandloadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_expandloadu_pd(src: __m128d, k: __mmask8, mem_addr: *const f64) -> __m128d {
+ let mut dst: __m128d = src;
+ asm!(
+ vpl!("vexpandpd {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active single-precision (64-bit) floating-point elements from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expandloadu_pd)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_expandloadu_pd(k: __mmask8, mem_addr: *const f64) -> __m128d {
+ let mut dst: __m128d;
+ asm!(
+ vpl!("vexpandpd {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Set packed double-precision (64-bit) floating-point elements in dst with the supplied values in reverse order.
+///
+/// [Intel's documentation]( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setr_pd&expand=5002)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_setr_pd(
+ e0: f64,
+ e1: f64,
+ e2: f64,
+ e3: f64,
+ e4: f64,
+ e5: f64,
+ e6: f64,
+ e7: f64,
+) -> __m512d {
+ let r = f64x8::new(e0, e1, e2, e3, e4, e5, e6, e7);
+ transmute(r)
+}
+
+/// Set packed double-precision (64-bit) floating-point elements in dst with the supplied values.
+///
+/// [Intel's documentation]( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set_pd&expand=4924)
+#[inline]
+#[target_feature(enable = "avx512f")]
+pub unsafe fn _mm512_set_pd(
+ e0: f64,
+ e1: f64,
+ e2: f64,
+ e3: f64,
+ e4: f64,
+ e5: f64,
+ e6: f64,
+ e7: f64,
+) -> __m512d {
+ _mm512_setr_pd(e7, e6, e5, e4, e3, e2, e1, e0)
+}
+
+/// Move the lower single-precision (32-bit) floating-point element from b to the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_move_ss&expand=3832)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovss))]
+pub unsafe fn _mm_mask_move_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let extractsrc: f32 = simd_extract(src, 0);
+ let mut mov: f32 = extractsrc;
+ if (k & 0b00000001) != 0 {
+ mov = simd_extract(b, 0);
+ }
+ let r = simd_insert(a, 0, mov);
+ transmute(r)
+}
+
+/// Move the lower single-precision (32-bit) floating-point element from b to the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_move_ss&expand=3833)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovss))]
+pub unsafe fn _mm_maskz_move_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let mut mov: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ mov = simd_extract(b, 0);
+ }
+ let r = simd_insert(a, 0, mov);
+ transmute(r)
+}
+
+/// Move the lower double-precision (64-bit) floating-point element from b to the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_move_sd&expand=3829)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovsd))]
+pub unsafe fn _mm_mask_move_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let extractsrc: f64 = simd_extract(src, 0);
+ let mut mov: f64 = extractsrc;
+ if (k & 0b00000001) != 0 {
+ mov = simd_extract(b, 0);
+ }
+ let r = simd_insert(a, 0, mov);
+ transmute(r)
+}
+
+/// Move the lower double-precision (64-bit) floating-point element from b to the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_move_sd&expand=3830)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmovsd))]
+pub unsafe fn _mm_maskz_move_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let mut mov: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ mov = simd_extract(b, 0);
+ }
+ let r = simd_insert(a, 0, mov);
+ transmute(r)
+}
+
+/// Add the lower single-precision (32-bit) floating-point element in a and b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_add_ss&expand=159)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddss))]
+pub unsafe fn _mm_mask_add_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let extractsrc: f32 = simd_extract(src, 0);
+ let mut add: f32 = extractsrc;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ add = extracta + extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Add the lower single-precision (32-bit) floating-point element in a and b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_add_ss&expand=160)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddss))]
+pub unsafe fn _mm_maskz_add_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let mut add: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ add = extracta + extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Add the lower double-precision (64-bit) floating-point element in a and b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_add_sd&expand=155)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddsd))]
+pub unsafe fn _mm_mask_add_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let extractsrc: f64 = simd_extract(src, 0);
+ let mut add: f64 = extractsrc;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ add = extracta + extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Add the lower double-precision (64-bit) floating-point element in a and b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_add_sd&expand=156)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddsd))]
+pub unsafe fn _mm_maskz_add_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let mut add: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ add = extracta + extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Subtract the lower single-precision (32-bit) floating-point element in b from the lower single-precision (32-bit) floating-point element in a, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_sub_ss&expand=5750)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubss))]
+pub unsafe fn _mm_mask_sub_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let extractsrc: f32 = simd_extract(src, 0);
+ let mut add: f32 = extractsrc;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ add = extracta - extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Subtract the lower single-precision (32-bit) floating-point element in b from the lower single-precision (32-bit) floating-point element in a, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_sub_ss&expand=5751)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubss))]
+pub unsafe fn _mm_maskz_sub_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let mut add: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ add = extracta - extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Subtract the lower double-precision (64-bit) floating-point element in b from the lower double-precision (64-bit) floating-point element in a, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_sub_sd&expand=5746)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubsd))]
+pub unsafe fn _mm_mask_sub_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let extractsrc: f64 = simd_extract(src, 0);
+ let mut add: f64 = extractsrc;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ add = extracta - extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Subtract the lower double-precision (64-bit) floating-point element in b from the lower double-precision (64-bit) floating-point element in a, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_sub_sd&expand=5747)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubsd))]
+pub unsafe fn _mm_maskz_sub_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let mut add: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ add = extracta - extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point element in a and b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_mul_ss&expand=3950)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulss))]
+pub unsafe fn _mm_mask_mul_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let extractsrc: f32 = simd_extract(src, 0);
+ let mut add: f32 = extractsrc;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ add = extracta * extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point element in a and b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_mul_ss&expand=3951)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulss))]
+pub unsafe fn _mm_maskz_mul_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let mut add: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ add = extracta * extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point element in a and b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_mul_sd&expand=3947)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulsd))]
+pub unsafe fn _mm_mask_mul_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let extractsrc: f64 = simd_extract(src, 0);
+ let mut add: f64 = extractsrc;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ add = extracta * extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point element in a and b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_mul_sd&expand=3948)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulsd))]
+pub unsafe fn _mm_maskz_mul_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let mut add: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ add = extracta * extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Divide the lower single-precision (32-bit) floating-point element in a by the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_div_ss&expand=2181)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivss))]
+pub unsafe fn _mm_mask_div_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let extractsrc: f32 = simd_extract(src, 0);
+ let mut add: f32 = extractsrc;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ add = extracta / extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Divide the lower single-precision (32-bit) floating-point element in a by the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_div_ss&expand=2182)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivss))]
+pub unsafe fn _mm_maskz_div_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let mut add: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ add = extracta / extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Divide the lower double-precision (64-bit) floating-point element in a by the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_div_sd&expand=2178)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivsd))]
+pub unsafe fn _mm_mask_div_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let extractsrc: f64 = simd_extract(src, 0);
+ let mut add: f64 = extractsrc;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ add = extracta / extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Divide the lower double-precision (64-bit) floating-point element in a by the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_div_sd&expand=2179)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivsd))]
+pub unsafe fn _mm_maskz_div_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ let mut add: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ add = extracta / extractb;
+ }
+ let r = simd_insert(a, 0, add);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point elements in a and b, store the maximum value in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_max_ss&expand=3672)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxss))]
+pub unsafe fn _mm_mask_max_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vmaxss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ src.as_f32x4(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Compare the lower single-precision (32-bit) floating-point elements in a and b, store the maximum value in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_max_ss&expand=3673)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxss))]
+pub unsafe fn _mm_maskz_max_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vmaxss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Compare the lower double-precision (64-bit) floating-point elements in a and b, store the maximum value in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_max_sd&expand=3669)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxsd))]
+pub unsafe fn _mm_mask_max_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vmaxsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ src.as_f64x2(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Compare the lower double-precision (64-bit) floating-point elements in a and b, store the maximum value in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_max_sd&expand=3670)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxsd))]
+pub unsafe fn _mm_maskz_max_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vmaxsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Compare the lower single-precision (32-bit) floating-point elements in a and b, store the minimum value in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_min_ss&expand=3786)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminss))]
+pub unsafe fn _mm_mask_min_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vminss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ src.as_f32x4(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Compare the lower single-precision (32-bit) floating-point elements in a and b, store the minimum value in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_min_ss&expand=3787)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminss))]
+pub unsafe fn _mm_maskz_min_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vminss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Compare the lower double-precision (64-bit) floating-point elements in a and b, store the minimum value in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_min_sd&expand=3783)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminsd))]
+pub unsafe fn _mm_mask_min_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vminsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ src.as_f64x2(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Compare the lower double-precision (64-bit) floating-point elements in a and b, store the minimum value in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_min_sd&expand=3784)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminsd))]
+pub unsafe fn _mm_maskz_min_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vminsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Compute the square root of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_sqrt_ss&expand=5387)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtss))]
+pub unsafe fn _mm_mask_sqrt_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vsqrtss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ src.as_f32x4(),
+ k,
+ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Compute the square root of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_sqrt_ss&expand=5388)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtss))]
+pub unsafe fn _mm_maskz_sqrt_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vsqrtss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ k,
+ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Compute the square root of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_sqrt_sd&expand=5384)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtsd))]
+pub unsafe fn _mm_mask_sqrt_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vsqrtsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ src.as_f64x2(),
+ k,
+ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Compute the square root of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_sqrt_sd&expand=5385)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtsd))]
+pub unsafe fn _mm_maskz_sqrt_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vsqrtsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ k,
+ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Compute the approximate reciprocal square root of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_rsqrt14_ss&expand=4825)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14ss))]
+pub unsafe fn _mm_rsqrt14_ss(a: __m128, b: __m128) -> __m128 {
+ transmute(vrsqrt14ss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ 0b1,
+ ))
+}
+
+/// Compute the approximate reciprocal square root of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_rsqrt14_ss&expand=4823)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14ss))]
+pub unsafe fn _mm_mask_rsqrt14_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vrsqrt14ss(a.as_f32x4(), b.as_f32x4(), src.as_f32x4(), k))
+}
+
+/// Compute the approximate reciprocal square root of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_rsqrt14_ss&expand=4824)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14ss))]
+pub unsafe fn _mm_maskz_rsqrt14_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vrsqrt14ss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ k,
+ ))
+}
+
+/// Compute the approximate reciprocal square root of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_rsqrt14_sd&expand=4822)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14sd))]
+pub unsafe fn _mm_rsqrt14_sd(a: __m128d, b: __m128d) -> __m128d {
+ transmute(vrsqrt14sd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ 0b1,
+ ))
+}
+
+/// Compute the approximate reciprocal square root of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_rsqrt14_sd&expand=4820)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14sd))]
+pub unsafe fn _mm_mask_rsqrt14_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vrsqrt14sd(a.as_f64x2(), b.as_f64x2(), src.as_f64x2(), k))
+}
+
+/// Compute the approximate reciprocal square root of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_rsqrt14_sd&expand=4821)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrsqrt14sd))]
+pub unsafe fn _mm_maskz_rsqrt14_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vrsqrt14sd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ k,
+ ))
+}
+
+/// Compute the approximate reciprocal of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_rcp14_ss&expand=4508)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14ss))]
+pub unsafe fn _mm_rcp14_ss(a: __m128, b: __m128) -> __m128 {
+ transmute(vrcp14ss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ 0b1,
+ ))
+}
+
+/// Compute the approximate reciprocal of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_rcp14_ss&expand=4506)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14ss))]
+pub unsafe fn _mm_mask_rcp14_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vrcp14ss(a.as_f32x4(), b.as_f32x4(), src.as_f32x4(), k))
+}
+
+/// Compute the approximate reciprocal of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_rcp14_ss&expand=4507)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14ss))]
+pub unsafe fn _mm_maskz_rcp14_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vrcp14ss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ k,
+ ))
+}
+
+/// Compute the approximate reciprocal of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_rcp14_sd&expand=4505)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14sd))]
+pub unsafe fn _mm_rcp14_sd(a: __m128d, b: __m128d) -> __m128d {
+ transmute(vrcp14sd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ 0b1,
+ ))
+}
+
+/// Compute the approximate reciprocal of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_rcp14_sd&expand=4503)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14sd))]
+pub unsafe fn _mm_mask_rcp14_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vrcp14sd(a.as_f64x2(), b.as_f64x2(), src.as_f64x2(), k))
+}
+
+/// Compute the approximate reciprocal of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. The maximum relative error for this approximation is less than 2^-14.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_rcp14_sd&expand=4504)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrcp14sd))]
+pub unsafe fn _mm_maskz_rcp14_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vrcp14sd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ k,
+ ))
+}
+
+/// Convert the exponent of the lower single-precision (32-bit) floating-point element in b to a single-precision (32-bit) floating-point number representing the integer exponent, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_getexp_ss&expand=2862)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpss))]
+pub unsafe fn _mm_getexp_ss(a: __m128, b: __m128) -> __m128 {
+ transmute(vgetexpss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ 0b1,
+ _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Convert the exponent of the lower single-precision (32-bit) floating-point element in b to a single-precision (32-bit) floating-point number representing the integer exponent, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_getexp_ss&expand=2863)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpss))]
+pub unsafe fn _mm_mask_getexp_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vgetexpss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ src.as_f32x4(),
+ k,
+ _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Convert the exponent of the lower single-precision (32-bit) floating-point element in b to a single-precision (32-bit) floating-point number representing the integer exponent, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_getexp_ss&expand=2864)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpss))]
+pub unsafe fn _mm_maskz_getexp_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vgetexpss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ k,
+ _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Convert the exponent of the lower double-precision (64-bit) floating-point element in b to a double-precision (64-bit) floating-point number representing the integer exponent, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_getexp_sd&expand=2859)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpsd))]
+pub unsafe fn _mm_getexp_sd(a: __m128d, b: __m128d) -> __m128d {
+ transmute(vgetexpsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ 0b1,
+ _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Convert the exponent of the lower double-precision (64-bit) floating-point element in b to a double-precision (64-bit) floating-point number representing the integer exponent, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_getexp_sd&expand=2860)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpsd))]
+pub unsafe fn _mm_mask_getexp_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vgetexpsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ src.as_f64x2(),
+ k,
+ _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Convert the exponent of the lower double-precision (64-bit) floating-point element in b to a double-precision (64-bit) floating-point number representing the integer exponent, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_getexp_sd&expand=2861)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpsd))]
+pub unsafe fn _mm_maskz_getexp_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vgetexpsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ k,
+ _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Normalize the mantissas of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_getmant_ss&expand=2898)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantss, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm_getmant_ss<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vgetmantss(a, b, SIGN << 2 | NORM, zero, 0b1, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_getmant_ss&expand=2899)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantss, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm_mask_getmant_ss<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vgetmantss(a, b, SIGN << 2 | NORM, src, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_getmant_ss&expand=2900)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantss, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm_maskz_getmant_ss<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vgetmantss(a, b, SIGN << 2 | NORM, zero, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_getmant_sd&expand=2895)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantsd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm_getmant_sd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vgetmantsd(a, b, SIGN << 2 | NORM, zero, 0b1, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_getmant_sd&expand=2896)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantsd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm_mask_getmant_sd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vgetmantsd(a, b, SIGN << 2 | NORM, src, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_getmant_sd&expand=2897)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantsd, NORM = 0, SIGN = 0))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm_maskz_getmant_sd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vgetmantsd(a, b, SIGN << 2 | NORM, zero, k, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round the lower single-precision (32-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_roundscale_ss&expand=4802)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaless, IMM8 = 255))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_roundscale_ss<const IMM8: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vrndscaless(a, b, zero, 0b11111111, IMM8, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round the lower single-precision (32-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_roundscale_ss&expand=4800)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaless, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_roundscale_ss<const IMM8: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vrndscaless(a, b, src, k, IMM8, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round the lower single-precision (32-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_roundscale_ss&expand=4801)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaless, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_roundscale_ss<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vrndscaless(a, b, zero, k, IMM8, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round the lower double-precision (64-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_roundscale_sd&expand=4799)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalesd, IMM8 = 255))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_roundscale_sd<const IMM8: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vrndscalesd(a, b, zero, 0b11111111, IMM8, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round the lower double-precision (64-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_roundscale_sd&expand=4797)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalesd, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_roundscale_sd<const IMM8: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vrndscalesd(a, b, src, k, IMM8, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Round the lower double-precision (64-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_roundscale_sd&expand=4798)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalesd, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_roundscale_sd<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vrndscalesd(a, b, zero, k, IMM8, _MM_FROUND_CUR_DIRECTION);
+ transmute(r)
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_scalef_ss&expand=4901)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefss))]
+pub unsafe fn _mm_scalef_ss(a: __m128, b: __m128) -> __m128 {
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ transmute(vscalefss(a, b, zero, 0b11111111, _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_scalef_ss&expand=4899)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefss))]
+pub unsafe fn _mm_mask_scalef_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ transmute(vscalefss(a, b, src, k, _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_scalef_ss&expand=4900)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefss))]
+pub unsafe fn _mm_maskz_scalef_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ transmute(vscalefss(
+ a.as_f32x4(),
+ b.as_f32x4(),
+ _mm_setzero_ps().as_f32x4(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_scalef_sd&expand=4898)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefsd))]
+pub unsafe fn _mm_scalef_sd(a: __m128d, b: __m128d) -> __m128d {
+ transmute(vscalefsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ 0b11111111,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_scalef_sd&expand=4896)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefsd))]
+pub unsafe fn _mm_mask_scalef_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vscalefsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ src.as_f64x2(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_scalef_sd&expand=4897)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefsd))]
+pub unsafe fn _mm_maskz_scalef_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d {
+ transmute(vscalefsd(
+ a.as_f64x2(),
+ b.as_f64x2(),
+ _mm_setzero_pd().as_f64x2(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fmadd_ss&expand=2582)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213ss))]
+pub unsafe fn _mm_mask_fmadd_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 {
+ let mut fmadd: f32 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ fmadd = vfmadd132ss(fmadd, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fmadd_ss&expand=2584)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213ss))]
+pub unsafe fn _mm_maskz_fmadd_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 {
+ let mut fmadd: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ fmadd = vfmadd132ss(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper 3 packed elements from c to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fmadd_ss&expand=2583)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213ss))]
+pub unsafe fn _mm_mask3_fmadd_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 {
+ let mut fmadd: f32 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ fmadd = vfmadd132ss(extracta, extractb, fmadd, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(c, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fmadd_sd&expand=2578)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213sd))]
+pub unsafe fn _mm_mask_fmadd_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d {
+ let mut fmadd: f64 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ fmadd = vfmadd132sd(fmadd, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fmadd_sd&expand=2580)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213sd))]
+pub unsafe fn _mm_maskz_fmadd_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ let mut fmadd: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ fmadd = vfmadd132sd(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper element from c to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fmadd_sd&expand=2579)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213sd))]
+pub unsafe fn _mm_mask3_fmadd_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d {
+ let mut fmadd: f64 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ fmadd = vfmadd132sd(extracta, extractb, fmadd, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(c, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fmsub_ss&expand=2668)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213ss))]
+pub unsafe fn _mm_mask_fmsub_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 {
+ let mut fmsub: f32 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fmsub = vfmadd132ss(fmsub, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fmsub_ss&expand=2670)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213ss))]
+pub unsafe fn _mm_maskz_fmsub_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 {
+ let mut fmsub: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fmsub = vfmadd132ss(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper 3 packed elements from c to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fmsub_ss&expand=2669)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213ss))]
+pub unsafe fn _mm_mask3_fmsub_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 {
+ let mut fmsub: f32 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc = -fmsub;
+ fmsub = vfmadd132ss(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(c, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fmsub_sd&expand=2664)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213sd))]
+pub unsafe fn _mm_mask_fmsub_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d {
+ let mut fmsub: f64 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fmsub = vfmadd132sd(fmsub, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fmsub_sd&expand=2666)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213sd))]
+pub unsafe fn _mm_maskz_fmsub_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ let mut fmsub: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fmsub = vfmadd132sd(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper element from c to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fmsub_sd&expand=2665)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213sd))]
+pub unsafe fn _mm_mask3_fmsub_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d {
+ let mut fmsub: f64 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc = -fmsub;
+ fmsub = vfmadd132sd(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(c, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fnmadd_ss&expand=2748)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213ss))]
+pub unsafe fn _mm_mask_fnmadd_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 {
+ let mut fnmadd: f32 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta = -fnmadd;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ fnmadd = vfmadd132ss(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fnmadd_ss&expand=2750)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213ss))]
+pub unsafe fn _mm_maskz_fnmadd_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 {
+ let mut fnmadd: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ fnmadd = vfmadd132ss(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper 3 packed elements from c to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fnmadd_ss&expand=2749)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213ss))]
+pub unsafe fn _mm_mask3_fnmadd_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 {
+ let mut fnmadd: f32 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f32 = simd_extract(b, 0);
+ fnmadd = vfmadd132ss(extracta, extractb, fnmadd, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(c, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fnmadd_sd&expand=2744)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213sd))]
+pub unsafe fn _mm_mask_fnmadd_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d {
+ let mut fnmadd: f64 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta = -fnmadd;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ fnmadd = vfmadd132sd(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fnmadd_sd&expand=2746)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213sd))]
+pub unsafe fn _mm_maskz_fnmadd_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ let mut fnmadd: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ fnmadd = vfmadd132sd(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper element from c to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fnmadd_sd&expand=2745)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213sd))]
+pub unsafe fn _mm_mask3_fnmadd_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d {
+ let mut fnmadd: f64 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f64 = simd_extract(b, 0);
+ fnmadd = vfmadd132sd(extracta, extractb, fnmadd, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(c, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fnmsub_ss&expand=2796)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213ss))]
+pub unsafe fn _mm_mask_fnmsub_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 {
+ let mut fnmsub: f32 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta = -fnmsub;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fnmsub = vfmadd132ss(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fnmsub_ss&expand=2798)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213ss))]
+pub unsafe fn _mm_maskz_fnmsub_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 {
+ let mut fnmsub: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fnmsub = vfmadd132ss(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper 3 packed elements from c to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fnmsub_ss&expand=2797)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213ss))]
+pub unsafe fn _mm_mask3_fnmsub_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 {
+ let mut fnmsub: f32 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc = -fnmsub;
+ fnmsub = vfmadd132ss(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(c, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fnmsub_sd&expand=2792)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213sd))]
+pub unsafe fn _mm_mask_fnmsub_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d {
+ let mut fnmsub: f64 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta = -fnmsub;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fnmsub = vfmadd132sd(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fnmsub_sd&expand=2794)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213sd))]
+pub unsafe fn _mm_maskz_fnmsub_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ let mut fnmsub: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fnmsub = vfmadd132sd(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(a, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper element from c to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fnmsub_sd&expand=2793)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213sd))]
+pub unsafe fn _mm_mask3_fnmsub_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d {
+ let mut fnmsub: f64 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc = -fnmsub;
+ fnmsub = vfmadd132sd(extracta, extractb, extractc, _MM_FROUND_CUR_DIRECTION);
+ }
+ let r = simd_insert(c, 0, fnmsub);
+ transmute(r)
+}
+
+/// Add the lower single-precision (32-bit) floating-point element in a and b, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_add_round_ss&expand=151)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_add_round_ss<const ROUNDING: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vaddss(a, b, zero, 0b1, ROUNDING);
+ transmute(r)
+}
+
+/// Add the lower single-precision (32-bit) floating-point element in a and b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_add_round_ss&expand=152)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_add_round_ss<const ROUNDING: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vaddss(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Add the lower single-precision (32-bit) floating-point element in a and b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_add_round_ss&expand=153)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_add_round_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vaddss(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Add the lower double-precision (64-bit) floating-point element in a and b, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_add_round_sd&expand=148)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_add_round_sd<const ROUNDING: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vaddsd(a, b, zero, 0b1, ROUNDING);
+ transmute(r)
+}
+
+/// Add the lower double-precision (64-bit) floating-point element in a and b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_add_round_Sd&expand=149)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_add_round_sd<const ROUNDING: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vaddsd(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Add the lower double-precision (64-bit) floating-point element in a and b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_add_round_sd&expand=150)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vaddsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_add_round_sd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vaddsd(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Subtract the lower single-precision (32-bit) floating-point element in b from the lower single-precision (32-bit) floating-point element in a, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_sub_round_ss&expand=5745)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_sub_round_ss<const ROUNDING: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vsubss(a, b, zero, 0b1, ROUNDING);
+ transmute(r)
+}
+
+/// Subtract the lower single-precision (32-bit) floating-point element in b from the lower single-precision (32-bit) floating-point element in a, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_sub_round_ss&expand=5743)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_sub_round_ss<const ROUNDING: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vsubss(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Subtract the lower single-precision (32-bit) floating-point element in b from the lower single-precision (32-bit) floating-point element in a, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_sub_round_ss&expand=5744)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_sub_round_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vsubss(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Subtract the lower double-precision (64-bit) floating-point element in b from the lower double-precision (64-bit) floating-point element in a, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_sub_round_sd&expand=5742)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_sub_round_sd<const ROUNDING: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vsubsd(a, b, zero, 0b1, ROUNDING);
+ transmute(r)
+}
+
+/// Subtract the lower double-precision (64-bit) floating-point element in b from the lower double-precision (64-bit) floating-point element in a, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_sub_round_sd&expand=5740)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_sub_round_sd<const ROUNDING: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vsubsd(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Subtract the lower double-precision (64-bit) floating-point element in b from the lower double-precision (64-bit) floating-point element in a, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_sub_round_sd&expand=5741)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsubsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_sub_round_sd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vsubsd(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point element in a and b, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mul_round_ss&expand=3946)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_mul_round_ss<const ROUNDING: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vmulss(a, b, zero, 0b1, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point element in a and b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_mul_round_ss&expand=3944)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_mul_round_ss<const ROUNDING: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vmulss(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point element in a and b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_mul_round_ss&expand=3945)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_mul_round_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vmulss(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point element in a and b, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mul_round_sd&expand=3943)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_mul_round_sd<const ROUNDING: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vmulsd(a, b, zero, 0b1, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point element in a and b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_mul_round_sd&expand=3941)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_mul_round_sd<const ROUNDING: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vmulsd(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point element in a and b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_mul_round_sd&expand=3942)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmulsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_mul_round_sd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vmulsd(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Divide the lower single-precision (32-bit) floating-point element in a by the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_div_round_ss&expand=2174)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_div_round_ss<const ROUNDING: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vdivss(a, b, zero, 0b1, ROUNDING);
+ transmute(r)
+}
+
+/// Divide the lower single-precision (32-bit) floating-point element in a by the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_div_round_ss&expand=2175)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_div_round_ss<const ROUNDING: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vdivss(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Divide the lower single-precision (32-bit) floating-point element in a by the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_div_round_ss&expand=2176)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_div_round_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vdivss(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Divide the lower double-precision (64-bit) floating-point element in a by the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_div_round_sd&expand=2171)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_div_round_sd<const ROUNDING: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vdivsd(a, b, zero, 0b1, ROUNDING);
+ transmute(r)
+}
+
+/// Divide the lower double-precision (64-bit) floating-point element in a by the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_div_round_sd&expand=2172)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_div_round_sd<const ROUNDING: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vdivsd(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Divide the lower double-precision (64-bit) floating-point element in a by the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_div_round_sd&expand=2173)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vdivsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_div_round_sd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vdivsd(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point elements in a and b, store the maximum value in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_max_round_ss&expand=3668)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxss, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_max_round_ss<const SAE: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vmaxss(a, b, zero, 0b1, SAE);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point elements in a and b, store the maximum value in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_max_ss&expand=3672)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxss, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_max_round_ss<const SAE: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vmaxss(a, b, src, k, SAE);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point elements in a and b, store the maximum value in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_max_round_ss&expand=3667)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxss, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_max_round_ss<const SAE: i32>(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vmaxss(a, b, zero, k, SAE);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point elements in a and b, store the maximum value in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_max_round_sd&expand=3665)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxsd, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_max_round_sd<const SAE: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vmaxsd(a, b, zero, 0b1, SAE);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point elements in a and b, store the maximum value in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_max_round_sd&expand=3663)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxsd, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_max_round_sd<const SAE: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vmaxsd(a, b, src, k, SAE);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point elements in a and b, store the maximum value in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_max_sd&expand=3670)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vmaxsd, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_max_round_sd<const SAE: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vmaxsd(a, b, zero, k, SAE);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point elements in a and b, store the minimum value in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_min_round_ss&expand=3782)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminss, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_min_round_ss<const SAE: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vminss(a, b, zero, 0b1, SAE);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point elements in a and b, store the minimum value in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_min_round_Ss&expand=3780)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminss, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_min_round_ss<const SAE: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vminss(a, b, src, k, SAE);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point elements in a and b, store the minimum value in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_min_round_ss&expand=3781)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminss, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_min_round_ss<const SAE: i32>(k: __mmask8, a: __m128, b: __m128) -> __m128 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vminss(a, b, zero, k, SAE);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point elements in a and b, store the minimum value in the lower element of dst , and copy the upper element from a to the upper element of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_min_round_sd&expand=3779)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminsd, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_min_round_sd<const SAE: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vminsd(a, b, zero, 0b1, SAE);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point elements in a and b, store the minimum value in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_min_round_sd&expand=3777)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminsd, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_min_round_sd<const SAE: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vminsd(a, b, src, k, SAE);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point elements in a and b, store the minimum value in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_min_round_Sd&expand=3778)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vminsd, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_min_round_sd<const SAE: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vminsd(a, b, zero, k, SAE);
+ transmute(r)
+}
+
+/// Compute the square root of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_sqrt_round_ss&expand=5383)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_sqrt_round_ss<const ROUNDING: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vsqrtss(a, b, zero, 0b1, ROUNDING);
+ transmute(r)
+}
+
+/// Compute the square root of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_sqrt_round_ss&expand=5381)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_sqrt_round_ss<const ROUNDING: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vsqrtss(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Compute the square root of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_sqrt_round_ss&expand=5382)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_sqrt_round_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vsqrtss(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Compute the square root of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_sqrt_round_sd&expand=5380)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_sqrt_round_sd<const ROUNDING: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vsqrtsd(a, b, zero, 0b1, ROUNDING);
+ transmute(r)
+}
+
+/// Compute the square root of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_sqrt_round_sd&expand=5378)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_sqrt_round_sd<const ROUNDING: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vsqrtsd(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Compute the square root of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_sqrt_round_sd&expand=5379)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vsqrtsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_sqrt_round_sd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vsqrtsd(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the exponent of the lower single-precision (32-bit) floating-point element in b to a single-precision (32-bit) floating-point number representing the integer exponent, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_getexp_round_ss&expand=2856)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpss, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_getexp_round_ss<const SAE: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vgetexpss(a, b, zero, 0b1, SAE);
+ transmute(r)
+}
+
+/// Convert the exponent of the lower single-precision (32-bit) floating-point element in b to a single-precision (32-bit) floating-point number representing the integer exponent, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_getexp_round_ss&expand=2857)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpss, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_getexp_round_ss<const SAE: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vgetexpss(a, b, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert the exponent of the lower single-precision (32-bit) floating-point element in b to a single-precision (32-bit) floating-point number representing the integer exponent, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_getexp_round_ss&expand=2858)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpss, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_getexp_round_ss<const SAE: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vgetexpss(a, b, zero, k, SAE);
+ transmute(r)
+}
+
+/// Convert the exponent of the lower double-precision (64-bit) floating-point element in b to a double-precision (64-bit) floating-point number representing the integer exponent, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_getexp_round_sd&expand=2853)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpsd, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_getexp_round_sd<const SAE: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vgetexpsd(a, b, zero, 0b1, SAE);
+ transmute(r)
+}
+
+/// Convert the exponent of the lower double-precision (64-bit) floating-point element in b to a double-precision (64-bit) floating-point number representing the integer exponent, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_getexp_round_sd&expand=2854)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpsd, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_getexp_round_sd<const SAE: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vgetexpsd(a, b, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert the exponent of the lower double-precision (64-bit) floating-point element in b to a double-precision (64-bit) floating-point number representing the integer exponent, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates floor(log2(x)) for the lower element.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_getexp_round_sd&expand=2855)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetexpsd, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_getexp_round_sd<const SAE: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vgetexpsd(a, b, zero, k, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_getmant_round_ss&expand=2892)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantss, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(2, 3, 4)]
+pub unsafe fn _mm_getmant_round_ss<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vgetmantss(a, b, SIGN << 2 | NORM, zero, 0b1, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_getmant_round_ss&expand=2893)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantss, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(4, 5, 6)]
+pub unsafe fn _mm_mask_getmant_round_ss<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vgetmantss(a, b, SIGN << 2 | NORM, src, k, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower single-precision (32-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_getmant_round_ss&expand=2894)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantss, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(3, 4, 5)]
+pub unsafe fn _mm_maskz_getmant_round_ss<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vgetmantss(a, b, SIGN << 2 | NORM, zero, k, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_getmant_round_sd&expand=2889)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantsd, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(2, 3, 4)]
+pub unsafe fn _mm_getmant_round_sd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vgetmantsd(a, b, SIGN << 2 | NORM, zero, 0b1, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_getmant_round_sd&expand=2890)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantsd, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(4, 5, 6)]
+pub unsafe fn _mm_mask_getmant_round_sd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vgetmantsd(a, b, SIGN << 2 | NORM, src, k, SAE);
+ transmute(r)
+}
+
+/// Normalize the mantissas of the lower double-precision (64-bit) floating-point element in b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. This intrinsic essentially calculates ±(2^k)*|x.significand|, where k depends on the interval range defined by interv and the sign depends on sc and the source sign.\
+/// The mantissa is normalized to the interval specified by interv, which can take the following values:\
+/// _MM_MANT_NORM_1_2 // interval [1, 2)\
+/// _MM_MANT_NORM_p5_2 // interval [0.5, 2)\
+/// _MM_MANT_NORM_p5_1 // interval [0.5, 1)\
+/// _MM_MANT_NORM_p75_1p5 // interval [0.75, 1.5)\
+/// The sign is determined by sc which can take the following values:\
+/// _MM_MANT_SIGN_src // sign = sign(src)\
+/// _MM_MANT_SIGN_zero // sign = 0\
+/// _MM_MANT_SIGN_nan // dst = NaN if sign(src) = 1\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_getmant_round_sd&expand=2891)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vgetmantsd, NORM = 0, SIGN = 0, SAE = 4))]
+#[rustc_legacy_const_generics(3, 4, 5)]
+pub unsafe fn _mm_maskz_getmant_round_sd<
+ const NORM: _MM_MANTISSA_NORM_ENUM,
+ const SIGN: _MM_MANTISSA_SIGN_ENUM,
+ const SAE: i32,
+>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm4!(NORM);
+ static_assert_imm2!(SIGN);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vgetmantsd(a, b, SIGN << 2 | NORM, zero, k, SAE);
+ transmute(r)
+}
+
+/// Round the lower single-precision (32-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_roundscale_round_ss&expand=4796)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaless, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm_roundscale_round_ss<const IMM8: i32, const SAE: i32>(
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vrndscaless(a, b, zero, 0b11111111, IMM8, SAE);
+ transmute(r)
+}
+
+/// Round the lower single-precision (32-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_roundscale_round_ss&expand=4794)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaless, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm_mask_roundscale_round_ss<const IMM8: i32, const SAE: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vrndscaless(a, b, src, k, IMM8, SAE);
+ transmute(r)
+}
+
+/// Round the lower single-precision (32-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_roundscale_round_ss&expand=4795)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscaless, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm_maskz_roundscale_round_ss<const IMM8: i32, const SAE: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vrndscaless(a, b, zero, k, IMM8, SAE);
+ transmute(r)
+}
+
+/// Round the lower double-precision (64-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_roundscale_round_sd&expand=4793)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalesd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm_roundscale_round_sd<const IMM8: i32, const SAE: i32>(
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vrndscalesd(a, b, zero, 0b11111111, IMM8, SAE);
+ transmute(r)
+}
+
+/// Round the lower double-precision (64-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_roundscale_round_sd&expand=4791)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalesd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm_mask_roundscale_round_sd<const IMM8: i32, const SAE: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vrndscalesd(a, b, src, k, IMM8, SAE);
+ transmute(r)
+}
+
+/// Round the lower double-precision (64-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+/// Rounding is done according to the imm8\[2:0\] parameter, which can be one of:\
+/// _MM_FROUND_TO_NEAREST_INT // round to nearest\
+/// _MM_FROUND_TO_NEG_INF // round down\
+/// _MM_FROUND_TO_POS_INF // round up\
+/// _MM_FROUND_TO_ZERO // truncate\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE\
+///
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_roundscale_round_sd&expand=4792)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vrndscalesd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm_maskz_roundscale_round_sd<const IMM8: i32, const SAE: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vrndscalesd(a, b, zero, k, IMM8, SAE);
+ transmute(r)
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_scalef_round_ss&expand=4895)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_scalef_round_ss<const ROUNDING: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vscalefss(a, b, zero, 0b11111111, ROUNDING);
+ transmute(r)
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_scalef_round_ss&expand=4893)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_scalef_round_ss<const ROUNDING: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let src = src.as_f32x4();
+ let r = vscalefss(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Scale the packed single-precision (32-bit) floating-point elements in a using values from b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_scalef_round_ss&expand=4894)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_scalef_round_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vscalefss(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_scalef_round_sd&expand=4892)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_scalef_round_sd<const ROUNDING: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vscalefsd(a, b, zero, 0b11111111, ROUNDING);
+ transmute(r)
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_scalef_round_sd&expand=4890)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_scalef_round_sd<const ROUNDING: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let src = src.as_f64x2();
+ let r = vscalefsd(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Scale the packed double-precision (64-bit) floating-point elements in a using values from b, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_scalef_round_sd&expand=4891)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vscalefsd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_scalef_round_sd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vscalefsd(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fmadd_round_ss&expand=2573)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fmadd_round_ss<const ROUNDING: i32>(a: __m128, b: __m128, c: __m128) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let r = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ let r = simd_insert(a, 0, r);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fmadd_round_ss&expand=2574)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fmadd_round_ss<const ROUNDING: i32>(
+ a: __m128,
+ k: __mmask8,
+ b: __m128,
+ c: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fmadd: f32 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ fmadd = vfmadd132ss(fmadd, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fmadd_round_ss&expand=2576)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fmadd_round_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+ c: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fmadd: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ fmadd = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper 3 packed elements from c to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fmadd_round_ss&expand=2575)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask3_fmadd_round_ss<const ROUNDING: i32>(
+ a: __m128,
+ b: __m128,
+ c: __m128,
+ k: __mmask8,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fmadd: f32 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ fmadd = vfmadd132ss(extracta, extractb, fmadd, ROUNDING);
+ }
+ let r = simd_insert(c, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fmadd_round_sd&expand=2569)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fmadd_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let fmadd = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ let r = simd_insert(a, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fmadd_round_sd&expand=2570)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fmadd_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ k: __mmask8,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fmadd: f64 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ fmadd = vfmadd132sd(fmadd, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fmadd_round_sd&expand=2572)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fmadd_round_sd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fmadd: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ fmadd = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper element from c to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fmadd_round_Sd&expand=2571)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmadd213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask3_fmadd_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+ k: __mmask8,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fmadd: f64 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ fmadd = vfmadd132sd(extracta, extractb, fmadd, ROUNDING);
+ }
+ let r = simd_insert(c, 0, fmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fmsub_round_ss&expand=2659)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fmsub_round_ss<const ROUNDING: i32>(a: __m128, b: __m128, c: __m128) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let extractc = -extractc;
+ let fmsub = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ let r = simd_insert(a, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fmsub_round_ss&expand=2660)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fmsub_round_ss<const ROUNDING: i32>(
+ a: __m128,
+ k: __mmask8,
+ b: __m128,
+ c: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fmsub: f32 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fmsub = vfmadd132ss(fmsub, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fmsub_round_ss&expand=2662)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fmsub_round_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+ c: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fmsub: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fmsub = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper 3 packed elements from c to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fmsub_round_ss&expand=2661)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask3_fmsub_round_ss<const ROUNDING: i32>(
+ a: __m128,
+ b: __m128,
+ c: __m128,
+ k: __mmask8,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fmsub: f32 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc = -fmsub;
+ fmsub = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(c, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fmsub_round_sd&expand=2655)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fmsub_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let extractc = -extractc;
+ let fmsub = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ let r = simd_insert(a, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fmsub_round_sd&expand=2656)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fmsub_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ k: __mmask8,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fmsub: f64 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fmsub = vfmadd132sd(fmsub, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fmsub_round_sd&expand=2658)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fmsub_round_sd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fmsub: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fmsub = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper element from c to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fmsub_round_sd&expand=2657)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfmsub213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask3_fmsub_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+ k: __mmask8,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fmsub: f64 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc = -fmsub;
+ fmsub = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(c, 0, fmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fnmadd_round_ss&expand=2739)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fnmadd_round_ss<const ROUNDING: i32>(a: __m128, b: __m128, c: __m128) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let extracta: f32 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let fnmadd = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ let r = simd_insert(a, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fnmadd_round_ss&expand=2740)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fnmadd_round_ss<const ROUNDING: i32>(
+ a: __m128,
+ k: __mmask8,
+ b: __m128,
+ c: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmadd: f32 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta = -fnmadd;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ fnmadd = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fnmadd_round_ss&expand=2742)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fnmadd_round_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+ c: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmadd: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ fnmadd = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper 3 packed elements from c to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fnmadd_round_ss&expand=2741)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask3_fnmadd_round_ss<const ROUNDING: i32>(
+ a: __m128,
+ b: __m128,
+ c: __m128,
+ k: __mmask8,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmadd: f32 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f32 = simd_extract(b, 0);
+ fnmadd = vfmadd132ss(extracta, extractb, fnmadd, ROUNDING);
+ }
+ let r = simd_insert(c, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fnmadd_round_sd&expand=2735)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fnmadd_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let extracta: f64 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let fnmadd = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ let r = simd_insert(a, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fnmadd_round_sd&expand=2736)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fnmadd_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ k: __mmask8,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmadd: f64 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta = -fnmadd;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ fnmadd = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fnmadd_round_sd&expand=2738)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fnmadd_round_sd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmadd: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ fnmadd = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and add the negated intermediate result to the lower element in c. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper element from c to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fnmadd_round_Sd&expand=2737)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmadd213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask3_fnmadd_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+ k: __mmask8,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmadd: f64 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f64 = simd_extract(b, 0);
+ fnmadd = vfmadd132sd(extracta, extractb, fnmadd, ROUNDING);
+ }
+ let r = simd_insert(c, 0, fnmadd);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, subtract the lower element in c from the negated intermediate result, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fnmsub_round_ss&expand=2787)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fnmsub_round_ss<const ROUNDING: i32>(a: __m128, b: __m128, c: __m128) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let extracta: f32 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let extractc = -extractc;
+ let fnmsub = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ let r = simd_insert(a, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fnmsub_round_ss&expand=2788)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fnmsub_round_ss<const ROUNDING: i32>(
+ a: __m128,
+ k: __mmask8,
+ b: __m128,
+ c: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmsub: f32 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta = -fnmsub;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fnmsub = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fnmsub_round_ss&expand=2790)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fnmsub_round_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+ c: __m128,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmsub: f32 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc: f32 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fnmsub = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower single-precision (32-bit) floating-point elements in a and b, subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper 3 packed elements from c to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fnmsub_round_ss&expand=2789)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask3_fnmsub_round_ss<const ROUNDING: i32>(
+ a: __m128,
+ b: __m128,
+ c: __m128,
+ k: __mmask8,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmsub: f32 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f32 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f32 = simd_extract(b, 0);
+ let extractc = -fnmsub;
+ fnmsub = vfmadd132ss(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(c, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fnmsub_round_sd&expand=2783)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fnmsub_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let extracta: f64 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let extractc = -extractc;
+ let fnmsub = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ let r = simd_insert(a, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fnmsub_round_sd&expand=2784)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fnmsub_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ k: __mmask8,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmsub: f64 = simd_extract(a, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta = -fnmsub;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fnmsub = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fnmsub_round_sd&expand=2786)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fnmsub_round_sd<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmsub: f64 = 0.;
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc: f64 = simd_extract(c, 0);
+ let extractc = -extractc;
+ fnmsub = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(a, 0, fnmsub);
+ transmute(r)
+}
+
+/// Multiply the lower double-precision (64-bit) floating-point elements in a and b, and subtract the lower element in c from the negated intermediate result. Store the result in the lower element of dst using writemask k (the element is copied from c when mask bit 0 is not set), and copy the upper element from c to the upper element of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask3_fnmsub_round_sd&expand=2785)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfnmsub213sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask3_fnmsub_round_sd<const ROUNDING: i32>(
+ a: __m128d,
+ b: __m128d,
+ c: __m128d,
+ k: __mmask8,
+) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let mut fnmsub: f64 = simd_extract(c, 0);
+ if (k & 0b00000001) != 0 {
+ let extracta: f64 = simd_extract(a, 0);
+ let extracta = -extracta;
+ let extractb: f64 = simd_extract(b, 0);
+ let extractc = -fnmsub;
+ fnmsub = vfmadd132sd(extracta, extractb, extractc, ROUNDING);
+ }
+ let r = simd_insert(c, 0, fnmsub);
+ transmute(r)
+}
+
+/// Fix up the lower single-precision (32-bit) floating-point elements in a and b using the lower 32-bit integer in c, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fixupimm_ss&expand=2517)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmss, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fixupimm_ss<const IMM8: i32>(a: __m128, b: __m128, c: __m128i) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let c = c.as_i32x4();
+ let r = vfixupimmss(a, b, c, IMM8, 0b11111111, _MM_FROUND_CUR_DIRECTION);
+ let fixupimm: f32 = simd_extract(r, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower single-precision (32-bit) floating-point elements in a and b using the lower 32-bit integer in c, store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fixupimm_ss&expand=2518)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmss, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fixupimm_ss<const IMM8: i32>(
+ a: __m128,
+ k: __mmask8,
+ b: __m128,
+ c: __m128i,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let c = c.as_i32x4();
+ let fixupimm = vfixupimmss(a, b, c, IMM8, k, _MM_FROUND_CUR_DIRECTION);
+ let fixupimm: f32 = simd_extract(fixupimm, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower single-precision (32-bit) floating-point elements in a and b using the lower 32-bit integer in c, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fixupimm_ss&expand=2519)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmss, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fixupimm_ss<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+ c: __m128i,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let c = c.as_i32x4();
+ let fixupimm = vfixupimmssz(a, b, c, IMM8, k, _MM_FROUND_CUR_DIRECTION);
+ let fixupimm: f32 = simd_extract(fixupimm, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower double-precision (64-bit) floating-point elements in a and b using the lower 64-bit integer in c, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fixupimm_sd&expand=2514)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmsd, IMM8 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_fixupimm_sd<const IMM8: i32>(a: __m128d, b: __m128d, c: __m128i) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let c = c.as_i64x2();
+ let fixupimm = vfixupimmsd(a, b, c, IMM8, 0b11111111, _MM_FROUND_CUR_DIRECTION);
+ let fixupimm: f64 = simd_extract(fixupimm, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower double-precision (64-bit) floating-point elements in a and b using the lower 64-bit integer in c, store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fixupimm_sd&expand=2515)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmsd, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_fixupimm_sd<const IMM8: i32>(
+ a: __m128d,
+ k: __mmask8,
+ b: __m128d,
+ c: __m128i,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let c = c.as_i64x2();
+ let fixupimm = vfixupimmsd(a, b, c, IMM8, k, _MM_FROUND_CUR_DIRECTION);
+ let fixupimm: f64 = simd_extract(fixupimm, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower double-precision (64-bit) floating-point elements in a and b using the lower 64-bit integer in c, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. imm8 is used to set the required flags reporting.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fixupimm_sd&expand=2516)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmsd, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_maskz_fixupimm_sd<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+ c: __m128i,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let c = c.as_i64x2();
+ let fixupimm = vfixupimmsdz(a, b, c, IMM8, k, _MM_FROUND_CUR_DIRECTION);
+ let fixupimm: f64 = simd_extract(fixupimm, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower single-precision (32-bit) floating-point elements in a and b using the lower 32-bit integer in c, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst. imm8 is used to set the required flags reporting.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fixupimm_round_ss&expand=2511)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmss, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm_fixupimm_round_ss<const IMM8: i32, const SAE: i32>(
+ a: __m128,
+ b: __m128,
+ c: __m128i,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let c = c.as_i32x4();
+ let r = vfixupimmss(a, b, c, IMM8, 0b11111111, SAE);
+ let fixupimm: f32 = simd_extract(r, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower single-precision (32-bit) floating-point elements in a and b using the lower 32-bit integer in c, store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. imm8 is used to set the required flags reporting.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fixupimm_round_ss&expand=2512)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmss, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm_mask_fixupimm_round_ss<const IMM8: i32, const SAE: i32>(
+ a: __m128,
+ k: __mmask8,
+ b: __m128,
+ c: __m128i,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let c = c.as_i32x4();
+ let r = vfixupimmss(a, b, c, IMM8, k, SAE);
+ let fixupimm: f32 = simd_extract(r, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower single-precision (32-bit) floating-point elements in a and b using the lower 32-bit integer in c, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst. imm8 is used to set the required flags reporting.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fixupimm_round_ss&expand=2513)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmss, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm_maskz_fixupimm_round_ss<const IMM8: i32, const SAE: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128,
+ c: __m128i,
+) -> __m128 {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let c = c.as_i32x4();
+ let r = vfixupimmssz(a, b, c, IMM8, k, SAE);
+ let fixupimm: f32 = simd_extract(r, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower double-precision (64-bit) floating-point elements in a and b using the lower 64-bit integer in c, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst. imm8 is used to set the required flags reporting.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_fixupimm_round_sd&expand=2508)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmsd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(3, 4)]
+pub unsafe fn _mm_fixupimm_round_sd<const IMM8: i32, const SAE: i32>(
+ a: __m128d,
+ b: __m128d,
+ c: __m128i,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let c = c.as_i64x2();
+ let r = vfixupimmsd(a, b, c, IMM8, 0b11111111, SAE);
+ let fixupimm: f64 = simd_extract(r, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower double-precision (64-bit) floating-point elements in a and b using the lower 64-bit integer in c, store the result in the lower element of dst using writemask k (the element is copied from a when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. imm8 is used to set the required flags reporting.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_fixupimm_round_sd&expand=2509)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmsd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm_mask_fixupimm_round_sd<const IMM8: i32, const SAE: i32>(
+ a: __m128d,
+ k: __mmask8,
+ b: __m128d,
+ c: __m128i,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let c = c.as_i64x2();
+ let r = vfixupimmsd(a, b, c, IMM8, k, SAE);
+ let fixupimm: f64 = simd_extract(r, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Fix up the lower double-precision (64-bit) floating-point elements in a and b using the lower 64-bit integer in c, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst. imm8 is used to set the required flags reporting.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_fixupimm_round_sd&expand=2510)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vfixupimmsd, IMM8 = 0, SAE = 8))]
+#[rustc_legacy_const_generics(4, 5)]
+pub unsafe fn _mm_maskz_fixupimm_round_sd<const IMM8: i32, const SAE: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128d,
+ c: __m128i,
+) -> __m128d {
+ static_assert_imm8!(IMM8);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let c = c.as_i64x2();
+ let r = vfixupimmsdz(a, b, c, IMM8, k, SAE);
+ let fixupimm: f64 = simd_extract(r, 0);
+ let r = simd_insert(a, 0, fixupimm);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in b to a double-precision (64-bit) floating-point element, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_cvtss_sd&expand=1896)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2sd))]
+pub unsafe fn _mm_mask_cvtss_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128) -> __m128d {
+ transmute(vcvtss2sd(
+ a.as_f64x2(),
+ b.as_f32x4(),
+ src.as_f64x2(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in b to a double-precision (64-bit) floating-point element, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_cvtss_sd&expand=1897)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2sd))]
+pub unsafe fn _mm_maskz_cvtss_sd(k: __mmask8, a: __m128d, b: __m128) -> __m128d {
+ transmute(vcvtss2sd(
+ a.as_f64x2(),
+ b.as_f32x4(),
+ _mm_setzero_pd().as_f64x2(),
+ k,
+ _MM_FROUND_CUR_DIRECTION,
+ ))
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in b to a single-precision (32-bit) floating-point element, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_cvtsd_ss&expand=1797)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2ss))]
+pub unsafe fn _mm_mask_cvtsd_ss(src: __m128, k: __mmask8, a: __m128, b: __m128d) -> __m128 {
+ transmute(vcvtsd2ss(
+ a.as_f32x4(),
+ b.as_f64x2(),
+ src.as_f32x4(),
+ k,
+ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in b to a single-precision (32-bit) floating-point element, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_cvtsd_ss&expand=1798)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2ss))]
+pub unsafe fn _mm_maskz_cvtsd_ss(k: __mmask8, a: __m128, b: __m128d) -> __m128 {
+ transmute(vcvtsd2ss(
+ a.as_f32x4(),
+ b.as_f64x2(),
+ _mm_setzero_ps().as_f32x4(),
+ k,
+ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC,
+ ))
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in b to a double-precision (64-bit) floating-point element, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvt_roundss_sd&expand=1371)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2sd, SAE = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundss_sd<const SAE: i32>(a: __m128d, b: __m128) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vcvtss2sd(a, b, zero, 0b11111111, SAE);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in b to a double-precision (64-bit) floating-point element, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_cvt_roundss_sd&expand=1372)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2sd, SAE = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_cvt_roundss_sd<const SAE: i32>(
+ src: __m128d,
+ k: __mmask8,
+ a: __m128d,
+ b: __m128,
+) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f32x4();
+ let src = src.as_f64x2();
+ let r = vcvtss2sd(a, b, src, k, SAE);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in b to a double-precision (64-bit) floating-point element, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper element from a to the upper element of dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_cvt_roundss_sd&expand=1373)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2sd, SAE = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_cvt_roundss_sd<const SAE: i32>(
+ k: __mmask8,
+ a: __m128d,
+ b: __m128,
+) -> __m128d {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f32x4();
+ let zero = _mm_setzero_pd().as_f64x2();
+ let r = vcvtss2sd(a, b, zero, k, SAE);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in b to a single-precision (32-bit) floating-point element, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvt_roundsd_ss&expand=1361)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundsd_ss<const ROUNDING: i32>(a: __m128, b: __m128d) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vcvtsd2ss(a, b, zero, 0b11111111, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in b to a single-precision (32-bit) floating-point element, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_mask_cvt_roundsd_ss&expand=1362)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_cvt_roundsd_ss<const ROUNDING: i32>(
+ src: __m128,
+ k: __mmask8,
+ a: __m128,
+ b: __m128d,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f64x2();
+ let src = src.as_f32x4();
+ let r = vcvtsd2ss(a, b, src, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in b to a single-precision (32-bit) floating-point element, store the result in the lower element of dst using zeromask k (the element is zeroed out when mask bit 0 is not set), and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_maskz_cvt_roundsd_ss&expand=1363)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_cvt_roundsd_ss<const ROUNDING: i32>(
+ k: __mmask8,
+ a: __m128,
+ b: __m128d,
+) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let b = b.as_f64x2();
+ let zero = _mm_setzero_ps().as_f32x4();
+ let r = vcvtsd2ss(a, b, zero, k, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 32-bit integer, and store the result in dst.\
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvt_roundss_si32&expand=1374)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundss_si32<const ROUNDING: i32>(a: __m128) -> i32 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtss2si(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 32-bit integer, and store the result in dst.\
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvt_roundss_i32&expand=1369)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundss_i32<const ROUNDING: i32>(a: __m128) -> i32 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtss2si(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to an unsigned 32-bit integer, and store the result in dst.\
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvt_roundss_u32&expand=1376)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2usi, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundss_u32<const ROUNDING: i32>(a: __m128) -> u32 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtss2usi(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 32-bit integer, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvtss_i32&expand=1893)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si))]
+pub unsafe fn _mm_cvtss_i32(a: __m128) -> i32 {
+ transmute(vcvtss2si(a.as_f32x4(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to an unsigned 32-bit integer, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvtss_u32&expand=1901)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2usi))]
+pub unsafe fn _mm_cvtss_u32(a: __m128) -> u32 {
+ transmute(vcvtss2usi(a.as_f32x4(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 32-bit integer, and store the result in dst.\
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvt_roundsd_si32&expand=1359)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundsd_si32<const ROUNDING: i32>(a: __m128d) -> i32 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let r = vcvtsd2si(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 32-bit integer, and store the result in dst.\
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvt_roundsd_i32&expand=1357)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundsd_i32<const ROUNDING: i32>(a: __m128d) -> i32 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let r = vcvtsd2si(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to an unsigned 32-bit integer, and store the result in dst.\
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=cvt_roundsd_u32&expand=1364)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2usi, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundsd_u32<const ROUNDING: i32>(a: __m128d) -> u32 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let r = vcvtsd2usi(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 32-bit integer, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvtsd_i32&expand=1791)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si))]
+pub unsafe fn _mm_cvtsd_i32(a: __m128d) -> i32 {
+ transmute(vcvtsd2si(a.as_f64x2(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to an unsigned 32-bit integer, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvtsd_u32&expand=1799)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2usi))]
+pub unsafe fn _mm_cvtsd_u32(a: __m128d) -> u32 {
+ transmute(vcvtsd2usi(a.as_f64x2(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the signed 32-bit integer b to a single-precision (32-bit) floating-point element, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvt_roundi32_ss&expand=1312)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsi2ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundi32_ss<const ROUNDING: i32>(a: __m128, b: i32) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtsi2ss(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the signed 32-bit integer b to a single-precision (32-bit) floating-point element, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+///
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvt_roundsi32_ss&expand=1366)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsi2ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundsi32_ss<const ROUNDING: i32>(a: __m128, b: i32) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtsi2ss(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the unsigned 32-bit integer b to a single-precision (32-bit) floating-point element, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.\
+/// Rounding is done according to the rounding\[3:0\] parameter, which can be one of:\
+/// (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC) // round to nearest, and suppress exceptions\
+/// (_MM_FROUND_TO_NEG_INF |_MM_FROUND_NO_EXC) // round down, and suppress exceptions\
+/// (_MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions\
+/// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions\
+/// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvt_roundu32_ss&expand=1378)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtusi2ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundu32_ss<const ROUNDING: i32>(a: __m128, b: u32) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtusi2ss(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the signed 32-bit integer b to a single-precision (32-bit) floating-point element, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvti32_ss&expand=1643)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsi2ss))]
+pub unsafe fn _mm_cvti32_ss(a: __m128, b: i32) -> __m128 {
+ let b = b as f32;
+ let r = simd_insert(a, 0, b);
+ transmute(r)
+}
+
+/// Convert the signed 32-bit integer b to a double-precision (64-bit) floating-point element, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvti32_sd&expand=1642)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsi2sd))]
+pub unsafe fn _mm_cvti32_sd(a: __m128d, b: i32) -> __m128d {
+ let b = b as f64;
+ let r = simd_insert(a, 0, b);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 32-bit integer with truncation, and store the result in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvtt_roundss_Si32&expand=1936)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundss_si32<const SAE: i32>(a: __m128) -> i32 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let r = vcvtss2si(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 32-bit integer with truncation, and store the result in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvtt_roundss_i32&expand=1934)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundss_i32<const SAE: i32>(a: __m128) -> i32 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let r = vcvtss2si(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to an unsigned 32-bit integer with truncation, and store the result in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvtt_roundss_u32&expand=1938)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2usi, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundss_u32<const SAE: i32>(a: __m128) -> u32 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let r = vcvtss2usi(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 32-bit integer with truncation, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttss_i32&expand=2022)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si))]
+pub unsafe fn _mm_cvttss_i32(a: __m128) -> i32 {
+ transmute(vcvtss2si(a.as_f32x4(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to an unsigned 32-bit integer with truncation, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttss_u32&expand=2026)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2usi))]
+pub unsafe fn _mm_cvttss_u32(a: __m128) -> u32 {
+ transmute(vcvtss2usi(a.as_f32x4(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 32-bit integer with truncation, and store the result in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtt_roundsd_si32&expand=1930)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundsd_si32<const SAE: i32>(a: __m128d) -> i32 {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let r = vcvtsd2si(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 32-bit integer with truncation, and store the result in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtt_roundsd_i32&expand=1928)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundsd_i32<const SAE: i32>(a: __m128d) -> i32 {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let r = vcvtsd2si(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to an unsigned 32-bit integer with truncation, and store the result in dst.\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cvtt_roundsd_u32&expand=1932)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2usi, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundsd_u32<const SAE: i32>(a: __m128d) -> u32 {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let r = vcvtsd2usi(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 32-bit integer with truncation, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttsd_i32&expand=2015)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si))]
+pub unsafe fn _mm_cvttsd_i32(a: __m128d) -> i32 {
+ transmute(vcvtsd2si(a.as_f64x2(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to an unsigned 32-bit integer with truncation, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttsd_u32&expand=2020)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2usi))]
+pub unsafe fn _mm_cvttsd_u32(a: __m128d) -> u32 {
+ transmute(vcvtsd2usi(a.as_f64x2(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the unsigned 32-bit integer b to a single-precision (32-bit) floating-point element, store the result in the lower element of dst, and copy the upper 3 packed elements from a to the upper elements of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtu32_ss&expand=2032)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtusi2ss))]
+pub unsafe fn _mm_cvtu32_ss(a: __m128, b: u32) -> __m128 {
+ let b = b as f32;
+ let r = simd_insert(a, 0, b);
+ transmute(r)
+}
+
+/// Convert the unsigned 32-bit integer b to a double-precision (64-bit) floating-point element, store the result in the lower element of dst, and copy the upper element from a to the upper element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtu32_sd&expand=2031)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtusi2sd))]
+pub unsafe fn _mm_cvtu32_sd(a: __m128d, b: u32) -> __m128d {
+ let b = b as f64;
+ let r = simd_insert(a, 0, b);
+ transmute(r)
+}
+
+/// Compare the lower single-precision (32-bit) floating-point element in a and b based on the comparison operand specified by imm8, and return the boolean result (0 or 1).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comi_round_ss&expand=1175)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp, IMM5 = 5, SAE = 4))] //should be vcomiss
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm_comi_round_ss<const IMM5: i32, const SAE: i32>(a: __m128, b: __m128) -> i32 {
+ static_assert_imm5!(IMM5);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f32x4();
+ let b = b.as_f32x4();
+ let r = vcomiss(a, b, IMM5, SAE);
+ transmute(r)
+}
+
+/// Compare the lower double-precision (64-bit) floating-point element in a and b based on the comparison operand specified by imm8, and return the boolean result (0 or 1).\
+/// Exceptions can be suppressed by passing _MM_FROUND_NO_EXC in the sae parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comi_round_sd&expand=1174)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcmp, IMM5 = 5, SAE = 4))] //should be vcomisd
+#[rustc_legacy_const_generics(2, 3)]
+pub unsafe fn _mm_comi_round_sd<const IMM5: i32, const SAE: i32>(a: __m128d, b: __m128d) -> i32 {
+ static_assert_imm5!(IMM5);
+ static_assert_mantissas_sae!(SAE);
+ let a = a.as_f64x2();
+ let b = b.as_f64x2();
+ let r = vcomisd(a, b, IMM5, SAE);
+ transmute(r)
+}
+
+/// Equal
+pub const _MM_CMPINT_EQ: _MM_CMPINT_ENUM = 0x00;
+/// Less-than
+pub const _MM_CMPINT_LT: _MM_CMPINT_ENUM = 0x01;
+/// Less-than-or-equal
+pub const _MM_CMPINT_LE: _MM_CMPINT_ENUM = 0x02;
+/// False
+pub const _MM_CMPINT_FALSE: _MM_CMPINT_ENUM = 0x03;
+/// Not-equal
+pub const _MM_CMPINT_NE: _MM_CMPINT_ENUM = 0x04;
+/// Not less-than
+pub const _MM_CMPINT_NLT: _MM_CMPINT_ENUM = 0x05;
+/// Not less-than-or-equal
+pub const _MM_CMPINT_NLE: _MM_CMPINT_ENUM = 0x06;
+/// True
+pub const _MM_CMPINT_TRUE: _MM_CMPINT_ENUM = 0x07;
+
+/// interval [1, 2)
+pub const _MM_MANT_NORM_1_2: _MM_MANTISSA_NORM_ENUM = 0x00;
+/// interval [0.5, 2)
+pub const _MM_MANT_NORM_P5_2: _MM_MANTISSA_NORM_ENUM = 0x01;
+/// interval [0.5, 1)
+pub const _MM_MANT_NORM_P5_1: _MM_MANTISSA_NORM_ENUM = 0x02;
+/// interval [0.75, 1.5)
+pub const _MM_MANT_NORM_P75_1P5: _MM_MANTISSA_NORM_ENUM = 0x03;
+
+/// sign = sign(SRC)
+pub const _MM_MANT_SIGN_SRC: _MM_MANTISSA_SIGN_ENUM = 0x00;
+/// sign = 0
+pub const _MM_MANT_SIGN_ZERO: _MM_MANTISSA_SIGN_ENUM = 0x01;
+/// DEST = NaN if sign(SRC) = 1
+pub const _MM_MANT_SIGN_NAN: _MM_MANTISSA_SIGN_ENUM = 0x02;
+
+pub const _MM_PERM_AAAA: _MM_PERM_ENUM = 0x00;
+pub const _MM_PERM_AAAB: _MM_PERM_ENUM = 0x01;
+pub const _MM_PERM_AAAC: _MM_PERM_ENUM = 0x02;
+pub const _MM_PERM_AAAD: _MM_PERM_ENUM = 0x03;
+pub const _MM_PERM_AABA: _MM_PERM_ENUM = 0x04;
+pub const _MM_PERM_AABB: _MM_PERM_ENUM = 0x05;
+pub const _MM_PERM_AABC: _MM_PERM_ENUM = 0x06;
+pub const _MM_PERM_AABD: _MM_PERM_ENUM = 0x07;
+pub const _MM_PERM_AACA: _MM_PERM_ENUM = 0x08;
+pub const _MM_PERM_AACB: _MM_PERM_ENUM = 0x09;
+pub const _MM_PERM_AACC: _MM_PERM_ENUM = 0x0A;
+pub const _MM_PERM_AACD: _MM_PERM_ENUM = 0x0B;
+pub const _MM_PERM_AADA: _MM_PERM_ENUM = 0x0C;
+pub const _MM_PERM_AADB: _MM_PERM_ENUM = 0x0D;
+pub const _MM_PERM_AADC: _MM_PERM_ENUM = 0x0E;
+pub const _MM_PERM_AADD: _MM_PERM_ENUM = 0x0F;
+pub const _MM_PERM_ABAA: _MM_PERM_ENUM = 0x10;
+pub const _MM_PERM_ABAB: _MM_PERM_ENUM = 0x11;
+pub const _MM_PERM_ABAC: _MM_PERM_ENUM = 0x12;
+pub const _MM_PERM_ABAD: _MM_PERM_ENUM = 0x13;
+pub const _MM_PERM_ABBA: _MM_PERM_ENUM = 0x14;
+pub const _MM_PERM_ABBB: _MM_PERM_ENUM = 0x15;
+pub const _MM_PERM_ABBC: _MM_PERM_ENUM = 0x16;
+pub const _MM_PERM_ABBD: _MM_PERM_ENUM = 0x17;
+pub const _MM_PERM_ABCA: _MM_PERM_ENUM = 0x18;
+pub const _MM_PERM_ABCB: _MM_PERM_ENUM = 0x19;
+pub const _MM_PERM_ABCC: _MM_PERM_ENUM = 0x1A;
+pub const _MM_PERM_ABCD: _MM_PERM_ENUM = 0x1B;
+pub const _MM_PERM_ABDA: _MM_PERM_ENUM = 0x1C;
+pub const _MM_PERM_ABDB: _MM_PERM_ENUM = 0x1D;
+pub const _MM_PERM_ABDC: _MM_PERM_ENUM = 0x1E;
+pub const _MM_PERM_ABDD: _MM_PERM_ENUM = 0x1F;
+pub const _MM_PERM_ACAA: _MM_PERM_ENUM = 0x20;
+pub const _MM_PERM_ACAB: _MM_PERM_ENUM = 0x21;
+pub const _MM_PERM_ACAC: _MM_PERM_ENUM = 0x22;
+pub const _MM_PERM_ACAD: _MM_PERM_ENUM = 0x23;
+pub const _MM_PERM_ACBA: _MM_PERM_ENUM = 0x24;
+pub const _MM_PERM_ACBB: _MM_PERM_ENUM = 0x25;
+pub const _MM_PERM_ACBC: _MM_PERM_ENUM = 0x26;
+pub const _MM_PERM_ACBD: _MM_PERM_ENUM = 0x27;
+pub const _MM_PERM_ACCA: _MM_PERM_ENUM = 0x28;
+pub const _MM_PERM_ACCB: _MM_PERM_ENUM = 0x29;
+pub const _MM_PERM_ACCC: _MM_PERM_ENUM = 0x2A;
+pub const _MM_PERM_ACCD: _MM_PERM_ENUM = 0x2B;
+pub const _MM_PERM_ACDA: _MM_PERM_ENUM = 0x2C;
+pub const _MM_PERM_ACDB: _MM_PERM_ENUM = 0x2D;
+pub const _MM_PERM_ACDC: _MM_PERM_ENUM = 0x2E;
+pub const _MM_PERM_ACDD: _MM_PERM_ENUM = 0x2F;
+pub const _MM_PERM_ADAA: _MM_PERM_ENUM = 0x30;
+pub const _MM_PERM_ADAB: _MM_PERM_ENUM = 0x31;
+pub const _MM_PERM_ADAC: _MM_PERM_ENUM = 0x32;
+pub const _MM_PERM_ADAD: _MM_PERM_ENUM = 0x33;
+pub const _MM_PERM_ADBA: _MM_PERM_ENUM = 0x34;
+pub const _MM_PERM_ADBB: _MM_PERM_ENUM = 0x35;
+pub const _MM_PERM_ADBC: _MM_PERM_ENUM = 0x36;
+pub const _MM_PERM_ADBD: _MM_PERM_ENUM = 0x37;
+pub const _MM_PERM_ADCA: _MM_PERM_ENUM = 0x38;
+pub const _MM_PERM_ADCB: _MM_PERM_ENUM = 0x39;
+pub const _MM_PERM_ADCC: _MM_PERM_ENUM = 0x3A;
+pub const _MM_PERM_ADCD: _MM_PERM_ENUM = 0x3B;
+pub const _MM_PERM_ADDA: _MM_PERM_ENUM = 0x3C;
+pub const _MM_PERM_ADDB: _MM_PERM_ENUM = 0x3D;
+pub const _MM_PERM_ADDC: _MM_PERM_ENUM = 0x3E;
+pub const _MM_PERM_ADDD: _MM_PERM_ENUM = 0x3F;
+pub const _MM_PERM_BAAA: _MM_PERM_ENUM = 0x40;
+pub const _MM_PERM_BAAB: _MM_PERM_ENUM = 0x41;
+pub const _MM_PERM_BAAC: _MM_PERM_ENUM = 0x42;
+pub const _MM_PERM_BAAD: _MM_PERM_ENUM = 0x43;
+pub const _MM_PERM_BABA: _MM_PERM_ENUM = 0x44;
+pub const _MM_PERM_BABB: _MM_PERM_ENUM = 0x45;
+pub const _MM_PERM_BABC: _MM_PERM_ENUM = 0x46;
+pub const _MM_PERM_BABD: _MM_PERM_ENUM = 0x47;
+pub const _MM_PERM_BACA: _MM_PERM_ENUM = 0x48;
+pub const _MM_PERM_BACB: _MM_PERM_ENUM = 0x49;
+pub const _MM_PERM_BACC: _MM_PERM_ENUM = 0x4A;
+pub const _MM_PERM_BACD: _MM_PERM_ENUM = 0x4B;
+pub const _MM_PERM_BADA: _MM_PERM_ENUM = 0x4C;
+pub const _MM_PERM_BADB: _MM_PERM_ENUM = 0x4D;
+pub const _MM_PERM_BADC: _MM_PERM_ENUM = 0x4E;
+pub const _MM_PERM_BADD: _MM_PERM_ENUM = 0x4F;
+pub const _MM_PERM_BBAA: _MM_PERM_ENUM = 0x50;
+pub const _MM_PERM_BBAB: _MM_PERM_ENUM = 0x51;
+pub const _MM_PERM_BBAC: _MM_PERM_ENUM = 0x52;
+pub const _MM_PERM_BBAD: _MM_PERM_ENUM = 0x53;
+pub const _MM_PERM_BBBA: _MM_PERM_ENUM = 0x54;
+pub const _MM_PERM_BBBB: _MM_PERM_ENUM = 0x55;
+pub const _MM_PERM_BBBC: _MM_PERM_ENUM = 0x56;
+pub const _MM_PERM_BBBD: _MM_PERM_ENUM = 0x57;
+pub const _MM_PERM_BBCA: _MM_PERM_ENUM = 0x58;
+pub const _MM_PERM_BBCB: _MM_PERM_ENUM = 0x59;
+pub const _MM_PERM_BBCC: _MM_PERM_ENUM = 0x5A;
+pub const _MM_PERM_BBCD: _MM_PERM_ENUM = 0x5B;
+pub const _MM_PERM_BBDA: _MM_PERM_ENUM = 0x5C;
+pub const _MM_PERM_BBDB: _MM_PERM_ENUM = 0x5D;
+pub const _MM_PERM_BBDC: _MM_PERM_ENUM = 0x5E;
+pub const _MM_PERM_BBDD: _MM_PERM_ENUM = 0x5F;
+pub const _MM_PERM_BCAA: _MM_PERM_ENUM = 0x60;
+pub const _MM_PERM_BCAB: _MM_PERM_ENUM = 0x61;
+pub const _MM_PERM_BCAC: _MM_PERM_ENUM = 0x62;
+pub const _MM_PERM_BCAD: _MM_PERM_ENUM = 0x63;
+pub const _MM_PERM_BCBA: _MM_PERM_ENUM = 0x64;
+pub const _MM_PERM_BCBB: _MM_PERM_ENUM = 0x65;
+pub const _MM_PERM_BCBC: _MM_PERM_ENUM = 0x66;
+pub const _MM_PERM_BCBD: _MM_PERM_ENUM = 0x67;
+pub const _MM_PERM_BCCA: _MM_PERM_ENUM = 0x68;
+pub const _MM_PERM_BCCB: _MM_PERM_ENUM = 0x69;
+pub const _MM_PERM_BCCC: _MM_PERM_ENUM = 0x6A;
+pub const _MM_PERM_BCCD: _MM_PERM_ENUM = 0x6B;
+pub const _MM_PERM_BCDA: _MM_PERM_ENUM = 0x6C;
+pub const _MM_PERM_BCDB: _MM_PERM_ENUM = 0x6D;
+pub const _MM_PERM_BCDC: _MM_PERM_ENUM = 0x6E;
+pub const _MM_PERM_BCDD: _MM_PERM_ENUM = 0x6F;
+pub const _MM_PERM_BDAA: _MM_PERM_ENUM = 0x70;
+pub const _MM_PERM_BDAB: _MM_PERM_ENUM = 0x71;
+pub const _MM_PERM_BDAC: _MM_PERM_ENUM = 0x72;
+pub const _MM_PERM_BDAD: _MM_PERM_ENUM = 0x73;
+pub const _MM_PERM_BDBA: _MM_PERM_ENUM = 0x74;
+pub const _MM_PERM_BDBB: _MM_PERM_ENUM = 0x75;
+pub const _MM_PERM_BDBC: _MM_PERM_ENUM = 0x76;
+pub const _MM_PERM_BDBD: _MM_PERM_ENUM = 0x77;
+pub const _MM_PERM_BDCA: _MM_PERM_ENUM = 0x78;
+pub const _MM_PERM_BDCB: _MM_PERM_ENUM = 0x79;
+pub const _MM_PERM_BDCC: _MM_PERM_ENUM = 0x7A;
+pub const _MM_PERM_BDCD: _MM_PERM_ENUM = 0x7B;
+pub const _MM_PERM_BDDA: _MM_PERM_ENUM = 0x7C;
+pub const _MM_PERM_BDDB: _MM_PERM_ENUM = 0x7D;
+pub const _MM_PERM_BDDC: _MM_PERM_ENUM = 0x7E;
+pub const _MM_PERM_BDDD: _MM_PERM_ENUM = 0x7F;
+pub const _MM_PERM_CAAA: _MM_PERM_ENUM = 0x80;
+pub const _MM_PERM_CAAB: _MM_PERM_ENUM = 0x81;
+pub const _MM_PERM_CAAC: _MM_PERM_ENUM = 0x82;
+pub const _MM_PERM_CAAD: _MM_PERM_ENUM = 0x83;
+pub const _MM_PERM_CABA: _MM_PERM_ENUM = 0x84;
+pub const _MM_PERM_CABB: _MM_PERM_ENUM = 0x85;
+pub const _MM_PERM_CABC: _MM_PERM_ENUM = 0x86;
+pub const _MM_PERM_CABD: _MM_PERM_ENUM = 0x87;
+pub const _MM_PERM_CACA: _MM_PERM_ENUM = 0x88;
+pub const _MM_PERM_CACB: _MM_PERM_ENUM = 0x89;
+pub const _MM_PERM_CACC: _MM_PERM_ENUM = 0x8A;
+pub const _MM_PERM_CACD: _MM_PERM_ENUM = 0x8B;
+pub const _MM_PERM_CADA: _MM_PERM_ENUM = 0x8C;
+pub const _MM_PERM_CADB: _MM_PERM_ENUM = 0x8D;
+pub const _MM_PERM_CADC: _MM_PERM_ENUM = 0x8E;
+pub const _MM_PERM_CADD: _MM_PERM_ENUM = 0x8F;
+pub const _MM_PERM_CBAA: _MM_PERM_ENUM = 0x90;
+pub const _MM_PERM_CBAB: _MM_PERM_ENUM = 0x91;
+pub const _MM_PERM_CBAC: _MM_PERM_ENUM = 0x92;
+pub const _MM_PERM_CBAD: _MM_PERM_ENUM = 0x93;
+pub const _MM_PERM_CBBA: _MM_PERM_ENUM = 0x94;
+pub const _MM_PERM_CBBB: _MM_PERM_ENUM = 0x95;
+pub const _MM_PERM_CBBC: _MM_PERM_ENUM = 0x96;
+pub const _MM_PERM_CBBD: _MM_PERM_ENUM = 0x97;
+pub const _MM_PERM_CBCA: _MM_PERM_ENUM = 0x98;
+pub const _MM_PERM_CBCB: _MM_PERM_ENUM = 0x99;
+pub const _MM_PERM_CBCC: _MM_PERM_ENUM = 0x9A;
+pub const _MM_PERM_CBCD: _MM_PERM_ENUM = 0x9B;
+pub const _MM_PERM_CBDA: _MM_PERM_ENUM = 0x9C;
+pub const _MM_PERM_CBDB: _MM_PERM_ENUM = 0x9D;
+pub const _MM_PERM_CBDC: _MM_PERM_ENUM = 0x9E;
+pub const _MM_PERM_CBDD: _MM_PERM_ENUM = 0x9F;
+pub const _MM_PERM_CCAA: _MM_PERM_ENUM = 0xA0;
+pub const _MM_PERM_CCAB: _MM_PERM_ENUM = 0xA1;
+pub const _MM_PERM_CCAC: _MM_PERM_ENUM = 0xA2;
+pub const _MM_PERM_CCAD: _MM_PERM_ENUM = 0xA3;
+pub const _MM_PERM_CCBA: _MM_PERM_ENUM = 0xA4;
+pub const _MM_PERM_CCBB: _MM_PERM_ENUM = 0xA5;
+pub const _MM_PERM_CCBC: _MM_PERM_ENUM = 0xA6;
+pub const _MM_PERM_CCBD: _MM_PERM_ENUM = 0xA7;
+pub const _MM_PERM_CCCA: _MM_PERM_ENUM = 0xA8;
+pub const _MM_PERM_CCCB: _MM_PERM_ENUM = 0xA9;
+pub const _MM_PERM_CCCC: _MM_PERM_ENUM = 0xAA;
+pub const _MM_PERM_CCCD: _MM_PERM_ENUM = 0xAB;
+pub const _MM_PERM_CCDA: _MM_PERM_ENUM = 0xAC;
+pub const _MM_PERM_CCDB: _MM_PERM_ENUM = 0xAD;
+pub const _MM_PERM_CCDC: _MM_PERM_ENUM = 0xAE;
+pub const _MM_PERM_CCDD: _MM_PERM_ENUM = 0xAF;
+pub const _MM_PERM_CDAA: _MM_PERM_ENUM = 0xB0;
+pub const _MM_PERM_CDAB: _MM_PERM_ENUM = 0xB1;
+pub const _MM_PERM_CDAC: _MM_PERM_ENUM = 0xB2;
+pub const _MM_PERM_CDAD: _MM_PERM_ENUM = 0xB3;
+pub const _MM_PERM_CDBA: _MM_PERM_ENUM = 0xB4;
+pub const _MM_PERM_CDBB: _MM_PERM_ENUM = 0xB5;
+pub const _MM_PERM_CDBC: _MM_PERM_ENUM = 0xB6;
+pub const _MM_PERM_CDBD: _MM_PERM_ENUM = 0xB7;
+pub const _MM_PERM_CDCA: _MM_PERM_ENUM = 0xB8;
+pub const _MM_PERM_CDCB: _MM_PERM_ENUM = 0xB9;
+pub const _MM_PERM_CDCC: _MM_PERM_ENUM = 0xBA;
+pub const _MM_PERM_CDCD: _MM_PERM_ENUM = 0xBB;
+pub const _MM_PERM_CDDA: _MM_PERM_ENUM = 0xBC;
+pub const _MM_PERM_CDDB: _MM_PERM_ENUM = 0xBD;
+pub const _MM_PERM_CDDC: _MM_PERM_ENUM = 0xBE;
+pub const _MM_PERM_CDDD: _MM_PERM_ENUM = 0xBF;
+pub const _MM_PERM_DAAA: _MM_PERM_ENUM = 0xC0;
+pub const _MM_PERM_DAAB: _MM_PERM_ENUM = 0xC1;
+pub const _MM_PERM_DAAC: _MM_PERM_ENUM = 0xC2;
+pub const _MM_PERM_DAAD: _MM_PERM_ENUM = 0xC3;
+pub const _MM_PERM_DABA: _MM_PERM_ENUM = 0xC4;
+pub const _MM_PERM_DABB: _MM_PERM_ENUM = 0xC5;
+pub const _MM_PERM_DABC: _MM_PERM_ENUM = 0xC6;
+pub const _MM_PERM_DABD: _MM_PERM_ENUM = 0xC7;
+pub const _MM_PERM_DACA: _MM_PERM_ENUM = 0xC8;
+pub const _MM_PERM_DACB: _MM_PERM_ENUM = 0xC9;
+pub const _MM_PERM_DACC: _MM_PERM_ENUM = 0xCA;
+pub const _MM_PERM_DACD: _MM_PERM_ENUM = 0xCB;
+pub const _MM_PERM_DADA: _MM_PERM_ENUM = 0xCC;
+pub const _MM_PERM_DADB: _MM_PERM_ENUM = 0xCD;
+pub const _MM_PERM_DADC: _MM_PERM_ENUM = 0xCE;
+pub const _MM_PERM_DADD: _MM_PERM_ENUM = 0xCF;
+pub const _MM_PERM_DBAA: _MM_PERM_ENUM = 0xD0;
+pub const _MM_PERM_DBAB: _MM_PERM_ENUM = 0xD1;
+pub const _MM_PERM_DBAC: _MM_PERM_ENUM = 0xD2;
+pub const _MM_PERM_DBAD: _MM_PERM_ENUM = 0xD3;
+pub const _MM_PERM_DBBA: _MM_PERM_ENUM = 0xD4;
+pub const _MM_PERM_DBBB: _MM_PERM_ENUM = 0xD5;
+pub const _MM_PERM_DBBC: _MM_PERM_ENUM = 0xD6;
+pub const _MM_PERM_DBBD: _MM_PERM_ENUM = 0xD7;
+pub const _MM_PERM_DBCA: _MM_PERM_ENUM = 0xD8;
+pub const _MM_PERM_DBCB: _MM_PERM_ENUM = 0xD9;
+pub const _MM_PERM_DBCC: _MM_PERM_ENUM = 0xDA;
+pub const _MM_PERM_DBCD: _MM_PERM_ENUM = 0xDB;
+pub const _MM_PERM_DBDA: _MM_PERM_ENUM = 0xDC;
+pub const _MM_PERM_DBDB: _MM_PERM_ENUM = 0xDD;
+pub const _MM_PERM_DBDC: _MM_PERM_ENUM = 0xDE;
+pub const _MM_PERM_DBDD: _MM_PERM_ENUM = 0xDF;
+pub const _MM_PERM_DCAA: _MM_PERM_ENUM = 0xE0;
+pub const _MM_PERM_DCAB: _MM_PERM_ENUM = 0xE1;
+pub const _MM_PERM_DCAC: _MM_PERM_ENUM = 0xE2;
+pub const _MM_PERM_DCAD: _MM_PERM_ENUM = 0xE3;
+pub const _MM_PERM_DCBA: _MM_PERM_ENUM = 0xE4;
+pub const _MM_PERM_DCBB: _MM_PERM_ENUM = 0xE5;
+pub const _MM_PERM_DCBC: _MM_PERM_ENUM = 0xE6;
+pub const _MM_PERM_DCBD: _MM_PERM_ENUM = 0xE7;
+pub const _MM_PERM_DCCA: _MM_PERM_ENUM = 0xE8;
+pub const _MM_PERM_DCCB: _MM_PERM_ENUM = 0xE9;
+pub const _MM_PERM_DCCC: _MM_PERM_ENUM = 0xEA;
+pub const _MM_PERM_DCCD: _MM_PERM_ENUM = 0xEB;
+pub const _MM_PERM_DCDA: _MM_PERM_ENUM = 0xEC;
+pub const _MM_PERM_DCDB: _MM_PERM_ENUM = 0xED;
+pub const _MM_PERM_DCDC: _MM_PERM_ENUM = 0xEE;
+pub const _MM_PERM_DCDD: _MM_PERM_ENUM = 0xEF;
+pub const _MM_PERM_DDAA: _MM_PERM_ENUM = 0xF0;
+pub const _MM_PERM_DDAB: _MM_PERM_ENUM = 0xF1;
+pub const _MM_PERM_DDAC: _MM_PERM_ENUM = 0xF2;
+pub const _MM_PERM_DDAD: _MM_PERM_ENUM = 0xF3;
+pub const _MM_PERM_DDBA: _MM_PERM_ENUM = 0xF4;
+pub const _MM_PERM_DDBB: _MM_PERM_ENUM = 0xF5;
+pub const _MM_PERM_DDBC: _MM_PERM_ENUM = 0xF6;
+pub const _MM_PERM_DDBD: _MM_PERM_ENUM = 0xF7;
+pub const _MM_PERM_DDCA: _MM_PERM_ENUM = 0xF8;
+pub const _MM_PERM_DDCB: _MM_PERM_ENUM = 0xF9;
+pub const _MM_PERM_DDCC: _MM_PERM_ENUM = 0xFA;
+pub const _MM_PERM_DDCD: _MM_PERM_ENUM = 0xFB;
+pub const _MM_PERM_DDDA: _MM_PERM_ENUM = 0xFC;
+pub const _MM_PERM_DDDB: _MM_PERM_ENUM = 0xFD;
+pub const _MM_PERM_DDDC: _MM_PERM_ENUM = 0xFE;
+pub const _MM_PERM_DDDD: _MM_PERM_ENUM = 0xFF;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.avx512.pmul.dq.512"]
+ fn vpmuldq(a: i32x16, b: i32x16) -> i64x8;
+ #[link_name = "llvm.x86.avx512.pmulu.dq.512"]
+ fn vpmuludq(a: u32x16, b: u32x16) -> u64x8;
+
+ #[link_name = "llvm.x86.avx512.mask.pmaxs.d.512"]
+ fn vpmaxsd(a: i32x16, b: i32x16) -> i32x16;
+
+ #[link_name = "llvm.x86.avx512.mask.pmaxs.q.512"]
+ fn vpmaxsq(a: i64x8, b: i64x8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.mask.pmaxs.q.256"]
+ fn vpmaxsq256(a: i64x4, b: i64x4) -> i64x4;
+ #[link_name = "llvm.x86.avx512.mask.pmaxs.q.128"]
+ fn vpmaxsq128(a: i64x2, b: i64x2) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.pmins.d.512"]
+ fn vpminsd(a: i32x16, b: i32x16) -> i32x16;
+
+ #[link_name = "llvm.x86.avx512.mask.pmins.q.512"]
+ fn vpminsq(a: i64x8, b: i64x8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.mask.pmins.q.256"]
+ fn vpminsq256(a: i64x4, b: i64x4) -> i64x4;
+ #[link_name = "llvm.x86.avx512.mask.pmins.q.128"]
+ fn vpminsq128(a: i64x2, b: i64x2) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.pmaxu.d.512"]
+ fn vpmaxud(a: u32x16, b: u32x16) -> u32x16;
+
+ #[link_name = "llvm.x86.avx512.mask.pmaxu.q.512"]
+ fn vpmaxuq(a: u64x8, b: u64x8) -> u64x8;
+ #[link_name = "llvm.x86.avx512.mask.pmaxu.q.256"]
+ fn vpmaxuq256(a: u64x4, b: u64x4) -> u64x4;
+ #[link_name = "llvm.x86.avx512.mask.pmaxu.q.128"]
+ fn vpmaxuq128(a: u64x2, b: u64x2) -> u64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.pminu.d.512"]
+ fn vpminud(a: u32x16, b: u32x16) -> u32x16;
+
+ #[link_name = "llvm.x86.avx512.mask.pminu.q.512"]
+ fn vpminuq(a: u64x8, b: u64x8) -> u64x8;
+ #[link_name = "llvm.x86.avx512.mask.pminu.q.256"]
+ fn vpminuq256(a: u64x4, b: u64x4) -> u64x4;
+ #[link_name = "llvm.x86.avx512.mask.pminu.q.128"]
+ fn vpminuq128(a: u64x2, b: u64x2) -> u64x2;
+
+ #[link_name = "llvm.x86.avx512.sqrt.ps.512"]
+ fn vsqrtps(a: f32x16, rounding: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.sqrt.pd.512"]
+ fn vsqrtpd(a: f64x8, rounding: i32) -> f64x8;
+
+ #[link_name = "llvm.fma.v16f32"]
+ fn vfmadd132ps(a: f32x16, b: f32x16, c: f32x16) -> f32x16;
+ #[link_name = "llvm.fma.v8f64"]
+ fn vfmadd132pd(a: f64x8, b: f64x8, c: f64x8) -> f64x8;
+
+ #[link_name = "llvm.x86.avx512.vfmadd.ps.512"]
+ fn vfmadd132psround(a: f32x16, b: f32x16, c: f32x16, rounding: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.vfmadd.pd.512"]
+ fn vfmadd132pdround(a: f64x8, b: f64x8, c: f64x8, rounding: i32) -> f64x8;
+
+ #[link_name = "llvm.x86.avx512.vfmaddsub.ps.512"]
+ fn vfmaddsub213ps(a: f32x16, b: f32x16, c: f32x16, d: i32) -> f32x16; //from clang
+ #[link_name = "llvm.x86.avx512.vfmaddsub.pd.512"]
+ fn vfmaddsub213pd(a: f64x8, b: f64x8, c: f64x8, d: i32) -> f64x8; //from clang
+
+ #[link_name = "llvm.x86.avx512.add.ps.512"]
+ fn vaddps(a: f32x16, b: f32x16, rounding: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.add.pd.512"]
+ fn vaddpd(a: f64x8, b: f64x8, rounding: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.sub.ps.512"]
+ fn vsubps(a: f32x16, b: f32x16, rounding: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.sub.pd.512"]
+ fn vsubpd(a: f64x8, b: f64x8, rounding: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.mul.ps.512"]
+ fn vmulps(a: f32x16, b: f32x16, rounding: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.mul.pd.512"]
+ fn vmulpd(a: f64x8, b: f64x8, rounding: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.div.ps.512"]
+ fn vdivps(a: f32x16, b: f32x16, rounding: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.div.pd.512"]
+ fn vdivpd(a: f64x8, b: f64x8, rounding: i32) -> f64x8;
+
+ #[link_name = "llvm.x86.avx512.max.ps.512"]
+ fn vmaxps(a: f32x16, b: f32x16, sae: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.max.pd.512"]
+ fn vmaxpd(a: f64x8, b: f64x8, sae: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.min.ps.512"]
+ fn vminps(a: f32x16, b: f32x16, sae: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.min.pd.512"]
+ fn vminpd(a: f64x8, b: f64x8, sae: i32) -> f64x8;
+
+ #[link_name = "llvm.x86.avx512.mask.getexp.ps.512"]
+ fn vgetexpps(a: f32x16, src: f32x16, m: u16, sae: i32) -> f32x16;
+
+ #[link_name = "llvm.x86.avx512.mask.getexp.ps.256"]
+ fn vgetexpps256(a: f32x8, src: f32x8, m: u8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.mask.getexp.ps.128"]
+ fn vgetexpps128(a: f32x4, src: f32x4, m: u8) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.getexp.pd.512"]
+ fn vgetexppd(a: f64x8, src: f64x8, m: u8, sae: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.mask.getexp.pd.256"]
+ fn vgetexppd256(a: f64x4, src: f64x4, m: u8) -> f64x4;
+ #[link_name = "llvm.x86.avx512.mask.getexp.pd.128"]
+ fn vgetexppd128(a: f64x2, src: f64x2, m: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.rndscale.ps.512"]
+ fn vrndscaleps(a: f32x16, imm8: i32, src: f32x16, mask: u16, sae: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.mask.rndscale.ps.256"]
+ fn vrndscaleps256(a: f32x8, imm8: i32, src: f32x8, mask: u8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.mask.rndscale.ps.128"]
+ fn vrndscaleps128(a: f32x4, imm8: i32, src: f32x4, mask: u8) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.rndscale.pd.512"]
+ fn vrndscalepd(a: f64x8, imm8: i32, src: f64x8, mask: u8, sae: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.mask.rndscale.pd.256"]
+ fn vrndscalepd256(a: f64x4, imm8: i32, src: f64x4, mask: u8) -> f64x4;
+ #[link_name = "llvm.x86.avx512.mask.rndscale.pd.128"]
+ fn vrndscalepd128(a: f64x2, imm8: i32, src: f64x2, mask: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.scalef.ps.512"]
+ fn vscalefps(a: f32x16, b: f32x16, src: f32x16, mask: u16, rounding: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.mask.scalef.ps.256"]
+ fn vscalefps256(a: f32x8, b: f32x8, src: f32x8, mask: u8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.mask.scalef.ps.128"]
+ fn vscalefps128(a: f32x4, b: f32x4, src: f32x4, mask: u8) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.scalef.pd.512"]
+ fn vscalefpd(a: f64x8, b: f64x8, src: f64x8, mask: u8, rounding: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.mask.scalef.pd.256"]
+ fn vscalefpd256(a: f64x4, b: f64x4, src: f64x4, mask: u8) -> f64x4;
+ #[link_name = "llvm.x86.avx512.mask.scalef.pd.128"]
+ fn vscalefpd128(a: f64x2, b: f64x2, src: f64x2, mask: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.fixupimm.ps.512"]
+ fn vfixupimmps(a: f32x16, b: f32x16, c: i32x16, imm8: i32, mask: u16, sae: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.mask.fixupimm.ps.256"]
+ fn vfixupimmps256(a: f32x8, b: f32x8, c: i32x8, imm8: i32, mask: u8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.mask.fixupimm.ps.128"]
+ fn vfixupimmps128(a: f32x4, b: f32x4, c: i32x4, imm8: i32, mask: u8) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.fixupimm.pd.512"]
+ fn vfixupimmpd(a: f64x8, b: f64x8, c: i64x8, imm8: i32, mask: u8, sae: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.mask.fixupimm.pd.256"]
+ fn vfixupimmpd256(a: f64x4, b: f64x4, c: i64x4, imm8: i32, mask: u8) -> f64x4;
+ #[link_name = "llvm.x86.avx512.mask.fixupimm.pd.128"]
+ fn vfixupimmpd128(a: f64x2, b: f64x2, c: i64x2, imm8: i32, mask: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.maskz.fixupimm.ps.512"]
+ fn vfixupimmpsz(a: f32x16, b: f32x16, c: i32x16, imm8: i32, mask: u16, sae: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.maskz.fixupimm.ps.256"]
+ fn vfixupimmpsz256(a: f32x8, b: f32x8, c: i32x8, imm8: i32, mask: u8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.maskz.fixupimm.ps.128"]
+ fn vfixupimmpsz128(a: f32x4, b: f32x4, c: i32x4, imm8: i32, mask: u8) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.maskz.fixupimm.pd.512"]
+ fn vfixupimmpdz(a: f64x8, b: f64x8, c: i64x8, imm8: i32, mask: u8, sae: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.maskz.fixupimm.pd.256"]
+ fn vfixupimmpdz256(a: f64x4, b: f64x4, c: i64x4, imm8: i32, mask: u8) -> f64x4;
+ #[link_name = "llvm.x86.avx512.maskz.fixupimm.pd.128"]
+ fn vfixupimmpdz128(a: f64x2, b: f64x2, c: i64x2, imm8: i32, mask: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.pternlog.d.512"]
+ fn vpternlogd(a: i32x16, b: i32x16, c: i32x16, imm8: i32) -> i32x16;
+ #[link_name = "llvm.x86.avx512.pternlog.d.256"]
+ fn vpternlogd256(a: i32x8, b: i32x8, c: i32x8, imm8: i32) -> i32x8;
+ #[link_name = "llvm.x86.avx512.pternlog.d.128"]
+ fn vpternlogd128(a: i32x4, b: i32x4, c: i32x4, imm8: i32) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.pternlog.q.512"]
+ fn vpternlogq(a: i64x8, b: i64x8, c: i64x8, imm8: i32) -> i64x8;
+ #[link_name = "llvm.x86.avx512.pternlog.q.256"]
+ fn vpternlogq256(a: i64x4, b: i64x4, c: i64x4, imm8: i32) -> i64x4;
+ #[link_name = "llvm.x86.avx512.pternlog.q.128"]
+ fn vpternlogq128(a: i64x2, b: i64x2, c: i64x2, imm8: i32) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.getmant.ps.512"]
+ fn vgetmantps(a: f32x16, mantissas: i32, src: f32x16, m: u16, sae: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.mask.getmant.ps.256"]
+ fn vgetmantps256(a: f32x8, mantissas: i32, src: f32x8, m: u8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.mask.getmant.ps.128"]
+ fn vgetmantps128(a: f32x4, mantissas: i32, src: f32x4, m: u8) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.getmant.pd.512"]
+ fn vgetmantpd(a: f64x8, mantissas: i32, src: f64x8, m: u8, sae: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.mask.getmant.pd.256"]
+ fn vgetmantpd256(a: f64x4, mantissas: i32, src: f64x4, m: u8) -> f64x4;
+ #[link_name = "llvm.x86.avx512.mask.getmant.pd.128"]
+ fn vgetmantpd128(a: f64x2, mantissas: i32, src: f64x2, m: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.rcp14.ps.512"]
+ fn vrcp14ps(a: f32x16, src: f32x16, m: u16) -> f32x16;
+ #[link_name = "llvm.x86.avx512.rcp14.ps.256"]
+ fn vrcp14ps256(a: f32x8, src: f32x8, m: u8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.rcp14.ps.128"]
+ fn vrcp14ps128(a: f32x4, src: f32x4, m: u8) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.rcp14.pd.512"]
+ fn vrcp14pd(a: f64x8, src: f64x8, m: u8) -> f64x8;
+ #[link_name = "llvm.x86.avx512.rcp14.pd.256"]
+ fn vrcp14pd256(a: f64x4, src: f64x4, m: u8) -> f64x4;
+ #[link_name = "llvm.x86.avx512.rcp14.pd.128"]
+ fn vrcp14pd128(a: f64x2, src: f64x2, m: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.rsqrt14.ps.512"]
+ fn vrsqrt14ps(a: f32x16, src: f32x16, m: u16) -> f32x16;
+ #[link_name = "llvm.x86.avx512.rsqrt14.ps.256"]
+ fn vrsqrt14ps256(a: f32x8, src: f32x8, m: u8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.rsqrt14.ps.128"]
+ fn vrsqrt14ps128(a: f32x4, src: f32x4, m: u8) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.rsqrt14.pd.512"]
+ fn vrsqrt14pd(a: f64x8, src: f64x8, m: u8) -> f64x8;
+ #[link_name = "llvm.x86.avx512.rsqrt14.pd.256"]
+ fn vrsqrt14pd256(a: f64x4, src: f64x4, m: u8) -> f64x4;
+ #[link_name = "llvm.x86.avx512.rsqrt14.pd.128"]
+ fn vrsqrt14pd128(a: f64x2, src: f64x2, m: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.cvtps2dq.512"]
+ fn vcvtps2dq(a: f32x16, src: i32x16, mask: u16, rounding: i32) -> i32x16;
+
+ #[link_name = "llvm.x86.avx512.mask.cvtps2udq.512"]
+ fn vcvtps2udq(a: f32x16, src: u32x16, mask: u16, rounding: i32) -> u32x16;
+ #[link_name = "llvm.x86.avx512.mask.cvtps2udq.256"]
+ fn vcvtps2udq256(a: f32x8, src: u32x8, mask: u8) -> u32x8;
+ #[link_name = "llvm.x86.avx512.mask.cvtps2udq.128"]
+ fn vcvtps2udq128(a: f32x4, src: u32x4, mask: u8) -> u32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.cvtps2pd.512"]
+ fn vcvtps2pd(a: f32x8, src: f64x8, mask: u8, sae: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.mask.cvtpd2ps.512"]
+ fn vcvtpd2ps(a: f64x8, src: f32x8, mask: u8, rounding: i32) -> f32x8;
+
+ #[link_name = "llvm.x86.avx512.mask.cvtpd2dq.512"]
+ fn vcvtpd2dq(a: f64x8, src: i32x8, mask: u8, rounding: i32) -> i32x8;
+
+ #[link_name = "llvm.x86.avx512.mask.cvtpd2udq.512"]
+ fn vcvtpd2udq(a: f64x8, src: u32x8, mask: u8, rounding: i32) -> u32x8;
+ #[link_name = "llvm.x86.avx512.mask.cvtpd2udq.256"]
+ fn vcvtpd2udq256(a: f64x4, src: u32x4, mask: u8) -> u32x4;
+ #[link_name = "llvm.x86.avx512.mask.cvtpd2udq.128"]
+ fn vcvtpd2udq128(a: f64x2, src: u32x4, mask: u8) -> u32x4;
+
+ #[link_name = "llvm.x86.avx512.sitofp.round.v16f32.v16i32"]
+ fn vcvtdq2ps(a: i32x16, rounding: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.uitofp.round.v16f32.v16i32"]
+ fn vcvtudq2ps(a: u32x16, rounding: i32) -> f32x16;
+
+ #[link_name = "llvm.x86.avx512.mask.vcvtps2ph.512"]
+ fn vcvtps2ph(a: f32x16, sae: i32, src: i16x16, mask: u16) -> i16x16;
+ #[link_name = "llvm.x86.avx512.mask.vcvtps2ph.256"]
+ fn vcvtps2ph256(a: f32x8, sae: i32, src: i16x8, mask: u8) -> i16x8;
+ #[link_name = "llvm.x86.avx512.mask.vcvtps2ph.128"]
+ fn vcvtps2ph128(a: f32x4, sae: i32, src: i16x8, mask: u8) -> i16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.vcvtph2ps.512"]
+ fn vcvtph2ps(a: i16x16, src: f32x16, mask: u16, sae: i32) -> f32x16;
+
+ #[link_name = "llvm.x86.avx512.mask.cvttps2dq.512"]
+ fn vcvttps2dq(a: f32x16, src: i32x16, mask: u16, rounding: i32) -> i32x16;
+ #[link_name = "llvm.x86.avx512.mask.cvttps2dq.256"]
+ fn vcvttps2dq256(a: f32x8, src: i32x8, mask: u8) -> i32x8;
+ #[link_name = "llvm.x86.avx512.mask.cvttps2dq.128"]
+ fn vcvttps2dq128(a: f32x4, src: i32x4, mask: u8) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.cvttps2udq.512"]
+ fn vcvttps2udq(a: f32x16, src: u32x16, mask: u16, rounding: i32) -> u32x16;
+ #[link_name = "llvm.x86.avx512.mask.cvttps2udq.256"]
+ fn vcvttps2udq256(a: f32x8, src: u32x8, mask: u8) -> u32x8;
+ #[link_name = "llvm.x86.avx512.mask.cvttps2udq.128"]
+ fn vcvttps2udq128(a: f32x4, src: u32x4, mask: u8) -> u32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.cvttpd2dq.512"]
+ fn vcvttpd2dq(a: f64x8, src: i32x8, mask: u8, rounding: i32) -> i32x8;
+ #[link_name = "llvm.x86.avx512.mask.cvttpd2dq.256"]
+ fn vcvttpd2dq256(a: f64x4, src: i32x4, mask: u8) -> i32x4;
+ #[link_name = "llvm.x86.avx512.mask.cvttpd2dq.128"]
+ fn vcvttpd2dq128(a: f64x2, src: i32x4, mask: u8) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.cvttpd2udq.512"]
+ fn vcvttpd2udq(a: f64x8, src: i32x8, mask: u8, rounding: i32) -> u32x8;
+ #[link_name = "llvm.x86.avx512.mask.cvttpd2udq.256"]
+ fn vcvttpd2udq256(a: f64x4, src: i32x4, mask: u8) -> u32x4;
+ #[link_name = "llvm.x86.avx512.mask.cvttpd2udq.128"]
+ fn vcvttpd2udq128(a: f64x2, src: i32x4, mask: u8) -> u32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.pmov.dw.128"]
+ fn vpmovdw128(a: i32x4, src: i16x8, mask: u8) -> i16x8;
+ #[link_name = "llvm.x86.avx512.mask.pmov.db.256"]
+ fn vpmovdb256(a: i32x8, src: i8x16, mask: u8) -> i8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmov.db.128"]
+ fn vpmovdb128(a: i32x4, src: i8x16, mask: u8) -> i8x16;
+
+ #[link_name = "llvm.x86.avx512.mask.pmov.qw.256"]
+ fn vpmovqw256(a: i64x4, src: i16x8, mask: u8) -> i16x8;
+ #[link_name = "llvm.x86.avx512.mask.pmov.qw.128"]
+ fn vpmovqw128(a: i64x2, src: i16x8, mask: u8) -> i16x8;
+ #[link_name = "llvm.x86.avx512.mask.pmov.qb.256"]
+ fn vpmovqb256(a: i64x4, src: i8x16, mask: u8) -> i8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmov.qb.128"]
+ fn vpmovqb128(a: i64x2, src: i8x16, mask: u8) -> i8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmov.qd.128"]
+ fn vpmovqd128(a: i64x2, src: i32x4, mask: u8) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.pmov.dw.mem.512"]
+ fn vpmovdwmem(mem_addr: *mut i8, a: i32x16, mask: u16);
+ #[link_name = "llvm.x86.avx512.mask.pmov.dw.mem.256"]
+ fn vpmovdwmem256(mem_addr: *mut i8, a: i32x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmov.dw.mem.128"]
+ fn vpmovdwmem128(mem_addr: *mut i8, a: i32x4, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmovs.dw.mem.512"]
+ fn vpmovsdwmem(mem_addr: *mut i8, a: i32x16, mask: u16);
+ #[link_name = "llvm.x86.avx512.mask.pmovs.dw.mem.256"]
+ fn vpmovsdwmem256(mem_addr: *mut i8, a: i32x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovs.dw.mem.128"]
+ fn vpmovsdwmem128(mem_addr: *mut i8, a: i32x4, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmovus.dw.mem.512"]
+ fn vpmovusdwmem(mem_addr: *mut i8, a: i32x16, mask: u16);
+ #[link_name = "llvm.x86.avx512.mask.pmovus.dw.mem.256"]
+ fn vpmovusdwmem256(mem_addr: *mut i8, a: i32x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovus.dw.mem.128"]
+ fn vpmovusdwmem128(mem_addr: *mut i8, a: i32x4, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmov.db.mem.512"]
+ fn vpmovdbmem(mem_addr: *mut i8, a: i32x16, mask: u16);
+ #[link_name = "llvm.x86.avx512.mask.pmov.db.mem.256"]
+ fn vpmovdbmem256(mem_addr: *mut i8, a: i32x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmov.db.mem.128"]
+ fn vpmovdbmem128(mem_addr: *mut i8, a: i32x4, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmovs.db.mem.512"]
+ fn vpmovsdbmem(mem_addr: *mut i8, a: i32x16, mask: u16);
+ #[link_name = "llvm.x86.avx512.mask.pmovs.db.mem.256"]
+ fn vpmovsdbmem256(mem_addr: *mut i8, a: i32x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovs.db.mem.128"]
+ fn vpmovsdbmem128(mem_addr: *mut i8, a: i32x4, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmovus.db.mem.512"]
+ fn vpmovusdbmem(mem_addr: *mut i8, a: i32x16, mask: u16);
+ #[link_name = "llvm.x86.avx512.mask.pmovus.db.mem.256"]
+ fn vpmovusdbmem256(mem_addr: *mut i8, a: i32x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovus.db.mem.128"]
+ fn vpmovusdbmem128(mem_addr: *mut i8, a: i32x4, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmov.qw.mem.512"]
+ fn vpmovqwmem(mem_addr: *mut i8, a: i64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmov.qw.mem.256"]
+ fn vpmovqwmem256(mem_addr: *mut i8, a: i64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmov.qw.mem.128"]
+ fn vpmovqwmem128(mem_addr: *mut i8, a: i64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qw.mem.512"]
+ fn vpmovsqwmem(mem_addr: *mut i8, a: i64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qw.mem.256"]
+ fn vpmovsqwmem256(mem_addr: *mut i8, a: i64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qw.mem.128"]
+ fn vpmovsqwmem128(mem_addr: *mut i8, a: i64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qw.mem.512"]
+ fn vpmovusqwmem(mem_addr: *mut i8, a: i64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qw.mem.256"]
+ fn vpmovusqwmem256(mem_addr: *mut i8, a: i64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qw.mem.128"]
+ fn vpmovusqwmem128(mem_addr: *mut i8, a: i64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmov.qb.mem.512"]
+ fn vpmovqbmem(mem_addr: *mut i8, a: i64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmov.qb.mem.256"]
+ fn vpmovqbmem256(mem_addr: *mut i8, a: i64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmov.qb.mem.128"]
+ fn vpmovqbmem128(mem_addr: *mut i8, a: i64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qb.mem.512"]
+ fn vpmovsqbmem(mem_addr: *mut i8, a: i64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qb.mem.256"]
+ fn vpmovsqbmem256(mem_addr: *mut i8, a: i64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qb.mem.128"]
+ fn vpmovsqbmem128(mem_addr: *mut i8, a: i64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qb.mem.512"]
+ fn vpmovusqbmem(mem_addr: *mut i8, a: i64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qb.mem.256"]
+ fn vpmovusqbmem256(mem_addr: *mut i8, a: i64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qb.mem.128"]
+ fn vpmovusqbmem128(mem_addr: *mut i8, a: i64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmov.qd.mem.512"]
+ fn vpmovqdmem(mem_addr: *mut i8, a: i64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmov.qd.mem.256"]
+ fn vpmovqdmem256(mem_addr: *mut i8, a: i64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmov.qd.mem.128"]
+ fn vpmovqdmem128(mem_addr: *mut i8, a: i64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qd.mem.512"]
+ fn vpmovsqdmem(mem_addr: *mut i8, a: i64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qd.mem.256"]
+ fn vpmovsqdmem256(mem_addr: *mut i8, a: i64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qd.mem.128"]
+ fn vpmovsqdmem128(mem_addr: *mut i8, a: i64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qd.mem.512"]
+ fn vpmovusqdmem(mem_addr: *mut i8, a: i64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qd.mem.256"]
+ fn vpmovusqdmem256(mem_addr: *mut i8, a: i64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qd.mem.128"]
+ fn vpmovusqdmem128(mem_addr: *mut i8, a: i64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.pmov.qb.512"]
+ fn vpmovqb(a: i64x8, src: i8x16, mask: u8) -> i8x16;
+
+ #[link_name = "llvm.x86.avx512.mask.pmovs.dw.512"]
+ fn vpmovsdw(a: i32x16, src: i16x16, mask: u16) -> i16x16;
+ #[link_name = "llvm.x86.avx512.mask.pmovs.dw.256"]
+ fn vpmovsdw256(a: i32x8, src: i16x8, mask: u8) -> i16x8;
+ #[link_name = "llvm.x86.avx512.mask.pmovs.dw.128"]
+ fn vpmovsdw128(a: i32x4, src: i16x8, mask: u8) -> i16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.pmovs.db.512"]
+ fn vpmovsdb(a: i32x16, src: i8x16, mask: u16) -> i8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmovs.db.256"]
+ fn vpmovsdb256(a: i32x8, src: i8x16, mask: u8) -> i8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmovs.db.128"]
+ fn vpmovsdb128(a: i32x4, src: i8x16, mask: u8) -> i8x16;
+
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qd.512"]
+ fn vpmovsqd(a: i64x8, src: i32x8, mask: u8) -> i32x8;
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qd.256"]
+ fn vpmovsqd256(a: i64x4, src: i32x4, mask: u8) -> i32x4;
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qd.128"]
+ fn vpmovsqd128(a: i64x2, src: i32x4, mask: u8) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qw.512"]
+ fn vpmovsqw(a: i64x8, src: i16x8, mask: u8) -> i16x8;
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qw.256"]
+ fn vpmovsqw256(a: i64x4, src: i16x8, mask: u8) -> i16x8;
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qw.128"]
+ fn vpmovsqw128(a: i64x2, src: i16x8, mask: u8) -> i16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qb.512"]
+ fn vpmovsqb(a: i64x8, src: i8x16, mask: u8) -> i8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qb.256"]
+ fn vpmovsqb256(a: i64x4, src: i8x16, mask: u8) -> i8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmovs.qb.128"]
+ fn vpmovsqb128(a: i64x2, src: i8x16, mask: u8) -> i8x16;
+
+ #[link_name = "llvm.x86.avx512.mask.pmovus.dw.512"]
+ fn vpmovusdw(a: u32x16, src: u16x16, mask: u16) -> u16x16;
+ #[link_name = "llvm.x86.avx512.mask.pmovus.dw.256"]
+ fn vpmovusdw256(a: u32x8, src: u16x8, mask: u8) -> u16x8;
+ #[link_name = "llvm.x86.avx512.mask.pmovus.dw.128"]
+ fn vpmovusdw128(a: u32x4, src: u16x8, mask: u8) -> u16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.pmovus.db.512"]
+ fn vpmovusdb(a: u32x16, src: u8x16, mask: u16) -> u8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmovus.db.256"]
+ fn vpmovusdb256(a: u32x8, src: u8x16, mask: u8) -> u8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmovus.db.128"]
+ fn vpmovusdb128(a: u32x4, src: u8x16, mask: u8) -> u8x16;
+
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qd.512"]
+ fn vpmovusqd(a: u64x8, src: u32x8, mask: u8) -> u32x8;
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qd.256"]
+ fn vpmovusqd256(a: u64x4, src: u32x4, mask: u8) -> u32x4;
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qd.128"]
+ fn vpmovusqd128(a: u64x2, src: u32x4, mask: u8) -> u32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qw.512"]
+ fn vpmovusqw(a: u64x8, src: u16x8, mask: u8) -> u16x8;
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qw.256"]
+ fn vpmovusqw256(a: u64x4, src: u16x8, mask: u8) -> u16x8;
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qw.128"]
+ fn vpmovusqw128(a: u64x2, src: u16x8, mask: u8) -> u16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qb.512"]
+ fn vpmovusqb(a: u64x8, src: u8x16, mask: u8) -> u8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qb.256"]
+ fn vpmovusqb256(a: u64x4, src: u8x16, mask: u8) -> u8x16;
+ #[link_name = "llvm.x86.avx512.mask.pmovus.qb.128"]
+ fn vpmovusqb128(a: u64x2, src: u8x16, mask: u8) -> u8x16;
+
+ #[link_name = "llvm.x86.avx512.gather.dpd.512"]
+ fn vgatherdpd(src: f64x8, slice: *const i8, offsets: i32x8, mask: i8, scale: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.gather.dps.512"]
+ fn vgatherdps(src: f32x16, slice: *const i8, offsets: i32x16, mask: i16, scale: i32) -> f32x16;
+ #[link_name = "llvm.x86.avx512.gather.qpd.512"]
+ fn vgatherqpd(src: f64x8, slice: *const i8, offsets: i64x8, mask: i8, scale: i32) -> f64x8;
+ #[link_name = "llvm.x86.avx512.gather.qps.512"]
+ fn vgatherqps(src: f32x8, slice: *const i8, offsets: i64x8, mask: i8, scale: i32) -> f32x8;
+ #[link_name = "llvm.x86.avx512.gather.dpq.512"]
+ fn vpgatherdq(src: i64x8, slice: *const i8, offsets: i32x8, mask: i8, scale: i32) -> i64x8;
+ #[link_name = "llvm.x86.avx512.gather.dpi.512"]
+ fn vpgatherdd(src: i32x16, slice: *const i8, offsets: i32x16, mask: i16, scale: i32) -> i32x16;
+ #[link_name = "llvm.x86.avx512.gather.qpq.512"]
+ fn vpgatherqq(src: i64x8, slice: *const i8, offsets: i64x8, mask: i8, scale: i32) -> i64x8;
+ #[link_name = "llvm.x86.avx512.gather.qpi.512"]
+ fn vpgatherqd(src: i32x8, slice: *const i8, offsets: i64x8, mask: i8, scale: i32) -> i32x8;
+
+ #[link_name = "llvm.x86.avx512.scatter.dpd.512"]
+ fn vscatterdpd(slice: *mut i8, mask: i8, offsets: i32x8, src: f64x8, scale: i32);
+ #[link_name = "llvm.x86.avx512.scatter.dps.512"]
+ fn vscatterdps(slice: *mut i8, mask: i16, offsets: i32x16, src: f32x16, scale: i32);
+ #[link_name = "llvm.x86.avx512.scatter.qpd.512"]
+ fn vscatterqpd(slice: *mut i8, mask: i8, offsets: i64x8, src: f64x8, scale: i32);
+ #[link_name = "llvm.x86.avx512.scatter.qps.512"]
+ fn vscatterqps(slice: *mut i8, mask: i8, offsets: i64x8, src: f32x8, scale: i32);
+ #[link_name = "llvm.x86.avx512.scatter.dpq.512"]
+ fn vpscatterdq(slice: *mut i8, mask: i8, offsets: i32x8, src: i64x8, scale: i32);
+
+ #[link_name = "llvm.x86.avx512.scatter.dpi.512"]
+ fn vpscatterdd(slice: *mut i8, mask: i16, offsets: i32x16, src: i32x16, scale: i32);
+ #[link_name = "llvm.x86.avx512.scatter.qpq.512"]
+ fn vpscatterqq(slice: *mut i8, mask: i8, offsets: i64x8, src: i64x8, scale: i32);
+ #[link_name = "llvm.x86.avx512.scatter.qpi.512"]
+ fn vpscatterqd(slice: *mut i8, mask: i8, offsets: i64x8, src: i32x8, scale: i32);
+
+ #[link_name = "llvm.x86.avx512.mask.cmp.ss"]
+ fn vcmpss(a: __m128, b: __m128, op: i32, m: i8, sae: i32) -> i8;
+ #[link_name = "llvm.x86.avx512.mask.cmp.sd"]
+ fn vcmpsd(a: __m128d, b: __m128d, op: i32, m: i8, sae: i32) -> i8;
+
+ #[link_name = "llvm.x86.avx512.mask.cmp.ps.512"]
+ fn vcmpps(a: f32x16, b: f32x16, op: i32, m: i16, sae: i32) -> i16;
+ #[link_name = "llvm.x86.avx512.mask.cmp.ps.256"]
+ fn vcmpps256(a: f32x8, b: f32x8, op: i32, m: i8) -> i8;
+ #[link_name = "llvm.x86.avx512.mask.cmp.ps.128"]
+ fn vcmpps128(a: f32x4, b: f32x4, op: i32, m: i8) -> i8;
+
+ #[link_name = "llvm.x86.avx512.mask.cmp.pd.512"]
+ fn vcmppd(a: f64x8, b: f64x8, op: i32, m: i8, sae: i32) -> i8;
+ #[link_name = "llvm.x86.avx512.mask.cmp.pd.256"]
+ fn vcmppd256(a: f64x4, b: f64x4, op: i32, m: i8) -> i8;
+ #[link_name = "llvm.x86.avx512.mask.cmp.pd.128"]
+ fn vcmppd128(a: f64x2, b: f64x2, op: i32, m: i8) -> i8;
+
+ #[link_name = "llvm.x86.avx512.mask.ucmp.q.512"]
+ fn vpcmpuq(a: i64x8, b: i64x8, op: i32, m: i8) -> i8;
+ #[link_name = "llvm.x86.avx512.mask.ucmp.q.256"]
+ fn vpcmpuq256(a: i64x4, b: i64x4, op: i32, m: i8) -> i8;
+ #[link_name = "llvm.x86.avx512.mask.ucmp.q.128"]
+ fn vpcmpuq128(a: i64x2, b: i64x2, op: i32, m: i8) -> i8;
+
+ #[link_name = "llvm.x86.avx512.mask.cmp.q.512"]
+ fn vpcmpq(a: i64x8, b: i64x8, op: i32, m: i8) -> i8;
+ #[link_name = "llvm.x86.avx512.mask.cmp.q.256"]
+ fn vpcmpq256(a: i64x4, b: i64x4, op: i32, m: i8) -> i8;
+ #[link_name = "llvm.x86.avx512.mask.cmp.q.128"]
+ fn vpcmpq128(a: i64x2, b: i64x2, op: i32, m: i8) -> i8;
+
+ #[link_name = "llvm.x86.avx512.mask.ucmp.d.512"]
+ fn vpcmpud(a: i32x16, b: i32x16, op: i32, m: i16) -> i16;
+ #[link_name = "llvm.x86.avx512.mask.ucmp.d.256"]
+ fn vpcmpud256(a: i32x8, b: i32x8, op: i32, m: i8) -> i8;
+ #[link_name = "llvm.x86.avx512.mask.ucmp.d.128"]
+ fn vpcmpud128(a: i32x4, b: i32x4, op: i32, m: i8) -> i8;
+
+ #[link_name = "llvm.x86.avx512.mask.cmp.d.512"]
+ fn vpcmpd(a: i32x16, b: i32x16, op: i32, m: i16) -> i16;
+ #[link_name = "llvm.x86.avx512.mask.cmp.d.256"]
+ fn vpcmpd256(a: i32x8, b: i32x8, op: i32, m: i8) -> i8;
+ #[link_name = "llvm.x86.avx512.mask.cmp.d.128"]
+ fn vpcmpd128(a: i32x4, b: i32x4, op: i32, m: i8) -> i8;
+
+ #[link_name = "llvm.x86.avx512.mask.prol.d.512"]
+ fn vprold(a: i32x16, i8: i32) -> i32x16;
+ #[link_name = "llvm.x86.avx512.mask.prol.d.256"]
+ fn vprold256(a: i32x8, i8: i32) -> i32x8;
+ #[link_name = "llvm.x86.avx512.mask.prol.d.128"]
+ fn vprold128(a: i32x4, i8: i32) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.pror.d.512"]
+ fn vprord(a: i32x16, i8: i32) -> i32x16;
+ #[link_name = "llvm.x86.avx512.mask.pror.d.256"]
+ fn vprord256(a: i32x8, i8: i32) -> i32x8;
+ #[link_name = "llvm.x86.avx512.mask.pror.d.128"]
+ fn vprord128(a: i32x4, i8: i32) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.prol.q.512"]
+ fn vprolq(a: i64x8, i8: i32) -> i64x8;
+ #[link_name = "llvm.x86.avx512.mask.prol.q.256"]
+ fn vprolq256(a: i64x4, i8: i32) -> i64x4;
+ #[link_name = "llvm.x86.avx512.mask.prol.q.128"]
+ fn vprolq128(a: i64x2, i8: i32) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.pror.q.512"]
+ fn vprorq(a: i64x8, i8: i32) -> i64x8;
+ #[link_name = "llvm.x86.avx512.mask.pror.q.256"]
+ fn vprorq256(a: i64x4, i8: i32) -> i64x4;
+ #[link_name = "llvm.x86.avx512.mask.pror.q.128"]
+ fn vprorq128(a: i64x2, i8: i32) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.prolv.d.512"]
+ fn vprolvd(a: i32x16, b: i32x16) -> i32x16;
+ #[link_name = "llvm.x86.avx512.mask.prolv.d.256"]
+ fn vprolvd256(a: i32x8, b: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx512.mask.prolv.d.128"]
+ fn vprolvd128(a: i32x4, b: i32x4) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.prorv.d.512"]
+ fn vprorvd(a: i32x16, b: i32x16) -> i32x16;
+ #[link_name = "llvm.x86.avx512.mask.prorv.d.256"]
+ fn vprorvd256(a: i32x8, b: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx512.mask.prorv.d.128"]
+ fn vprorvd128(a: i32x4, b: i32x4) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.prolv.q.512"]
+ fn vprolvq(a: i64x8, b: i64x8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.mask.prolv.q.256"]
+ fn vprolvq256(a: i64x4, b: i64x4) -> i64x4;
+ #[link_name = "llvm.x86.avx512.mask.prolv.q.128"]
+ fn vprolvq128(a: i64x2, b: i64x2) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.prorv.q.512"]
+ fn vprorvq(a: i64x8, b: i64x8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.mask.prorv.q.256"]
+ fn vprorvq256(a: i64x4, b: i64x4) -> i64x4;
+ #[link_name = "llvm.x86.avx512.mask.prorv.q.128"]
+ fn vprorvq128(a: i64x2, b: i64x2) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.psllv.d.512"]
+ fn vpsllvd(a: i32x16, b: i32x16) -> i32x16;
+ #[link_name = "llvm.x86.avx512.psrlv.d.512"]
+ fn vpsrlvd(a: i32x16, b: i32x16) -> i32x16;
+ #[link_name = "llvm.x86.avx512.psllv.q.512"]
+ fn vpsllvq(a: i64x8, b: i64x8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.psrlv.q.512"]
+ fn vpsrlvq(a: i64x8, b: i64x8) -> i64x8;
+
+ #[link_name = "llvm.x86.avx512.pslli.d.512"]
+ fn vpsllid(a: i32x16, imm8: u32) -> i32x16;
+
+ #[link_name = "llvm.x86.avx2.pslli.d"]
+ fn psllid256(a: i32x8, imm8: i32) -> i32x8;
+ #[link_name = "llvm.x86.sse2.pslli.d"]
+ fn psllid128(a: i32x4, imm8: i32) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.psrli.d.512"]
+ fn vpsrlid(a: i32x16, imm8: u32) -> i32x16;
+
+ #[link_name = "llvm.x86.avx2.psrli.d"]
+ fn psrlid256(a: i32x8, imm8: i32) -> i32x8;
+ #[link_name = "llvm.x86.sse2.psrli.d"]
+ fn psrlid128(a: i32x4, imm8: i32) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.pslli.q.512"]
+ fn vpslliq(a: i64x8, imm8: u32) -> i64x8;
+
+ #[link_name = "llvm.x86.avx2.pslli.q"]
+ fn pslliq256(a: i64x4, imm8: i32) -> i64x4;
+ #[link_name = "llvm.x86.sse2.pslli.q"]
+ fn pslliq128(a: i64x2, imm8: i32) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.psrli.q.512"]
+ fn vpsrliq(a: i64x8, imm8: u32) -> i64x8;
+
+ #[link_name = "llvm.x86.avx2.psrli.q"]
+ fn psrliq256(a: i64x4, imm8: i32) -> i64x4;
+ #[link_name = "llvm.x86.sse2.psrli.q"]
+ fn psrliq128(a: i64x2, imm8: i32) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.psll.d.512"]
+ fn vpslld(a: i32x16, count: i32x4) -> i32x16;
+ #[link_name = "llvm.x86.avx512.psrl.d.512"]
+ fn vpsrld(a: i32x16, count: i32x4) -> i32x16;
+ #[link_name = "llvm.x86.avx512.psll.q.512"]
+ fn vpsllq(a: i64x8, count: i64x2) -> i64x8;
+ #[link_name = "llvm.x86.avx512.psrl.q.512"]
+ fn vpsrlq(a: i64x8, count: i64x2) -> i64x8;
+
+ #[link_name = "llvm.x86.avx512.psra.d.512"]
+ fn vpsrad(a: i32x16, count: i32x4) -> i32x16;
+
+ #[link_name = "llvm.x86.avx512.psra.q.512"]
+ fn vpsraq(a: i64x8, count: i64x2) -> i64x8;
+ #[link_name = "llvm.x86.avx512.psra.q.256"]
+ fn vpsraq256(a: i64x4, count: i64x2) -> i64x4;
+ #[link_name = "llvm.x86.avx512.psra.q.128"]
+ fn vpsraq128(a: i64x2, count: i64x2) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.psrai.d.512"]
+ fn vpsraid512(a: i32x16, imm8: u32) -> i32x16;
+ #[link_name = "llvm.x86.avx2.psrai.d"]
+ fn psraid256(a: i32x8, imm8: i32) -> i32x8;
+ #[link_name = "llvm.x86.sse2.psrai.d"]
+ fn psraid128(a: i32x4, imm8: i32) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.psrai.q.512"]
+ fn vpsraiq(a: i64x8, imm8: u32) -> i64x8;
+ #[link_name = "llvm.x86.avx512.psrai.q.256"]
+ fn vpsraiq256(a: i64x4, imm8: u32) -> i64x4;
+ #[link_name = "llvm.x86.avx512.psrai.q.128"]
+ fn vpsraiq128(a: i64x2, imm8: u32) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.psrav.d.512"]
+ fn vpsravd(a: i32x16, count: i32x16) -> i32x16;
+
+ #[link_name = "llvm.x86.avx512.psrav.q.512"]
+ fn vpsravq(a: i64x8, count: i64x8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.psrav.q.256"]
+ fn vpsravq256(a: i64x4, count: i64x4) -> i64x4;
+ #[link_name = "llvm.x86.avx512.psrav.q.128"]
+ fn vpsravq128(a: i64x2, count: i64x2) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.vpermilvar.ps.512"]
+ fn vpermilps(a: f32x16, b: i32x16) -> f32x16;
+ #[link_name = "llvm.x86.avx512.vpermilvar.pd.512"]
+ fn vpermilpd(a: f64x8, b: i64x8) -> f64x8;
+
+ #[link_name = "llvm.x86.avx512.permvar.si.512"]
+ fn vpermd(a: i32x16, idx: i32x16) -> i32x16;
+
+ #[link_name = "llvm.x86.avx512.permvar.di.512"]
+ fn vpermq(a: i64x8, idx: i64x8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.permvar.di.256"]
+ fn vpermq256(a: i64x4, idx: i64x4) -> i64x4;
+
+ #[link_name = "llvm.x86.avx512.permvar.sf.512"]
+ fn vpermps(a: f32x16, idx: i32x16) -> f32x16;
+
+ #[link_name = "llvm.x86.avx512.permvar.df.512"]
+ fn vpermpd(a: f64x8, idx: i64x8) -> f64x8;
+ #[link_name = "llvm.x86.avx512.permvar.df.256"]
+ fn vpermpd256(a: f64x4, idx: i64x4) -> f64x4;
+
+ #[link_name = "llvm.x86.avx512.vpermi2var.d.512"]
+ fn vpermi2d(a: i32x16, idx: i32x16, b: i32x16) -> i32x16;
+ #[link_name = "llvm.x86.avx512.vpermi2var.d.256"]
+ fn vpermi2d256(a: i32x8, idx: i32x8, b: i32x8) -> i32x8;
+ #[link_name = "llvm.x86.avx512.vpermi2var.d.128"]
+ fn vpermi2d128(a: i32x4, idx: i32x4, b: i32x4) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.vpermi2var.q.512"]
+ fn vpermi2q(a: i64x8, idx: i64x8, b: i64x8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.vpermi2var.q.256"]
+ fn vpermi2q256(a: i64x4, idx: i64x4, b: i64x4) -> i64x4;
+ #[link_name = "llvm.x86.avx512.vpermi2var.q.128"]
+ fn vpermi2q128(a: i64x2, idx: i64x2, b: i64x2) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.vpermi2var.ps.512"]
+ fn vpermi2ps(a: f32x16, idx: i32x16, b: f32x16) -> f32x16;
+ #[link_name = "llvm.x86.avx512.vpermi2var.ps.256"]
+ fn vpermi2ps256(a: f32x8, idx: i32x8, b: f32x8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.vpermi2var.ps.128"]
+ fn vpermi2ps128(a: f32x4, idx: i32x4, b: f32x4) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.vpermi2var.pd.512"]
+ fn vpermi2pd(a: f64x8, idx: i64x8, b: f64x8) -> f64x8;
+ #[link_name = "llvm.x86.avx512.vpermi2var.pd.256"]
+ fn vpermi2pd256(a: f64x4, idx: i64x4, b: f64x4) -> f64x4;
+ #[link_name = "llvm.x86.avx512.vpermi2var.pd.128"]
+ fn vpermi2pd128(a: f64x2, idx: i64x2, b: f64x2) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.compress.d.512"]
+ fn vpcompressd(a: i32x16, src: i32x16, mask: u16) -> i32x16;
+ #[link_name = "llvm.x86.avx512.mask.compress.d.256"]
+ fn vpcompressd256(a: i32x8, src: i32x8, mask: u8) -> i32x8;
+ #[link_name = "llvm.x86.avx512.mask.compress.d.128"]
+ fn vpcompressd128(a: i32x4, src: i32x4, mask: u8) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.compress.q.512"]
+ fn vpcompressq(a: i64x8, src: i64x8, mask: u8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.mask.compress.q.256"]
+ fn vpcompressq256(a: i64x4, src: i64x4, mask: u8) -> i64x4;
+ #[link_name = "llvm.x86.avx512.mask.compress.q.128"]
+ fn vpcompressq128(a: i64x2, src: i64x2, mask: u8) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.compress.ps.512"]
+ fn vcompressps(a: f32x16, src: f32x16, mask: u16) -> f32x16;
+ #[link_name = "llvm.x86.avx512.mask.compress.ps.256"]
+ fn vcompressps256(a: f32x8, src: f32x8, mask: u8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.mask.compress.ps.128"]
+ fn vcompressps128(a: f32x4, src: f32x4, mask: u8) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.compress.pd.512"]
+ fn vcompresspd(a: f64x8, src: f64x8, mask: u8) -> f64x8;
+ #[link_name = "llvm.x86.avx512.mask.compress.pd.256"]
+ fn vcompresspd256(a: f64x4, src: f64x4, mask: u8) -> f64x4;
+ #[link_name = "llvm.x86.avx512.mask.compress.pd.128"]
+ fn vcompresspd128(a: f64x2, src: f64x2, mask: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.compress.store.d.512"]
+ fn vcompressstored(mem: *mut i8, data: i32x16, mask: u16);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.d.256"]
+ fn vcompressstored256(mem: *mut i8, data: i32x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.d.128"]
+ fn vcompressstored128(mem: *mut i8, data: i32x4, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.compress.store.q.512"]
+ fn vcompressstoreq(mem: *mut i8, data: i64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.q.256"]
+ fn vcompressstoreq256(mem: *mut i8, data: i64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.q.128"]
+ fn vcompressstoreq128(mem: *mut i8, data: i64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.compress.store.ps.512"]
+ fn vcompressstoreps(mem: *mut i8, data: f32x16, mask: u16);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.ps.256"]
+ fn vcompressstoreps256(mem: *mut i8, data: f32x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.ps.128"]
+ fn vcompressstoreps128(mem: *mut i8, data: f32x4, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.compress.store.pd.512"]
+ fn vcompressstorepd(mem: *mut i8, data: f64x8, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.pd.256"]
+ fn vcompressstorepd256(mem: *mut i8, data: f64x4, mask: u8);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.pd.128"]
+ fn vcompressstorepd128(mem: *mut i8, data: f64x2, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.expand.d.512"]
+ fn vpexpandd(a: i32x16, src: i32x16, mask: u16) -> i32x16;
+ #[link_name = "llvm.x86.avx512.mask.expand.d.256"]
+ fn vpexpandd256(a: i32x8, src: i32x8, mask: u8) -> i32x8;
+ #[link_name = "llvm.x86.avx512.mask.expand.d.128"]
+ fn vpexpandd128(a: i32x4, src: i32x4, mask: u8) -> i32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.expand.q.512"]
+ fn vpexpandq(a: i64x8, src: i64x8, mask: u8) -> i64x8;
+ #[link_name = "llvm.x86.avx512.mask.expand.q.256"]
+ fn vpexpandq256(a: i64x4, src: i64x4, mask: u8) -> i64x4;
+ #[link_name = "llvm.x86.avx512.mask.expand.q.128"]
+ fn vpexpandq128(a: i64x2, src: i64x2, mask: u8) -> i64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.expand.ps.512"]
+ fn vexpandps(a: f32x16, src: f32x16, mask: u16) -> f32x16;
+ #[link_name = "llvm.x86.avx512.mask.expand.ps.256"]
+ fn vexpandps256(a: f32x8, src: f32x8, mask: u8) -> f32x8;
+ #[link_name = "llvm.x86.avx512.mask.expand.ps.128"]
+ fn vexpandps128(a: f32x4, src: f32x4, mask: u8) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.mask.expand.pd.512"]
+ fn vexpandpd(a: f64x8, src: f64x8, mask: u8) -> f64x8;
+ #[link_name = "llvm.x86.avx512.mask.expand.pd.256"]
+ fn vexpandpd256(a: f64x4, src: f64x4, mask: u8) -> f64x4;
+ #[link_name = "llvm.x86.avx512.mask.expand.pd.128"]
+ fn vexpandpd128(a: f64x2, src: f64x2, mask: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.add.ss.round"]
+ fn vaddss(a: f32x4, b: f32x4, src: f32x4, mask: u8, rounding: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.add.sd.round"]
+ fn vaddsd(a: f64x2, b: f64x2, src: f64x2, mask: u8, rounding: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.mask.sub.ss.round"]
+ fn vsubss(a: f32x4, b: f32x4, src: f32x4, mask: u8, rounding: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.sub.sd.round"]
+ fn vsubsd(a: f64x2, b: f64x2, src: f64x2, mask: u8, rounding: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.mask.mul.ss.round"]
+ fn vmulss(a: f32x4, b: f32x4, src: f32x4, mask: u8, rounding: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.mul.sd.round"]
+ fn vmulsd(a: f64x2, b: f64x2, src: f64x2, mask: u8, rounding: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.mask.div.ss.round"]
+ fn vdivss(a: f32x4, b: f32x4, src: f32x4, mask: u8, rounding: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.div.sd.round"]
+ fn vdivsd(a: f64x2, b: f64x2, src: f64x2, mask: u8, rounding: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.mask.max.ss.round"]
+ fn vmaxss(a: f32x4, b: f32x4, src: f32x4, mask: u8, sae: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.max.sd.round"]
+ fn vmaxsd(a: f64x2, b: f64x2, src: f64x2, mask: u8, sae: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.mask.min.ss.round"]
+ fn vminss(a: f32x4, b: f32x4, src: f32x4, mask: u8, sae: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.min.sd.round"]
+ fn vminsd(a: f64x2, b: f64x2, src: f64x2, mask: u8, sae: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.mask.sqrt.ss"]
+ fn vsqrtss(a: f32x4, b: f32x4, src: f32x4, mask: u8, rounding: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.sqrt.sd"]
+ fn vsqrtsd(a: f64x2, b: f64x2, src: f64x2, mask: u8, rounding: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.mask.getexp.ss"]
+ fn vgetexpss(a: f32x4, b: f32x4, src: f32x4, mask: u8, sae: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.getexp.sd"]
+ fn vgetexpsd(a: f64x2, b: f64x2, src: f64x2, mask: u8, sae: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.mask.getmant.ss"]
+ fn vgetmantss(a: f32x4, b: f32x4, mantissas: i32, src: f32x4, m: u8, sae: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.getmant.sd"]
+ fn vgetmantsd(a: f64x2, b: f64x2, mantissas: i32, src: f64x2, m: u8, sae: i32) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.rsqrt14.ss"]
+ fn vrsqrt14ss(a: f32x4, b: f32x4, src: f32x4, mask: u8) -> f32x4;
+ #[link_name = "llvm.x86.avx512.rsqrt14.sd"]
+ fn vrsqrt14sd(a: f64x2, b: f64x2, src: f64x2, mask: u8) -> f64x2;
+ #[link_name = "llvm.x86.avx512.rcp14.ss"]
+ fn vrcp14ss(a: f32x4, b: f32x4, src: f32x4, mask: u8) -> f32x4;
+ #[link_name = "llvm.x86.avx512.rcp14.sd"]
+ fn vrcp14sd(a: f64x2, b: f64x2, src: f64x2, mask: u8) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.rndscale.ss"]
+ fn vrndscaless(a: f32x4, b: f32x4, src: f32x4, mask: u8, imm8: i32, sae: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.rndscale.sd"]
+ fn vrndscalesd(a: f64x2, b: f64x2, src: f64x2, mask: u8, imm8: i32, sae: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.mask.scalef.ss"]
+ fn vscalefss(a: f32x4, b: f32x4, src: f32x4, mask: u8, rounding: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.scalef.sd"]
+ fn vscalefsd(a: f64x2, b: f64x2, src: f64x2, mask: u8, rounding: i32) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.vfmadd.f32"]
+ fn vfmadd132ss(a: f32, b: f32, c: f32, rounding: i32) -> f32;
+ #[link_name = "llvm.x86.avx512.vfmadd.f64"]
+ fn vfmadd132sd(a: f64, b: f64, c: f64, rounding: i32) -> f64;
+
+ #[link_name = "llvm.x86.avx512.mask.fixupimm.ss"]
+ fn vfixupimmss(a: f32x4, b: f32x4, c: i32x4, imm8: i32, mask: u8, sae: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.mask.fixupimm.sd"]
+ fn vfixupimmsd(a: f64x2, b: f64x2, c: i64x2, imm8: i32, mask: u8, sae: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.maskz.fixupimm.ss"]
+ fn vfixupimmssz(a: f32x4, b: f32x4, c: i32x4, imm8: i32, mask: u8, sae: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.maskz.fixupimm.sd"]
+ fn vfixupimmsdz(a: f64x2, b: f64x2, c: i64x2, imm8: i32, mask: u8, sae: i32) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.mask.cvtss2sd.round"]
+ fn vcvtss2sd(a: f64x2, a: f32x4, src: f64x2, mask: u8, sae: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.mask.cvtsd2ss.round"]
+ fn vcvtsd2ss(a: f32x4, b: f64x2, src: f32x4, mask: u8, rounding: i32) -> f32x4;
+
+ #[link_name = "llvm.x86.avx512.vcvtss2si32"]
+ fn vcvtss2si(a: f32x4, rounding: i32) -> i32;
+ #[link_name = "llvm.x86.avx512.vcvtss2usi32"]
+ fn vcvtss2usi(a: f32x4, rounding: i32) -> u32;
+
+ #[link_name = "llvm.x86.avx512.vcvtsd2si32"]
+ fn vcvtsd2si(a: f64x2, rounding: i32) -> i32;
+ #[link_name = "llvm.x86.avx512.vcvtsd2usi32"]
+ fn vcvtsd2usi(a: f64x2, rounding: i32) -> u32;
+
+ #[link_name = "llvm.x86.avx512.cvtsi2ss32"]
+ fn vcvtsi2ss(a: f32x4, b: i32, rounding: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.cvtsi2sd64"]
+ fn vcvtsi2sd(a: f64x2, b: i64, rounding: i32) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.cvtusi2ss"]
+ fn vcvtusi2ss(a: f32x4, b: u32, rounding: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.cvtusi642sd"]
+ fn vcvtusi2sd(a: f64x2, b: u64, rounding: i32) -> f64x2;
+
+ #[link_name = "llvm.x86.avx512.vcomi.ss"]
+ fn vcomiss(a: f32x4, b: f32x4, imm8: i32, sae: i32) -> i32;
+ #[link_name = "llvm.x86.avx512.vcomi.sd"]
+ fn vcomisd(a: f64x2, b: f64x2, imm8: i32, sae: i32) -> i32;
+}
+
+#[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 = "avx512f")]
+ unsafe fn test_mm512_abs_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let r = _mm512_abs_epi32(a);
+ #[rustfmt::skip]
+ let e = _mm512_setr_epi32(
+ 0, 1, 1, i32::MAX,
+ i32::MAX.wrapping_add(1), 100, 100, 32,
+ 0, 1, 1, i32::MAX,
+ i32::MAX.wrapping_add(1), 100, 100, 32,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_abs_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let r = _mm512_mask_abs_epi32(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_abs_epi32(a, 0b00000000_11111111, a);
+ #[rustfmt::skip]
+ let e = _mm512_setr_epi32(
+ 0, 1, 1, i32::MAX,
+ i32::MAX.wrapping_add(1), 100, 100, 32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_abs_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let r = _mm512_maskz_abs_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_abs_epi32(0b00000000_11111111, a);
+ #[rustfmt::skip]
+ let e = _mm512_setr_epi32(
+ 0, 1, 1, i32::MAX,
+ i32::MAX.wrapping_add(1), 100, 100, 32,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_abs_epi32() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let r = _mm256_mask_abs_epi32(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_abs_epi32(a, 0b00001111, a);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi32(
+ 0, 1, 1, i32::MAX,
+ i32::MAX.wrapping_add(1), 100, -100, -32,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_abs_epi32() {
+ #[rustfmt::skip]
+ let a = _mm256_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let r = _mm256_maskz_abs_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_abs_epi32(0b00001111, a);
+ #[rustfmt::skip]
+ let e = _mm256_setr_epi32(
+ 0, 1, 1, i32::MAX,
+ 0, 0, 0, 0,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_abs_epi32() {
+ let a = _mm_setr_epi32(i32::MIN, 100, -100, -32);
+ let r = _mm_mask_abs_epi32(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_abs_epi32(a, 0b00001111, a);
+ let e = _mm_setr_epi32(i32::MAX.wrapping_add(1), 100, 100, 32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_abs_epi32() {
+ let a = _mm_setr_epi32(i32::MIN, 100, -100, -32);
+ let r = _mm_maskz_abs_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_abs_epi32(0b00001111, a);
+ let e = _mm_setr_epi32(i32::MAX.wrapping_add(1), 100, 100, 32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_abs_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let r = _mm512_abs_ps(a);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 1., 1., f32::MAX,
+ f32::MAX, 100., 100., 32.,
+ 0., 1., 1., f32::MAX,
+ f32::MAX, 100., 100., 32.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_abs_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let r = _mm512_mask_abs_ps(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_abs_ps(a, 0b00000000_11111111, a);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 1., 1., f32::MAX,
+ f32::MAX, 100., 100., 32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mov_epi32() {
+ let src = _mm512_set1_epi32(1);
+ let a = _mm512_set1_epi32(2);
+ let r = _mm512_mask_mov_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_mov_epi32(src, 0b11111111_11111111, a);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mov_epi32() {
+ let a = _mm512_set1_epi32(2);
+ let r = _mm512_maskz_mov_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_mov_epi32(0b11111111_11111111, a);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_mov_epi32() {
+ let src = _mm256_set1_epi32(1);
+ let a = _mm256_set1_epi32(2);
+ let r = _mm256_mask_mov_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_mov_epi32(src, 0b11111111, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_mov_epi32() {
+ let a = _mm256_set1_epi32(2);
+ let r = _mm256_maskz_mov_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_mov_epi32(0b11111111, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_mov_epi32() {
+ let src = _mm_set1_epi32(1);
+ let a = _mm_set1_epi32(2);
+ let r = _mm_mask_mov_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_mov_epi32(src, 0b00001111, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_mov_epi32() {
+ let a = _mm_set1_epi32(2);
+ let r = _mm_maskz_mov_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_mov_epi32(0b00001111, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mov_ps() {
+ let src = _mm512_set1_ps(1.);
+ let a = _mm512_set1_ps(2.);
+ let r = _mm512_mask_mov_ps(src, 0, a);
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_mov_ps(src, 0b11111111_11111111, a);
+ assert_eq_m512(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mov_ps() {
+ let a = _mm512_set1_ps(2.);
+ let r = _mm512_maskz_mov_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_mov_ps(0b11111111_11111111, a);
+ assert_eq_m512(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_mov_ps() {
+ let src = _mm256_set1_ps(1.);
+ let a = _mm256_set1_ps(2.);
+ let r = _mm256_mask_mov_ps(src, 0, a);
+ assert_eq_m256(r, src);
+ let r = _mm256_mask_mov_ps(src, 0b11111111, a);
+ assert_eq_m256(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_mov_ps() {
+ let a = _mm256_set1_ps(2.);
+ let r = _mm256_maskz_mov_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_mov_ps(0b11111111, a);
+ assert_eq_m256(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_mov_ps() {
+ let src = _mm_set1_ps(1.);
+ let a = _mm_set1_ps(2.);
+ let r = _mm_mask_mov_ps(src, 0, a);
+ assert_eq_m128(r, src);
+ let r = _mm_mask_mov_ps(src, 0b00001111, a);
+ assert_eq_m128(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_mov_ps() {
+ let a = _mm_set1_ps(2.);
+ let r = _mm_maskz_mov_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_mov_ps(0b00001111, a);
+ assert_eq_m128(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_add_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_add_epi32(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_epi32(
+ 1, 2, 0, i32::MIN,
+ i32::MIN + 1, 101, -99, -31,
+ 1, 2, 0, i32::MIN,
+ i32::MIN + 1, 101, -99, -31,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_add_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_mask_add_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_add_epi32(a, 0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_epi32(
+ 1, 2, 0, i32::MIN,
+ i32::MIN + 1, 101, -99, -31,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_add_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_maskz_add_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_add_epi32(0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_epi32(
+ 1, 2, 0, i32::MIN,
+ i32::MIN + 1, 101, -99, -31,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_add_epi32() {
+ let a = _mm256_set_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_mask_add_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_add_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(1, 2, 0, i32::MIN, i32::MIN + 1, 101, -99, -31);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_add_epi32() {
+ let a = _mm256_setr_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_maskz_add_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_add_epi32(0b11111111, a, b);
+ let e = _mm256_setr_epi32(1, 2, 0, i32::MIN, i32::MIN + 1, 101, -99, -31);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_add_epi32() {
+ let a = _mm_set_epi32(1, -1, i32::MAX, i32::MIN);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_mask_add_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_add_epi32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(2, 0, i32::MIN, i32::MIN + 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_add_epi32() {
+ let a = _mm_setr_epi32(1, -1, i32::MAX, i32::MIN);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_maskz_add_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_add_epi32(0b00001111, a, b);
+ let e = _mm_setr_epi32(2, 0, i32::MIN, i32::MIN + 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_add_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let b = _mm512_set1_ps(1.);
+ let r = _mm512_add_ps(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 1., 2., 0., f32::MAX,
+ f32::MIN + 1., 101., -99., -31.,
+ 1., 2., 0., f32::MAX,
+ f32::MIN + 1., 101., -99., -31.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_add_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let b = _mm512_set1_ps(1.);
+ let r = _mm512_mask_add_ps(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_add_ps(a, 0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 1., 2., 0., f32::MAX,
+ f32::MIN + 1., 101., -99., -31.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_add_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let b = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_add_ps(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_add_ps(0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 1., 2., 0., f32::MAX,
+ f32::MIN + 1., 101., -99., -31.,
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_add_ps() {
+ let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.);
+ let b = _mm256_set1_ps(1.);
+ let r = _mm256_mask_add_ps(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_add_ps(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(1., 2., 0., f32::MAX, f32::MIN + 1., 101., -99., -31.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_add_ps() {
+ let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.);
+ let b = _mm256_set1_ps(1.);
+ let r = _mm256_maskz_add_ps(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_add_ps(0b11111111, a, b);
+ let e = _mm256_set_ps(1., 2., 0., f32::MAX, f32::MIN + 1., 101., -99., -31.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_add_ps() {
+ let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN);
+ let b = _mm_set1_ps(1.);
+ let r = _mm_mask_add_ps(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_add_ps(a, 0b00001111, a, b);
+ let e = _mm_set_ps(2., 0., f32::MAX, f32::MIN + 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_add_ps() {
+ let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN);
+ let b = _mm_set1_ps(1.);
+ let r = _mm_maskz_add_ps(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_add_ps(0b00001111, a, b);
+ let e = _mm_set_ps(2., 0., f32::MAX, f32::MIN + 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sub_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_sub_epi32(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_epi32(
+ -1, 0, -2, i32::MAX - 1,
+ i32::MAX, 99, -101, -33,
+ -1, 0, -2, i32::MAX - 1,
+ i32::MAX, 99, -101, -33,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sub_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_mask_sub_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_sub_epi32(a, 0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_epi32(
+ -1, 0, -2, i32::MAX - 1,
+ i32::MAX, 99, -101, -33,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sub_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_maskz_sub_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_sub_epi32(0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_epi32(
+ -1, 0, -2, i32::MAX - 1,
+ i32::MAX, 99, -101, -33,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sub_epi32() {
+ let a = _mm256_set_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_mask_sub_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_sub_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(-1, 0, -2, i32::MAX - 1, i32::MAX, 99, -101, -33);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sub_epi32() {
+ let a = _mm256_set_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_maskz_sub_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_sub_epi32(0b11111111, a, b);
+ let e = _mm256_set_epi32(-1, 0, -2, i32::MAX - 1, i32::MAX, 99, -101, -33);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sub_epi32() {
+ let a = _mm_set_epi32(1, -1, i32::MAX, i32::MIN);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_mask_sub_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_sub_epi32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(0, -2, i32::MAX - 1, i32::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sub_epi32() {
+ let a = _mm_set_epi32(1, -1, i32::MAX, i32::MIN);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_maskz_sub_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_sub_epi32(0b00001111, a, b);
+ let e = _mm_set_epi32(0, -2, i32::MAX - 1, i32::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sub_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let b = _mm512_set1_ps(1.);
+ let r = _mm512_sub_ps(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -1., 0., -2., f32::MAX - 1.,
+ f32::MIN, 99., -101., -33.,
+ -1., 0., -2., f32::MAX - 1.,
+ f32::MIN, 99., -101., -33.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sub_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let b = _mm512_set1_ps(1.);
+ let r = _mm512_mask_sub_ps(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_sub_ps(a, 0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -1., 0., -2., f32::MAX - 1.,
+ f32::MIN, 99., -101., -33.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sub_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let b = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_sub_ps(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_sub_ps(0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -1., 0., -2., f32::MAX - 1.,
+ f32::MIN, 99., -101., -33.,
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sub_ps() {
+ let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.);
+ let b = _mm256_set1_ps(1.);
+ let r = _mm256_mask_sub_ps(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_sub_ps(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(-1., 0., -2., f32::MAX - 1., f32::MIN, 99., -101., -33.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sub_ps() {
+ let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.);
+ let b = _mm256_set1_ps(1.);
+ let r = _mm256_maskz_sub_ps(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_sub_ps(0b11111111, a, b);
+ let e = _mm256_set_ps(-1., 0., -2., f32::MAX - 1., f32::MIN, 99., -101., -33.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sub_ps() {
+ let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN);
+ let b = _mm_set1_ps(1.);
+ let r = _mm_mask_sub_ps(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_sub_ps(a, 0b00001111, a, b);
+ let e = _mm_set_ps(0., -2., f32::MAX - 1., f32::MIN);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sub_ps() {
+ let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN);
+ let b = _mm_set1_ps(1.);
+ let r = _mm_maskz_sub_ps(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_sub_ps(0b00001111, a, b);
+ let e = _mm_set_ps(0., -2., f32::MAX - 1., f32::MIN);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mullo_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let b = _mm512_set1_epi32(2);
+ let r = _mm512_mullo_epi32(a, b);
+ let e = _mm512_setr_epi32(
+ 0, 2, -2, -2, 0, 200, -200, -64, 0, 2, -2, -2, 0, 200, -200, -64,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mullo_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let b = _mm512_set1_epi32(2);
+ let r = _mm512_mask_mullo_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_mullo_epi32(a, 0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_epi32(
+ 0, 2, -2, -2,
+ 0, 200, -200, -64,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mullo_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_epi32(
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ 0, 1, -1, i32::MAX,
+ i32::MIN, 100, -100, -32,
+ );
+ let b = _mm512_set1_epi32(2);
+ let r = _mm512_maskz_mullo_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_mullo_epi32(0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(0, 2, -2, -2, 0, 200, -200, -64, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_mullo_epi32() {
+ let a = _mm256_set_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32);
+ let b = _mm256_set1_epi32(2);
+ let r = _mm256_mask_mullo_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_mullo_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(0, 2, -2, -2, 0, 200, -200, -64);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_mullo_epi32() {
+ let a = _mm256_set_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32);
+ let b = _mm256_set1_epi32(2);
+ let r = _mm256_maskz_mullo_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_mullo_epi32(0b11111111, a, b);
+ let e = _mm256_set_epi32(0, 2, -2, -2, 0, 200, -200, -64);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_mullo_epi32() {
+ let a = _mm_set_epi32(1, -1, i32::MAX, i32::MIN);
+ let b = _mm_set1_epi32(2);
+ let r = _mm_mask_mullo_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_mullo_epi32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(2, -2, -2, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_mullo_epi32() {
+ let a = _mm_set_epi32(1, -1, i32::MAX, i32::MIN);
+ let b = _mm_set1_epi32(2);
+ let r = _mm_maskz_mullo_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_mullo_epi32(0b00001111, a, b);
+ let e = _mm_set_epi32(2, -2, -2, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mul_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let b = _mm512_set1_ps(2.);
+ let r = _mm512_mul_ps(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 2., -2., f32::INFINITY,
+ f32::NEG_INFINITY, 200., -200., -64.,
+ 0., 2., -2., f32::INFINITY,
+ f32::NEG_INFINITY, 200., -200.,
+ -64.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mul_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let b = _mm512_set1_ps(2.);
+ let r = _mm512_mask_mul_ps(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_mul_ps(a, 0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 2., -2., f32::INFINITY,
+ f32::NEG_INFINITY, 200., -200., -64.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mul_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ 0., 1., -1., f32::MAX,
+ f32::MIN, 100., -100., -32.,
+ );
+ let b = _mm512_set1_ps(2.);
+ let r = _mm512_maskz_mul_ps(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_mul_ps(0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 2., -2., f32::INFINITY,
+ f32::NEG_INFINITY, 200., -200., -64.,
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_mul_ps() {
+ let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.);
+ let b = _mm256_set1_ps(2.);
+ let r = _mm256_mask_mul_ps(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_mul_ps(a, 0b11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm256_set_ps(
+ 0., 2., -2., f32::INFINITY,
+ f32::NEG_INFINITY, 200., -200., -64.,
+ );
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_mul_ps() {
+ let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.);
+ let b = _mm256_set1_ps(2.);
+ let r = _mm256_maskz_mul_ps(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_mul_ps(0b11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm256_set_ps(
+ 0., 2., -2., f32::INFINITY,
+ f32::NEG_INFINITY, 200., -200., -64.,
+ );
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_mul_ps() {
+ let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN);
+ let b = _mm_set1_ps(2.);
+ let r = _mm_mask_mul_ps(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_mul_ps(a, 0b00001111, a, b);
+ let e = _mm_set_ps(2., -2., f32::INFINITY, f32::NEG_INFINITY);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_mul_ps() {
+ let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN);
+ let b = _mm_set1_ps(2.);
+ let r = _mm_maskz_mul_ps(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_mul_ps(0b00001111, a, b);
+ let e = _mm_set_ps(2., -2., f32::INFINITY, f32::NEG_INFINITY);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_div_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., -1., -2., 100., 100., -100., -32., 0., 1., -1., 1000., -131., 100., -100., -32.,
+ );
+ let b = _mm512_setr_ps(
+ 2., 2., 2., 2., 2., 0., 2., 2., 2., 2., 2., 2., 0., 2., 2., 2.,
+ );
+ let r = _mm512_div_ps(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 0.5, -0.5, -1.,
+ 50., f32::INFINITY, -50., -16.,
+ 0., 0.5, -0.5, 500.,
+ f32::NEG_INFINITY, 50., -50., -16.,
+ );
+ assert_eq_m512(r, e); // 0/0 = NAN
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_div_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., -1., -2., 100., 100., -100., -32., 0., 1., -1., 1000., -131., 100., -100., -32.,
+ );
+ let b = _mm512_setr_ps(
+ 2., 2., 2., 2., 2., 0., 2., 2., 2., 2., 2., 2., 0., 2., 2., 2.,
+ );
+ let r = _mm512_mask_div_ps(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_div_ps(a, 0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 0.5, -0.5, -1.,
+ 50., f32::INFINITY, -50., -16.,
+ 0., 1., -1., 1000.,
+ -131., 100., -100., -32.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_div_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., -1., -2., 100., 100., -100., -32., 0., 1., -1., 1000., -131., 100., -100., -32.,
+ );
+ let b = _mm512_setr_ps(
+ 2., 2., 2., 2., 2., 0., 2., 2., 2., 2., 2., 2., 0., 2., 2., 2.,
+ );
+ let r = _mm512_maskz_div_ps(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_div_ps(0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 0.5, -0.5, -1.,
+ 50., f32::INFINITY, -50., -16.,
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_div_ps() {
+ let a = _mm256_set_ps(0., 1., -1., -2., 100., 100., -100., -32.);
+ let b = _mm256_set_ps(2., 2., 2., 2., 2., 0., 2., 2.);
+ let r = _mm256_mask_div_ps(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_div_ps(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(0., 0.5, -0.5, -1., 50., f32::INFINITY, -50., -16.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_div_ps() {
+ let a = _mm256_set_ps(0., 1., -1., -2., 100., 100., -100., -32.);
+ let b = _mm256_set_ps(2., 2., 2., 2., 2., 0., 2., 2.);
+ let r = _mm256_maskz_div_ps(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_div_ps(0b11111111, a, b);
+ let e = _mm256_set_ps(0., 0.5, -0.5, -1., 50., f32::INFINITY, -50., -16.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_div_ps() {
+ let a = _mm_set_ps(100., 100., -100., -32.);
+ let b = _mm_set_ps(2., 0., 2., 2.);
+ let r = _mm_mask_div_ps(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_div_ps(a, 0b00001111, a, b);
+ let e = _mm_set_ps(50., f32::INFINITY, -50., -16.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_div_ps() {
+ let a = _mm_set_ps(100., 100., -100., -32.);
+ let b = _mm_set_ps(2., 0., 2., 2.);
+ let r = _mm_maskz_div_ps(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_div_ps(0b00001111, a, b);
+ let e = _mm_set_ps(50., f32::INFINITY, -50., -16.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_max_epi32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_max_epi32(a, b);
+ let e = _mm512_setr_epi32(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_epi32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_mask_max_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_max_epi32(a, 0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(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_maskz_max_epi32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_maskz_max_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_max_epi32(0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_max_epi32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm256_mask_max_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_max_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(7, 6, 5, 4, 4, 5, 6, 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_max_epi32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm256_maskz_max_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_max_epi32(0b11111111, a, b);
+ let e = _mm256_set_epi32(7, 6, 5, 4, 4, 5, 6, 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_max_epi32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let b = _mm_set_epi32(3, 2, 1, 0);
+ let r = _mm_mask_max_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_max_epi32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(3, 2, 2, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_max_epi32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let b = _mm_set_epi32(3, 2, 1, 0);
+ let r = _mm_maskz_max_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_max_epi32(0b00001111, a, b);
+ let e = _mm_set_epi32(3, 2, 2, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_max_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_max_ps(a, b);
+ let e = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_max_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_mask_max_ps(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_max_ps(a, 0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_max_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_maskz_max_ps(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_max_ps(0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_max_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm256_set_ps(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm256_mask_max_ps(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_max_ps(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(7., 6., 5., 4., 4., 5., 6., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_max_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm256_set_ps(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm256_maskz_max_ps(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_max_ps(0b11111111, a, b);
+ let e = _mm256_set_ps(7., 6., 5., 4., 4., 5., 6., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_max_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(3., 2., 1., 0.);
+ let r = _mm_mask_max_ps(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_max_ps(a, 0b00001111, a, b);
+ let e = _mm_set_ps(3., 2., 2., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_max_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(3., 2., 1., 0.);
+ let r = _mm_maskz_max_ps(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_mask_max_ps(a, 0b00001111, a, b);
+ let e = _mm_set_ps(3., 2., 2., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_max_epu32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_max_epu32(a, b);
+ let e = _mm512_setr_epi32(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_epu32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_mask_max_epu32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_max_epu32(a, 0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(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_maskz_max_epu32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_maskz_max_epu32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_max_epu32(0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_max_epu32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm256_mask_max_epu32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_max_epu32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(7, 6, 5, 4, 4, 5, 6, 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_max_epu32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm256_maskz_max_epu32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_max_epu32(0b11111111, a, b);
+ let e = _mm256_set_epi32(7, 6, 5, 4, 4, 5, 6, 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_max_epu32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let b = _mm_set_epi32(3, 2, 1, 0);
+ let r = _mm_mask_max_epu32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_max_epu32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(3, 2, 2, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_max_epu32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let b = _mm_set_epi32(3, 2, 1, 0);
+ let r = _mm_maskz_max_epu32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_max_epu32(0b00001111, a, b);
+ let e = _mm_set_epi32(3, 2, 2, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_min_epi32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_min_epi32(a, b);
+ let e = _mm512_setr_epi32(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_epi32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_mask_min_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_min_epi32(a, 0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(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_min_epi32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_maskz_min_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_min_epi32(0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_min_epi32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm256_mask_min_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_min_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(0, 1, 2, 3, 3, 2, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_min_epi32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm256_maskz_min_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_min_epi32(0b11111111, a, b);
+ let e = _mm256_set_epi32(0, 1, 2, 3, 3, 2, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_min_epi32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let b = _mm_set_epi32(3, 2, 1, 0);
+ let r = _mm_mask_min_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_min_epi32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(0, 1, 1, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_min_epi32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let b = _mm_set_epi32(3, 2, 1, 0);
+ let r = _mm_maskz_min_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_min_epi32(0b00001111, a, b);
+ let e = _mm_set_epi32(0, 1, 1, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_min_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_min_ps(a, b);
+ let e = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_min_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_mask_min_ps(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_min_ps(a, 0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_min_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_maskz_min_ps(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_min_ps(0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_min_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm256_set_ps(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm256_mask_min_ps(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_min_ps(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(0., 1., 2., 3., 3., 2., 1., 0.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_min_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm256_set_ps(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm256_maskz_min_ps(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_min_ps(0b11111111, a, b);
+ let e = _mm256_set_ps(0., 1., 2., 3., 3., 2., 1., 0.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_min_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(3., 2., 1., 0.);
+ let r = _mm_mask_min_ps(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_min_ps(a, 0b00001111, a, b);
+ let e = _mm_set_ps(0., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_min_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(3., 2., 1., 0.);
+ let r = _mm_maskz_min_ps(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_min_ps(0b00001111, a, b);
+ let e = _mm_set_ps(0., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_min_epu32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_min_epu32(a, b);
+ let e = _mm512_setr_epi32(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_epu32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_mask_min_epu32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_min_epu32(a, 0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(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_min_epu32() {
+ let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_maskz_min_epu32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_min_epu32(0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_min_epu32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm256_mask_min_epu32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_min_epu32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(0, 1, 2, 3, 3, 2, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_min_epu32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm256_maskz_min_epu32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_min_epu32(0b11111111, a, b);
+ let e = _mm256_set_epi32(0, 1, 2, 3, 3, 2, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_min_epu32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let b = _mm_set_epi32(3, 2, 1, 0);
+ let r = _mm_mask_min_epu32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_min_epu32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(0, 1, 1, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_min_epu32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let b = _mm_set_epi32(3, 2, 1, 0);
+ let r = _mm_maskz_min_epu32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_min_epu32(0b00001111, a, b);
+ let e = _mm_set_epi32(0, 1, 1, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sqrt_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 4., 9., 16., 25., 36., 49., 64., 81., 100., 121., 144., 169., 196., 225.,
+ );
+ let r = _mm512_sqrt_ps(a);
+ let e = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sqrt_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 4., 9., 16., 25., 36., 49., 64., 81., 100., 121., 144., 169., 196., 225.,
+ );
+ let r = _mm512_mask_sqrt_ps(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_sqrt_ps(a, 0b00000000_11111111, a);
+ let e = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 64., 81., 100., 121., 144., 169., 196., 225.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sqrt_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 4., 9., 16., 25., 36., 49., 64., 81., 100., 121., 144., 169., 196., 225.,
+ );
+ let r = _mm512_maskz_sqrt_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_sqrt_ps(0b00000000_11111111, a);
+ let e = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sqrt_ps() {
+ let a = _mm256_set_ps(0., 1., 4., 9., 16., 25., 36., 49.);
+ let r = _mm256_mask_sqrt_ps(a, 0, a);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_sqrt_ps(a, 0b11111111, a);
+ let e = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sqrt_ps() {
+ let a = _mm256_set_ps(0., 1., 4., 9., 16., 25., 36., 49.);
+ let r = _mm256_maskz_sqrt_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_sqrt_ps(0b11111111, a);
+ let e = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sqrt_ps() {
+ let a = _mm_set_ps(0., 1., 4., 9.);
+ let r = _mm_mask_sqrt_ps(a, 0, a);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_sqrt_ps(a, 0b00001111, a);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sqrt_ps() {
+ let a = _mm_set_ps(0., 1., 4., 9.);
+ let r = _mm_maskz_sqrt_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_sqrt_ps(0b00001111, a);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_fmadd_ps(a, b, c);
+ let e = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_mask_fmadd_ps(a, 0, b, c);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fmadd_ps(a, 0b00000000_11111111, b, c);
+ let e = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_fmadd_ps(0, a, b, c);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fmadd_ps(0b00000000_11111111, a, b, c);
+ let e = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(2.);
+ let r = _mm512_mask3_fmadd_ps(a, b, c, 0);
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fmadd_ps(a, b, c, 0b00000000_11111111);
+ let e = _mm512_setr_ps(
+ 2., 3., 4., 5., 6., 7., 8., 9., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fmadd_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask_fmadd_ps(a, 0, b, c);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_fmadd_ps(a, 0b11111111, b, c);
+ let e = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fmadd_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_maskz_fmadd_ps(0, a, b, c);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_fmadd_ps(0b11111111, a, b, c);
+ let e = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fmadd_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask3_fmadd_ps(a, b, c, 0);
+ assert_eq_m256(r, c);
+ let r = _mm256_mask3_fmadd_ps(a, b, c, 0b11111111);
+ let e = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fmadd_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask_fmadd_ps(a, 0, b, c);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fmadd_ps(a, 0b00001111, b, c);
+ let e = _mm_set_ps(1., 2., 3., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fmadd_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_maskz_fmadd_ps(0, a, b, c);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_fmadd_ps(0b00001111, a, b, c);
+ let e = _mm_set_ps(1., 2., 3., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fmadd_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask3_fmadd_ps(a, b, c, 0);
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fmadd_ps(a, b, c, 0b00001111);
+ let e = _mm_set_ps(1., 2., 3., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmsub_ps() {
+ let a = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ let r = _mm512_fmsub_ps(a, b, c);
+ let e = _mm512_setr_ps(
+ -1., 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_mask_fmsub_ps(a, 0, b, c);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fmsub_ps(a, 0b00000000_11111111, b, c);
+ let e = _mm512_setr_ps(
+ -1., 0., 1., 2., 3., 4., 5., 6., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_fmsub_ps(0, a, b, c);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fmsub_ps(0b00000000_11111111, a, b, c);
+ let e = _mm512_setr_ps(
+ -1., 0., 1., 2., 3., 4., 5., 6., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ let r = _mm512_mask3_fmsub_ps(a, b, c, 0);
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fmsub_ps(a, b, c, 0b00000000_11111111);
+ let e = _mm512_setr_ps(
+ -1., 0., 1., 2., 3., 4., 5., 6., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fmsub_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask_fmsub_ps(a, 0, b, c);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_fmsub_ps(a, 0b11111111, b, c);
+ let e = _mm256_set_ps(-1., 0., 1., 2., 3., 4., 5., 6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fmsub_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_maskz_fmsub_ps(0, a, b, c);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_fmsub_ps(0b11111111, a, b, c);
+ let e = _mm256_set_ps(-1., 0., 1., 2., 3., 4., 5., 6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fmsub_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask3_fmsub_ps(a, b, c, 0);
+ assert_eq_m256(r, c);
+ let r = _mm256_mask3_fmsub_ps(a, b, c, 0b11111111);
+ let e = _mm256_set_ps(-1., 0., 1., 2., 3., 4., 5., 6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fmsub_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask_fmsub_ps(a, 0, b, c);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fmsub_ps(a, 0b00001111, b, c);
+ let e = _mm_set_ps(-1., 0., 1., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fmsub_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_maskz_fmsub_ps(0, a, b, c);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_fmsub_ps(0b00001111, a, b, c);
+ let e = _mm_set_ps(-1., 0., 1., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fmsub_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask3_fmsub_ps(a, b, c, 0);
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fmsub_ps(a, b, c, 0b00001111);
+ let e = _mm_set_ps(-1., 0., 1., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmaddsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_fmaddsub_ps(a, b, c);
+ let e = _mm512_setr_ps(
+ -1., 2., 1., 4., 3., 6., 5., 8., 7., 10., 9., 12., 11., 14., 13., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmaddsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_mask_fmaddsub_ps(a, 0, b, c);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fmaddsub_ps(a, 0b00000000_11111111, b, c);
+ let e = _mm512_setr_ps(
+ -1., 2., 1., 4., 3., 6., 5., 8., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmaddsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_fmaddsub_ps(0, a, b, c);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fmaddsub_ps(0b00000000_11111111, a, b, c);
+ let e = _mm512_setr_ps(
+ -1., 2., 1., 4., 3., 6., 5., 8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmaddsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ let r = _mm512_mask3_fmaddsub_ps(a, b, c, 0);
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fmaddsub_ps(a, b, c, 0b00000000_11111111);
+ let e = _mm512_setr_ps(
+ -1., 2., 1., 4., 3., 6., 5., 8., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fmaddsub_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask_fmaddsub_ps(a, 0, b, c);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_fmaddsub_ps(a, 0b11111111, b, c);
+ let e = _mm256_set_ps(1., 0., 3., 2., 5., 4., 7., 6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fmaddsub_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_maskz_fmaddsub_ps(0, a, b, c);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_fmaddsub_ps(0b11111111, a, b, c);
+ let e = _mm256_set_ps(1., 0., 3., 2., 5., 4., 7., 6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fmaddsub_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask3_fmaddsub_ps(a, b, c, 0);
+ assert_eq_m256(r, c);
+ let r = _mm256_mask3_fmaddsub_ps(a, b, c, 0b11111111);
+ let e = _mm256_set_ps(1., 0., 3., 2., 5., 4., 7., 6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fmaddsub_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask_fmaddsub_ps(a, 0, b, c);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fmaddsub_ps(a, 0b00001111, b, c);
+ let e = _mm_set_ps(1., 0., 3., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fmaddsub_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_maskz_fmaddsub_ps(0, a, b, c);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_fmaddsub_ps(0b00001111, a, b, c);
+ let e = _mm_set_ps(1., 0., 3., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fmaddsub_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask3_fmaddsub_ps(a, b, c, 0);
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fmaddsub_ps(a, b, c, 0b00001111);
+ let e = _mm_set_ps(1., 0., 3., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmsubadd_ps() {
+ let a = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ let r = _mm512_fmsubadd_ps(a, b, c);
+ let e = _mm512_setr_ps(
+ 1., 0., 3., 2., 5., 4., 7., 6., 9., 8., 11., 10., 13., 12., 15., 14.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmsubadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_mask_fmsubadd_ps(a, 0, b, c);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fmsubadd_ps(a, 0b00000000_11111111, b, c);
+ let e = _mm512_setr_ps(
+ 1., 0., 3., 2., 5., 4., 7., 6., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmsubadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_fmsubadd_ps(0, a, b, c);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fmsubadd_ps(0b00000000_11111111, a, b, c);
+ let e = _mm512_setr_ps(
+ 1., 0., 3., 2., 5., 4., 7., 6., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmsubadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ let r = _mm512_mask3_fmsubadd_ps(a, b, c, 0);
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fmsubadd_ps(a, b, c, 0b00000000_11111111);
+ let e = _mm512_setr_ps(
+ 1., 0., 3., 2., 5., 4., 7., 6., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fmsubadd_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask_fmsubadd_ps(a, 0, b, c);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_fmsubadd_ps(a, 0b11111111, b, c);
+ let e = _mm256_set_ps(-1., 2., 1., 4., 3., 6., 5., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fmsubadd_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_maskz_fmsubadd_ps(0, a, b, c);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_fmsubadd_ps(0b11111111, a, b, c);
+ let e = _mm256_set_ps(-1., 2., 1., 4., 3., 6., 5., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fmsubadd_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask3_fmsubadd_ps(a, b, c, 0);
+ assert_eq_m256(r, c);
+ let r = _mm256_mask3_fmsubadd_ps(a, b, c, 0b11111111);
+ let e = _mm256_set_ps(-1., 2., 1., 4., 3., 6., 5., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fmsubadd_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask_fmsubadd_ps(a, 0, b, c);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fmsubadd_ps(a, 0b00001111, b, c);
+ let e = _mm_set_ps(-1., 2., 1., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fmsubadd_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_maskz_fmsubadd_ps(0, a, b, c);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_fmsubadd_ps(0b00001111, a, b, c);
+ let e = _mm_set_ps(-1., 2., 1., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fmsubadd_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask3_fmsubadd_ps(a, b, c, 0);
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fmsubadd_ps(a, b, c, 0b00001111);
+ let e = _mm_set_ps(-1., 2., 1., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fnmadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_fnmadd_ps(a, b, c);
+ let e = _mm512_setr_ps(
+ 1., 0., -1., -2., -3., -4., -5., -6., -7., -8., -9., -10., -11., -12., -13., -14.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fnmadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_mask_fnmadd_ps(a, 0, b, c);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fnmadd_ps(a, 0b00000000_11111111, b, c);
+ let e = _mm512_setr_ps(
+ 1., 0., -1., -2., -3., -4., -5., -6., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fnmadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_fnmadd_ps(0, a, b, c);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fnmadd_ps(0b00000000_11111111, a, b, c);
+ let e = _mm512_setr_ps(
+ 1., 0., -1., -2., -3., -4., -5., -6., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fnmadd_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ let r = _mm512_mask3_fnmadd_ps(a, b, c, 0);
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fnmadd_ps(a, b, c, 0b00000000_11111111);
+ let e = _mm512_setr_ps(
+ 1., 0., -1., -2., -3., -4., -5., -6., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fnmadd_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask_fnmadd_ps(a, 0, b, c);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_fnmadd_ps(a, 0b11111111, b, c);
+ let e = _mm256_set_ps(1., 0., -1., -2., -3., -4., -5., -6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fnmadd_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_maskz_fnmadd_ps(0, a, b, c);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_fnmadd_ps(0b11111111, a, b, c);
+ let e = _mm256_set_ps(1., 0., -1., -2., -3., -4., -5., -6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fnmadd_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask3_fnmadd_ps(a, b, c, 0);
+ assert_eq_m256(r, c);
+ let r = _mm256_mask3_fnmadd_ps(a, b, c, 0b11111111);
+ let e = _mm256_set_ps(1., 0., -1., -2., -3., -4., -5., -6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fnmadd_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask_fnmadd_ps(a, 0, b, c);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fnmadd_ps(a, 0b00001111, b, c);
+ let e = _mm_set_ps(1., 0., -1., -2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fnmadd_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_maskz_fnmadd_ps(0, a, b, c);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_fnmadd_ps(0b00001111, a, b, c);
+ let e = _mm_set_ps(1., 0., -1., -2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fnmadd_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask3_fnmadd_ps(a, b, c, 0);
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fnmadd_ps(a, b, c, 0b00001111);
+ let e = _mm_set_ps(1., 0., -1., -2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fnmsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_fnmsub_ps(a, b, c);
+ let e = _mm512_setr_ps(
+ -1., -2., -3., -4., -5., -6., -7., -8., -9., -10., -11., -12., -13., -14., -15., -16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fnmsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_mask_fnmsub_ps(a, 0, b, c);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fnmsub_ps(a, 0b00000000_11111111, b, c);
+ let e = _mm512_setr_ps(
+ -1., -2., -3., -4., -5., -6., -7., -8., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fnmsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_fnmsub_ps(0, a, b, c);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fnmsub_ps(0b00000000_11111111, a, b, c);
+ let e = _mm512_setr_ps(
+ -1., -2., -3., -4., -5., -6., -7., -8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fnmsub_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let c = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ let r = _mm512_mask3_fnmsub_ps(a, b, c, 0);
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fnmsub_ps(a, b, c, 0b00000000_11111111);
+ let e = _mm512_setr_ps(
+ -1., -2., -3., -4., -5., -6., -7., -8., 2., 2., 2., 2., 2., 2., 2., 2.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fnmsub_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask_fnmsub_ps(a, 0, b, c);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_fnmsub_ps(a, 0b11111111, b, c);
+ let e = _mm256_set_ps(-1., -2., -3., -4., -5., -6., -7., -8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fnmsub_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_maskz_fnmsub_ps(0, a, b, c);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_fnmsub_ps(0b11111111, a, b, c);
+ let e = _mm256_set_ps(-1., -2., -3., -4., -5., -6., -7., -8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fnmsub_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm256_set1_ps(1.);
+ let r = _mm256_mask3_fnmsub_ps(a, b, c, 0);
+ assert_eq_m256(r, c);
+ let r = _mm256_mask3_fnmsub_ps(a, b, c, 0b11111111);
+ let e = _mm256_set_ps(-1., -2., -3., -4., -5., -6., -7., -8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fnmsub_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask_fnmsub_ps(a, 0, b, c);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fnmsub_ps(a, 0b00001111, b, c);
+ let e = _mm_set_ps(-1., -2., -3., -4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fnmsub_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_maskz_fnmsub_ps(0, a, b, c);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_fnmsub_ps(0b00001111, a, b, c);
+ let e = _mm_set_ps(-1., -2., -3., -4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fnmsub_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set_ps(0., 1., 2., 3.);
+ let c = _mm_set1_ps(1.);
+ let r = _mm_mask3_fnmsub_ps(a, b, c, 0);
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fnmsub_ps(a, b, c, 0b00001111);
+ let e = _mm_set_ps(-1., -2., -3., -4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_rcp14_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_rcp14_ps(a);
+ let e = _mm512_set1_ps(0.33333206);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_rcp14_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_mask_rcp14_ps(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_rcp14_ps(a, 0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 3., 3., 3., 3., 3., 3., 3., 3., 0.33333206, 0.33333206, 0.33333206, 0.33333206,
+ 0.33333206, 0.33333206, 0.33333206, 0.33333206,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_rcp14_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_maskz_rcp14_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_rcp14_ps(0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 0.33333206, 0.33333206, 0.33333206, 0.33333206,
+ 0.33333206, 0.33333206, 0.33333206, 0.33333206,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_rcp14_ps() {
+ let a = _mm256_set1_ps(3.);
+ let r = _mm256_rcp14_ps(a);
+ let e = _mm256_set1_ps(0.33333206);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_rcp14_ps() {
+ let a = _mm256_set1_ps(3.);
+ let r = _mm256_mask_rcp14_ps(a, 0, a);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_rcp14_ps(a, 0b11111111, a);
+ let e = _mm256_set1_ps(0.33333206);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_rcp14_ps() {
+ let a = _mm256_set1_ps(3.);
+ let r = _mm256_maskz_rcp14_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_rcp14_ps(0b11111111, a);
+ let e = _mm256_set1_ps(0.33333206);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_rcp14_ps() {
+ let a = _mm_set1_ps(3.);
+ let r = _mm_rcp14_ps(a);
+ let e = _mm_set1_ps(0.33333206);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_rcp14_ps() {
+ let a = _mm_set1_ps(3.);
+ let r = _mm_mask_rcp14_ps(a, 0, a);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_rcp14_ps(a, 0b00001111, a);
+ let e = _mm_set1_ps(0.33333206);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_rcp14_ps() {
+ let a = _mm_set1_ps(3.);
+ let r = _mm_maskz_rcp14_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_rcp14_ps(0b00001111, a);
+ let e = _mm_set1_ps(0.33333206);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_rsqrt14_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_rsqrt14_ps(a);
+ let e = _mm512_set1_ps(0.5773392);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_rsqrt14_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_mask_rsqrt14_ps(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_rsqrt14_ps(a, 0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 3., 3., 3., 3., 3., 3., 3., 3., 0.5773392, 0.5773392, 0.5773392, 0.5773392, 0.5773392,
+ 0.5773392, 0.5773392, 0.5773392,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_rsqrt14_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_maskz_rsqrt14_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_rsqrt14_ps(0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 0.5773392, 0.5773392, 0.5773392, 0.5773392, 0.5773392,
+ 0.5773392, 0.5773392, 0.5773392,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_rsqrt14_ps() {
+ let a = _mm256_set1_ps(3.);
+ let r = _mm256_mask_rsqrt14_ps(a, 0, a);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_rsqrt14_ps(a, 0b11111111, a);
+ let e = _mm256_set1_ps(0.5773392);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_rsqrt14_ps() {
+ let a = _mm256_set1_ps(3.);
+ let r = _mm256_maskz_rsqrt14_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_rsqrt14_ps(0b11111111, a);
+ let e = _mm256_set1_ps(0.5773392);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_rsqrt14_ps() {
+ let a = _mm_set1_ps(3.);
+ let r = _mm_mask_rsqrt14_ps(a, 0, a);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_rsqrt14_ps(a, 0b00001111, a);
+ let e = _mm_set1_ps(0.5773392);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_rsqrt14_ps() {
+ let a = _mm_set1_ps(3.);
+ let r = _mm_maskz_rsqrt14_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_rsqrt14_ps(0b00001111, a);
+ let e = _mm_set1_ps(0.5773392);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_getexp_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_getexp_ps(a);
+ let e = _mm512_set1_ps(1.);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_getexp_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_mask_getexp_ps(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_getexp_ps(a, 0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 3., 3., 3., 3., 3., 3., 3., 3., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_getexp_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_maskz_getexp_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_getexp_ps(0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_getexp_ps() {
+ let a = _mm256_set1_ps(3.);
+ let r = _mm256_getexp_ps(a);
+ let e = _mm256_set1_ps(1.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_getexp_ps() {
+ let a = _mm256_set1_ps(3.);
+ let r = _mm256_mask_getexp_ps(a, 0, a);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_getexp_ps(a, 0b11111111, a);
+ let e = _mm256_set1_ps(1.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_getexp_ps() {
+ let a = _mm256_set1_ps(3.);
+ let r = _mm256_maskz_getexp_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_getexp_ps(0b11111111, a);
+ let e = _mm256_set1_ps(1.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_getexp_ps() {
+ let a = _mm_set1_ps(3.);
+ let r = _mm_getexp_ps(a);
+ let e = _mm_set1_ps(1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_getexp_ps() {
+ let a = _mm_set1_ps(3.);
+ let r = _mm_mask_getexp_ps(a, 0, a);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_getexp_ps(a, 0b00001111, a);
+ let e = _mm_set1_ps(1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_getexp_ps() {
+ let a = _mm_set1_ps(3.);
+ let r = _mm_maskz_getexp_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_getexp_ps(0b00001111, a);
+ let e = _mm_set1_ps(1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_roundscale_ps() {
+ let a = _mm512_set1_ps(1.1);
+ let r = _mm512_roundscale_ps::<0b00_00_00_00>(a);
+ let e = _mm512_set1_ps(1.0);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_roundscale_ps() {
+ let a = _mm512_set1_ps(1.1);
+ let r = _mm512_mask_roundscale_ps::<0b00_00_00_00>(a, 0, a);
+ let e = _mm512_set1_ps(1.1);
+ assert_eq_m512(r, e);
+ let r = _mm512_mask_roundscale_ps::<0b00_00_00_00>(a, 0b11111111_11111111, a);
+ let e = _mm512_set1_ps(1.0);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_roundscale_ps() {
+ let a = _mm512_set1_ps(1.1);
+ let r = _mm512_maskz_roundscale_ps::<0b00_00_00_00>(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_roundscale_ps::<0b00_00_00_00>(0b11111111_11111111, a);
+ let e = _mm512_set1_ps(1.0);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_roundscale_ps() {
+ let a = _mm256_set1_ps(1.1);
+ let r = _mm256_roundscale_ps::<0b00_00_00_00>(a);
+ let e = _mm256_set1_ps(1.0);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_roundscale_ps() {
+ let a = _mm256_set1_ps(1.1);
+ let r = _mm256_mask_roundscale_ps::<0b00_00_00_00>(a, 0, a);
+ let e = _mm256_set1_ps(1.1);
+ assert_eq_m256(r, e);
+ let r = _mm256_mask_roundscale_ps::<0b00_00_00_00>(a, 0b11111111, a);
+ let e = _mm256_set1_ps(1.0);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_roundscale_ps() {
+ let a = _mm256_set1_ps(1.1);
+ let r = _mm256_maskz_roundscale_ps::<0b00_00_00_00>(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_roundscale_ps::<0b00_00_00_00>(0b11111111, a);
+ let e = _mm256_set1_ps(1.0);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_roundscale_ps() {
+ let a = _mm_set1_ps(1.1);
+ let r = _mm_roundscale_ps::<0b00_00_00_00>(a);
+ let e = _mm_set1_ps(1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_roundscale_ps() {
+ let a = _mm_set1_ps(1.1);
+ let r = _mm_mask_roundscale_ps::<0b00_00_00_00>(a, 0, a);
+ let e = _mm_set1_ps(1.1);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_roundscale_ps::<0b00_00_00_00>(a, 0b00001111, a);
+ let e = _mm_set1_ps(1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_roundscale_ps() {
+ let a = _mm_set1_ps(1.1);
+ let r = _mm_maskz_roundscale_ps::<0b00_00_00_00>(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_roundscale_ps::<0b00_00_00_00>(0b00001111, a);
+ let e = _mm_set1_ps(1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_scalef_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_set1_ps(3.);
+ let r = _mm512_scalef_ps(a, b);
+ let e = _mm512_set1_ps(8.);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_scalef_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_set1_ps(3.);
+ let r = _mm512_mask_scalef_ps(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_scalef_ps(a, 0b11111111_00000000, a, b);
+ let e = _mm512_set_ps(
+ 8., 8., 8., 8., 8., 8., 8., 8., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_scalef_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_set1_ps(3.);
+ let r = _mm512_maskz_scalef_ps(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_scalef_ps(0b11111111_00000000, a, b);
+ let e = _mm512_set_ps(
+ 8., 8., 8., 8., 8., 8., 8., 8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_scalef_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set1_ps(3.);
+ let r = _mm256_scalef_ps(a, b);
+ let e = _mm256_set1_ps(8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_scalef_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set1_ps(3.);
+ let r = _mm256_mask_scalef_ps(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_scalef_ps(a, 0b11111111, a, b);
+ let e = _mm256_set1_ps(8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_scalef_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set1_ps(3.);
+ let r = _mm256_maskz_scalef_ps(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_scalef_ps(0b11111111, a, b);
+ let e = _mm256_set1_ps(8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_scalef_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_scalef_ps(a, b);
+ let e = _mm_set1_ps(8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_scalef_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_mask_scalef_ps(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_scalef_ps(a, 0b00001111, a, b);
+ let e = _mm_set1_ps(8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_scalef_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_maskz_scalef_ps(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_scalef_ps(0b00001111, a, b);
+ let e = _mm_set1_ps(8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fixupimm_ps() {
+ let a = _mm512_set1_ps(f32::NAN);
+ let b = _mm512_set1_ps(f32::MAX);
+ let c = _mm512_set1_epi32(i32::MAX);
+ //let r = _mm512_fixupimm_ps(a, b, c, 5);
+ let r = _mm512_fixupimm_ps::<5>(a, b, c);
+ let e = _mm512_set1_ps(0.0);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fixupimm_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN,
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN,
+ 1., 1., 1., 1.,
+ 1., 1., 1., 1.,
+ );
+ let b = _mm512_set1_ps(f32::MAX);
+ let c = _mm512_set1_epi32(i32::MAX);
+ let r = _mm512_mask_fixupimm_ps::<5>(a, 0b11111111_00000000, b, c);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fixupimm_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN,
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN,
+ 1., 1., 1., 1.,
+ 1., 1., 1., 1.,
+ );
+ let b = _mm512_set1_ps(f32::MAX);
+ let c = _mm512_set1_epi32(i32::MAX);
+ let r = _mm512_maskz_fixupimm_ps::<5>(0b11111111_00000000, a, b, c);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_fixupimm_ps() {
+ let a = _mm256_set1_ps(f32::NAN);
+ let b = _mm256_set1_ps(f32::MAX);
+ let c = _mm256_set1_epi32(i32::MAX);
+ let r = _mm256_fixupimm_ps::<5>(a, b, c);
+ let e = _mm256_set1_ps(0.0);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fixupimm_ps() {
+ let a = _mm256_set1_ps(f32::NAN);
+ let b = _mm256_set1_ps(f32::MAX);
+ let c = _mm256_set1_epi32(i32::MAX);
+ let r = _mm256_mask_fixupimm_ps::<5>(a, 0b11111111, b, c);
+ let e = _mm256_set1_ps(0.0);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fixupimm_ps() {
+ let a = _mm256_set1_ps(f32::NAN);
+ let b = _mm256_set1_ps(f32::MAX);
+ let c = _mm256_set1_epi32(i32::MAX);
+ let r = _mm256_maskz_fixupimm_ps::<5>(0b11111111, a, b, c);
+ let e = _mm256_set1_ps(0.0);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_fixupimm_ps() {
+ let a = _mm_set1_ps(f32::NAN);
+ let b = _mm_set1_ps(f32::MAX);
+ let c = _mm_set1_epi32(i32::MAX);
+ let r = _mm_fixupimm_ps::<5>(a, b, c);
+ let e = _mm_set1_ps(0.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fixupimm_ps() {
+ let a = _mm_set1_ps(f32::NAN);
+ let b = _mm_set1_ps(f32::MAX);
+ let c = _mm_set1_epi32(i32::MAX);
+ let r = _mm_mask_fixupimm_ps::<5>(a, 0b00001111, b, c);
+ let e = _mm_set1_ps(0.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fixupimm_ps() {
+ let a = _mm_set1_ps(f32::NAN);
+ let b = _mm_set1_ps(f32::MAX);
+ let c = _mm_set1_epi32(i32::MAX);
+ let r = _mm_maskz_fixupimm_ps::<5>(0b00001111, a, b, c);
+ let e = _mm_set1_ps(0.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_ternarylogic_epi32() {
+ let a = _mm512_set1_epi32(1 << 2);
+ let b = _mm512_set1_epi32(1 << 1);
+ let c = _mm512_set1_epi32(1 << 0);
+ let r = _mm512_ternarylogic_epi32::<8>(a, b, c);
+ let e = _mm512_set1_epi32(0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_ternarylogic_epi32() {
+ let src = _mm512_set1_epi32(1 << 2);
+ let a = _mm512_set1_epi32(1 << 1);
+ let b = _mm512_set1_epi32(1 << 0);
+ let r = _mm512_mask_ternarylogic_epi32::<8>(src, 0, a, b);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_ternarylogic_epi32::<8>(src, 0b11111111_11111111, a, b);
+ let e = _mm512_set1_epi32(0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_ternarylogic_epi32() {
+ let a = _mm512_set1_epi32(1 << 2);
+ let b = _mm512_set1_epi32(1 << 1);
+ let c = _mm512_set1_epi32(1 << 0);
+ let r = _mm512_maskz_ternarylogic_epi32::<9>(0, a, b, c);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_ternarylogic_epi32::<8>(0b11111111_11111111, a, b, c);
+ let e = _mm512_set1_epi32(0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_ternarylogic_epi32() {
+ let a = _mm256_set1_epi32(1 << 2);
+ let b = _mm256_set1_epi32(1 << 1);
+ let c = _mm256_set1_epi32(1 << 0);
+ let r = _mm256_ternarylogic_epi32::<8>(a, b, c);
+ let e = _mm256_set1_epi32(0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_ternarylogic_epi32() {
+ let src = _mm256_set1_epi32(1 << 2);
+ let a = _mm256_set1_epi32(1 << 1);
+ let b = _mm256_set1_epi32(1 << 0);
+ let r = _mm256_mask_ternarylogic_epi32::<8>(src, 0, a, b);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_ternarylogic_epi32::<8>(src, 0b11111111, a, b);
+ let e = _mm256_set1_epi32(0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_ternarylogic_epi32() {
+ let a = _mm256_set1_epi32(1 << 2);
+ let b = _mm256_set1_epi32(1 << 1);
+ let c = _mm256_set1_epi32(1 << 0);
+ let r = _mm256_maskz_ternarylogic_epi32::<9>(0, a, b, c);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_ternarylogic_epi32::<8>(0b11111111, a, b, c);
+ let e = _mm256_set1_epi32(0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_ternarylogic_epi32() {
+ let a = _mm_set1_epi32(1 << 2);
+ let b = _mm_set1_epi32(1 << 1);
+ let c = _mm_set1_epi32(1 << 0);
+ let r = _mm_ternarylogic_epi32::<8>(a, b, c);
+ let e = _mm_set1_epi32(0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_ternarylogic_epi32() {
+ let src = _mm_set1_epi32(1 << 2);
+ let a = _mm_set1_epi32(1 << 1);
+ let b = _mm_set1_epi32(1 << 0);
+ let r = _mm_mask_ternarylogic_epi32::<8>(src, 0, a, b);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_ternarylogic_epi32::<8>(src, 0b00001111, a, b);
+ let e = _mm_set1_epi32(0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_ternarylogic_epi32() {
+ let a = _mm_set1_epi32(1 << 2);
+ let b = _mm_set1_epi32(1 << 1);
+ let c = _mm_set1_epi32(1 << 0);
+ let r = _mm_maskz_ternarylogic_epi32::<9>(0, a, b, c);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_ternarylogic_epi32::<8>(0b00001111, a, b, c);
+ let e = _mm_set1_epi32(0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_getmant_ps() {
+ let a = _mm512_set1_ps(10.);
+ let r = _mm512_getmant_ps::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(a);
+ let e = _mm512_set1_ps(1.25);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_getmant_ps() {
+ let a = _mm512_set1_ps(10.);
+ let r = _mm512_mask_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(
+ a,
+ 0b11111111_00000000,
+ a,
+ );
+ let e = _mm512_setr_ps(
+ 10., 10., 10., 10., 10., 10., 10., 10., 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_getmant_ps() {
+ let a = _mm512_set1_ps(10.);
+ let r = _mm512_maskz_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r =
+ _mm512_maskz_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_getmant_ps() {
+ let a = _mm256_set1_ps(10.);
+ let r = _mm256_getmant_ps::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(a);
+ let e = _mm256_set1_ps(1.25);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_getmant_ps() {
+ let a = _mm256_set1_ps(10.);
+ let r = _mm256_mask_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0b11111111, a);
+ let e = _mm256_set1_ps(1.25);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_getmant_ps() {
+ let a = _mm256_set1_ps(10.);
+ let r = _mm256_maskz_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0b11111111, a);
+ let e = _mm256_set1_ps(1.25);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_getmant_ps() {
+ let a = _mm_set1_ps(10.);
+ let r = _mm_getmant_ps::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(a);
+ let e = _mm_set1_ps(1.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_getmant_ps() {
+ let a = _mm_set1_ps(10.);
+ let r = _mm_mask_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0b00001111, a);
+ let e = _mm_set1_ps(1.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_getmant_ps() {
+ let a = _mm_set1_ps(10.);
+ let r = _mm_maskz_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0b00001111, a);
+ let e = _mm_set1_ps(1.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_add_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007,
+ );
+ let b = _mm512_set1_ps(-1.);
+ let r = _mm512_add_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -1., 0.5, 1., 2.5,
+ 3., 4.5, 5., 6.5,
+ 7., 8.5, 9., 10.5,
+ 11., 12.5, 13., -0.99999994,
+ );
+ assert_eq_m512(r, e);
+ let r = _mm512_add_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_setr_ps(
+ -1., 0.5, 1., 2.5, 3., 4.5, 5., 6.5, 7., 8.5, 9., 10.5, 11., 12.5, 13., -0.9999999,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_add_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007,
+ );
+ let b = _mm512_set1_ps(-1.);
+ let r = _mm512_mask_add_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_add_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b11111111_00000000,
+ a,
+ b,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5,
+ 4., 5.5, 6., 7.5,
+ 7., 8.5, 9., 10.5,
+ 11., 12.5, 13., -0.99999994,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_add_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007,
+ );
+ let b = _mm512_set1_ps(-1.);
+ let r = _mm512_maskz_add_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_add_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111_00000000,
+ a,
+ b,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ 7., 8.5, 9., 10.5,
+ 11., 12.5, 13., -0.99999994,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sub_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007,
+ );
+ let b = _mm512_set1_ps(1.);
+ let r = _mm512_sub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -1., 0.5, 1., 2.5,
+ 3., 4.5, 5., 6.5,
+ 7., 8.5, 9., 10.5,
+ 11., 12.5, 13., -0.99999994,
+ );
+ assert_eq_m512(r, e);
+ let r = _mm512_sub_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_setr_ps(
+ -1., 0.5, 1., 2.5, 3., 4.5, 5., 6.5, 7., 8.5, 9., 10.5, 11., 12.5, 13., -0.9999999,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sub_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007,
+ );
+ let b = _mm512_set1_ps(1.);
+ let r = _mm512_mask_sub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_sub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b11111111_00000000,
+ a,
+ b,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5,
+ 4., 5.5, 6., 7.5,
+ 7., 8.5, 9., 10.5,
+ 11., 12.5, 13., -0.99999994,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sub_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007,
+ );
+ let b = _mm512_set1_ps(1.);
+ let r =
+ _mm512_maskz_sub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_sub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111_00000000,
+ a,
+ b,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ 7., 8.5, 9., 10.5,
+ 11., 12.5, 13., -0.99999994,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mul_round_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5,
+ 4., 5.5, 6., 7.5,
+ 8., 9.5, 10., 11.5,
+ 12., 13.5, 14., 0.00000000000000000000007,
+ );
+ let b = _mm512_set1_ps(0.1);
+ let r = _mm512_mul_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 0.15, 0.2, 0.35,
+ 0.4, 0.55, 0.6, 0.75,
+ 0.8, 0.95, 1.0, 1.15,
+ 1.2, 1.35, 1.4, 0.000000000000000000000007000001,
+ );
+ assert_eq_m512(r, e);
+ let r = _mm512_mul_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 0.14999999, 0.2, 0.35,
+ 0.4, 0.54999995, 0.59999996, 0.75,
+ 0.8, 0.95, 1.0, 1.15,
+ 1.1999999, 1.3499999, 1.4, 0.000000000000000000000007,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mul_round_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5,
+ 4., 5.5, 6., 7.5,
+ 8., 9.5, 10., 11.5,
+ 12., 13.5, 14., 0.00000000000000000000007,
+ );
+ let b = _mm512_set1_ps(0.1);
+ let r = _mm512_mask_mul_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_mul_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b11111111_00000000,
+ a,
+ b,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5,
+ 4., 5.5, 6., 7.5,
+ 0.8, 0.95, 1.0, 1.15,
+ 1.2, 1.35, 1.4, 0.000000000000000000000007000001,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mul_round_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_setr_ps(
+ 0., 1.5, 2., 3.5,
+ 4., 5.5, 6., 7.5,
+ 8., 9.5, 10., 11.5,
+ 12., 13.5, 14., 0.00000000000000000000007,
+ );
+ let b = _mm512_set1_ps(0.1);
+ let r =
+ _mm512_maskz_mul_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_mul_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111_00000000,
+ a,
+ b,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ 0.8, 0.95, 1.0, 1.15,
+ 1.2, 1.35, 1.4, 0.000000000000000000000007000001,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_div_round_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_set1_ps(3.);
+ let r = _mm512_div_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_set1_ps(0.33333334);
+ assert_eq_m512(r, e);
+ let r = _mm512_div_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_set1_ps(0.3333333);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_div_round_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_set1_ps(3.);
+ let r = _mm512_mask_div_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_div_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b11111111_00000000,
+ a,
+ b,
+ );
+ let e = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 0.33333334, 0.33333334, 0.33333334, 0.33333334,
+ 0.33333334, 0.33333334, 0.33333334, 0.33333334,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_div_round_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_set1_ps(3.);
+ let r =
+ _mm512_maskz_div_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_div_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111_00000000,
+ a,
+ b,
+ );
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 0.33333334, 0.33333334, 0.33333334, 0.33333334,
+ 0.33333334, 0.33333334, 0.33333334, 0.33333334,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sqrt_round_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_sqrt_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a);
+ let e = _mm512_set1_ps(1.7320508);
+ assert_eq_m512(r, e);
+ let r = _mm512_sqrt_round_ps::<{ _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC }>(a);
+ let e = _mm512_set1_ps(1.7320509);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sqrt_round_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r =
+ _mm512_mask_sqrt_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_sqrt_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b11111111_00000000,
+ a,
+ );
+ let e = _mm512_setr_ps(
+ 3., 3., 3., 3., 3., 3., 3., 3., 1.7320508, 1.7320508, 1.7320508, 1.7320508, 1.7320508,
+ 1.7320508, 1.7320508, 1.7320508,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sqrt_round_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r =
+ _mm512_maskz_sqrt_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_sqrt_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111_00000000,
+ a,
+ );
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 1.7320508, 1.7320508, 1.7320508, 1.7320508, 1.7320508,
+ 1.7320508, 1.7320508, 1.7320508,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_fmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_ps(-0.99999994);
+ assert_eq_m512(r, e);
+ let r = _mm512_fmadd_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_ps(-0.9999999);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_mask_fmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b00000000_11111111,
+ b,
+ c,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ 0.00000007, 0.00000007, 0.00000007, 0.00000007,
+ 0.00000007, 0.00000007, 0.00000007, 0.00000007,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_maskz_fmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512(r, _mm512_setzero_ps());
+ #[rustfmt::skip]
+ let r = _mm512_maskz_fmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00000000_11111111,
+ a,
+ b,
+ c,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_mask3_fmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ b,
+ c,
+ 0b00000000_11111111,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ -1., -1., -1., -1.,
+ -1., -1., -1., -1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_fmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_ps(-0.99999994);
+ assert_eq_m512(r, e);
+ let r = _mm512_fmsub_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_ps(-0.9999999);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_mask_fmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b00000000_11111111,
+ b,
+ c,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ 0.00000007, 0.00000007, 0.00000007, 0.00000007,
+ 0.00000007, 0.00000007, 0.00000007, 0.00000007,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_fmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00000000_11111111,
+ a,
+ b,
+ c,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_mask3_fmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ b,
+ c,
+ 0b00000000_11111111,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ -0.99999994, -0.99999994, -0.99999994, -0.99999994,
+ 1., 1., 1., 1.,
+ 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmaddsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r =
+ _mm512_fmaddsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 1.0000001, -0.99999994, 1.0000001, -0.99999994,
+ 1.0000001, -0.99999994, 1.0000001, -0.99999994,
+ 1.0000001, -0.99999994, 1.0000001, -0.99999994,
+ 1.0000001, -0.99999994, 1.0000001, -0.99999994,
+ );
+ assert_eq_m512(r, e);
+ let r = _mm512_fmaddsub_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_setr_ps(
+ 1., -0.9999999, 1., -0.9999999, 1., -0.9999999, 1., -0.9999999, 1., -0.9999999, 1.,
+ -0.9999999, 1., -0.9999999, 1., -0.9999999,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmaddsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_mask_fmaddsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fmaddsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b00000000_11111111,
+ b,
+ c,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 1.0000001, -0.99999994, 1.0000001, -0.99999994,
+ 1.0000001, -0.99999994, 1.0000001, -0.99999994,
+ 0.00000007, 0.00000007, 0.00000007, 0.00000007,
+ 0.00000007, 0.00000007, 0.00000007, 0.00000007,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmaddsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_maskz_fmaddsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fmaddsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00000000_11111111,
+ a,
+ b,
+ c,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 1.0000001, -0.99999994, 1.0000001, -0.99999994,
+ 1.0000001, -0.99999994, 1.0000001, -0.99999994,
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmaddsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_mask3_fmaddsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fmaddsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ b,
+ c,
+ 0b00000000_11111111,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 1.0000001, -0.99999994, 1.0000001, -0.99999994,
+ 1.0000001, -0.99999994, 1.0000001, -0.99999994,
+ -1., -1., -1., -1.,
+ -1., -1., -1., -1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmsubadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r =
+ _mm512_fmsubadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -0.99999994, 1.0000001, -0.99999994, 1.0000001,
+ -0.99999994, 1.0000001, -0.99999994, 1.0000001,
+ -0.99999994, 1.0000001, -0.99999994, 1.0000001,
+ -0.99999994, 1.0000001, -0.99999994, 1.0000001,
+ );
+ assert_eq_m512(r, e);
+ let r = _mm512_fmsubadd_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_setr_ps(
+ -0.9999999, 1., -0.9999999, 1., -0.9999999, 1., -0.9999999, 1., -0.9999999, 1.,
+ -0.9999999, 1., -0.9999999, 1., -0.9999999, 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmsubadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_mask_fmsubadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fmsubadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b00000000_11111111,
+ b,
+ c,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -0.99999994, 1.0000001, -0.99999994, 1.0000001,
+ -0.99999994, 1.0000001, -0.99999994, 1.0000001,
+ 0.00000007, 0.00000007, 0.00000007, 0.00000007,
+ 0.00000007, 0.00000007, 0.00000007, 0.00000007,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmsubadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_maskz_fmsubadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fmsubadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00000000_11111111,
+ a,
+ b,
+ c,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -0.99999994, 1.0000001, -0.99999994, 1.0000001,
+ -0.99999994, 1.0000001, -0.99999994, 1.0000001,
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmsubadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_mask3_fmsubadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fmsubadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ b,
+ c,
+ 0b00000000_11111111,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ -0.99999994, 1.0000001, -0.99999994, 1.0000001,
+ -0.99999994, 1.0000001, -0.99999994, 1.0000001,
+ -1., -1., -1., -1.,
+ -1., -1., -1., -1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fnmadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(1.);
+ let r =
+ _mm512_fnmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_ps(0.99999994);
+ assert_eq_m512(r, e);
+ let r = _mm512_fnmadd_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_ps(0.9999999);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fnmadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_mask_fnmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fnmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b00000000_11111111,
+ b,
+ c,
+ );
+ let e = _mm512_setr_ps(
+ 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994,
+ 0.99999994, 0.00000007, 0.00000007, 0.00000007, 0.00000007, 0.00000007, 0.00000007,
+ 0.00000007, 0.00000007,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fnmadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_fnmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fnmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00000000_11111111,
+ a,
+ b,
+ c,
+ );
+ let e = _mm512_setr_ps(
+ 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994,
+ 0.99999994, 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fnmadd_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(1.);
+ let r = _mm512_mask3_fnmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fnmadd_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ b,
+ c,
+ 0b00000000_11111111,
+ );
+ let e = _mm512_setr_ps(
+ 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994,
+ 0.99999994, 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fnmsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r =
+ _mm512_fnmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_ps(0.99999994);
+ assert_eq_m512(r, e);
+ let r = _mm512_fnmsub_round_ps::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_ps(0.9999999);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fnmsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_mask_fnmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_fnmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b00000000_11111111,
+ b,
+ c,
+ );
+ let e = _mm512_setr_ps(
+ 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994,
+ 0.99999994, 0.00000007, 0.00000007, 0.00000007, 0.00000007, 0.00000007, 0.00000007,
+ 0.00000007, 0.00000007,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fnmsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_maskz_fnmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_fnmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00000000_11111111,
+ a,
+ b,
+ c,
+ );
+ let e = _mm512_setr_ps(
+ 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994,
+ 0.99999994, 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fnmsub_round_ps() {
+ let a = _mm512_set1_ps(0.00000007);
+ let b = _mm512_set1_ps(1.);
+ let c = _mm512_set1_ps(-1.);
+ let r = _mm512_mask3_fnmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512(r, c);
+ let r = _mm512_mask3_fnmsub_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ b,
+ c,
+ 0b00000000_11111111,
+ );
+ let e = _mm512_setr_ps(
+ 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994, 0.99999994,
+ 0.99999994, -1., -1., -1., -1., -1., -1., -1., -1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_max_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_max_round_ps::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_max_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_mask_max_round_ps::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_max_round_ps::<_MM_FROUND_CUR_DIRECTION>(a, 0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_max_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_maskz_max_round_ps::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_max_round_ps::<_MM_FROUND_CUR_DIRECTION>(0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_min_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_min_round_ps::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_min_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_mask_min_round_ps::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_min_round_ps::<_MM_FROUND_CUR_DIRECTION>(a, 0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_min_round_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ );
+ let r = _mm512_maskz_min_round_ps::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_min_round_ps::<_MM_FROUND_CUR_DIRECTION>(0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_getexp_round_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_getexp_round_ps::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e = _mm512_set1_ps(1.);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_getexp_round_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_mask_getexp_round_ps::<_MM_FROUND_CUR_DIRECTION>(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_getexp_round_ps::<_MM_FROUND_CUR_DIRECTION>(a, 0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 3., 3., 3., 3., 3., 3., 3., 3., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_getexp_round_ps() {
+ let a = _mm512_set1_ps(3.);
+ let r = _mm512_maskz_getexp_round_ps::<_MM_FROUND_CUR_DIRECTION>(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_getexp_round_ps::<_MM_FROUND_CUR_DIRECTION>(0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_roundscale_round_ps() {
+ let a = _mm512_set1_ps(1.1);
+ let r = _mm512_roundscale_round_ps::<0, _MM_FROUND_CUR_DIRECTION>(a);
+ let e = _mm512_set1_ps(1.0);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_roundscale_round_ps() {
+ let a = _mm512_set1_ps(1.1);
+ let r = _mm512_mask_roundscale_round_ps::<0, _MM_FROUND_CUR_DIRECTION>(a, 0, a);
+ let e = _mm512_set1_ps(1.1);
+ assert_eq_m512(r, e);
+ let r = _mm512_mask_roundscale_round_ps::<0, _MM_FROUND_CUR_DIRECTION>(
+ a,
+ 0b11111111_11111111,
+ a,
+ );
+ let e = _mm512_set1_ps(1.0);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_roundscale_round_ps() {
+ let a = _mm512_set1_ps(1.1);
+ let r = _mm512_maskz_roundscale_round_ps::<0, _MM_FROUND_CUR_DIRECTION>(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r =
+ _mm512_maskz_roundscale_round_ps::<0, _MM_FROUND_CUR_DIRECTION>(0b11111111_11111111, a);
+ let e = _mm512_set1_ps(1.0);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_scalef_round_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_set1_ps(3.);
+ let r = _mm512_scalef_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_set1_ps(8.);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_scalef_round_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_set1_ps(3.);
+ let r = _mm512_mask_scalef_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_scalef_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a,
+ 0b11111111_00000000,
+ a,
+ b,
+ );
+ let e = _mm512_set_ps(
+ 8., 8., 8., 8., 8., 8., 8., 8., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_scalef_round_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_set1_ps(3.);
+ let r = _mm512_maskz_scalef_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b,
+ );
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_scalef_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111_00000000,
+ a,
+ b,
+ );
+ let e = _mm512_set_ps(
+ 8., 8., 8., 8., 8., 8., 8., 8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fixupimm_round_ps() {
+ let a = _mm512_set1_ps(f32::NAN);
+ let b = _mm512_set1_ps(f32::MAX);
+ let c = _mm512_set1_epi32(i32::MAX);
+ let r = _mm512_fixupimm_round_ps::<5, _MM_FROUND_CUR_DIRECTION>(a, b, c);
+ let e = _mm512_set1_ps(0.0);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fixupimm_round_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN,
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN,
+ 1., 1., 1., 1.,
+ 1., 1., 1., 1.,
+ );
+ let b = _mm512_set1_ps(f32::MAX);
+ let c = _mm512_set1_epi32(i32::MAX);
+ let r = _mm512_mask_fixupimm_round_ps::<5, _MM_FROUND_CUR_DIRECTION>(
+ a,
+ 0b11111111_00000000,
+ b,
+ c,
+ );
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fixupimm_round_ps() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN,
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN,
+ 1., 1., 1., 1.,
+ 1., 1., 1., 1.,
+ );
+ let b = _mm512_set1_ps(f32::MAX);
+ let c = _mm512_set1_epi32(i32::MAX);
+ let r = _mm512_maskz_fixupimm_round_ps::<5, _MM_FROUND_CUR_DIRECTION>(
+ 0b11111111_00000000,
+ a,
+ b,
+ c,
+ );
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_getmant_round_ps() {
+ let a = _mm512_set1_ps(10.);
+ let r = _mm512_getmant_round_ps::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(a);
+ let e = _mm512_set1_ps(1.25);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_getmant_round_ps() {
+ let a = _mm512_set1_ps(10.);
+ let r = _mm512_mask_getmant_round_ps::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_getmant_round_ps::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(a, 0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 10., 10., 10., 10., 10., 10., 10., 10., 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_getmant_round_ps() {
+ let a = _mm512_set1_ps(10.);
+ let r = _mm512_maskz_getmant_round_ps::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_getmant_round_ps::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(0b11111111_00000000, a);
+ let e = _mm512_setr_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_cvtps_epi32(a);
+ let e = _mm512_setr_epi32(0, -1, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let src = _mm512_set1_epi32(0);
+ let r = _mm512_mask_cvtps_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtps_epi32(src, 0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -4, 4, -6, 6, -8, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_maskz_cvtps_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtps_epi32(0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -4, 4, -6, 6, -8, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtps_epi32() {
+ let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm256_mask_cvtps_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtps_epi32(src, 0b11111111, a);
+ let e = _mm256_set_epi32(8, 10, 10, 12, 12, 14, 14, 16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtps_epi32() {
+ let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5);
+ let r = _mm256_maskz_cvtps_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtps_epi32(0b11111111, a);
+ let e = _mm256_set_epi32(8, 10, 10, 12, 12, 14, 14, 16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtps_epi32() {
+ let a = _mm_set_ps(12., 13.5, 14., 15.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvtps_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtps_epi32(src, 0b00001111, a);
+ let e = _mm_set_epi32(12, 14, 14, 16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtps_epi32() {
+ let a = _mm_set_ps(12., 13.5, 14., 15.5);
+ let r = _mm_maskz_cvtps_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtps_epi32(0b00001111, a);
+ let e = _mm_set_epi32(12, 14, 14, 16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_cvtps_epu32(a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 8, 10, 10, 12, 12, 14, 14, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let src = _mm512_set1_epi32(0);
+ let r = _mm512_mask_cvtps_epu32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtps_epu32(src, 0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_maskz_cvtps_epu32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtps_epu32(0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtps_epu32() {
+ let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5);
+ let r = _mm256_cvtps_epu32(a);
+ let e = _mm256_set_epi32(8, 10, 10, 12, 12, 14, 14, 16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtps_epu32() {
+ let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm256_mask_cvtps_epu32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtps_epu32(src, 0b11111111, a);
+ let e = _mm256_set_epi32(8, 10, 10, 12, 12, 14, 14, 16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtps_epu32() {
+ let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5);
+ let r = _mm256_maskz_cvtps_epu32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtps_epu32(0b11111111, a);
+ let e = _mm256_set_epi32(8, 10, 10, 12, 12, 14, 14, 16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtps_epu32() {
+ let a = _mm_set_ps(12., 13.5, 14., 15.5);
+ let r = _mm_cvtps_epu32(a);
+ let e = _mm_set_epi32(12, 14, 14, 16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtps_epu32() {
+ let a = _mm_set_ps(12., 13.5, 14., 15.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvtps_epu32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtps_epu32(src, 0b00001111, a);
+ let e = _mm_set_epi32(12, 14, 14, 16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtps_epu32() {
+ let a = _mm_set_ps(12., 13.5, 14., 15.5);
+ let r = _mm_maskz_cvtps_epu32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtps_epu32(0b00001111, a);
+ let e = _mm_set_epi32(12, 14, 14, 16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi8_epi32(a);
+ let e = _mm512_set_epi32(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_mask_cvtepi8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_epi32(-1);
+ let r = _mm512_mask_cvtepi8_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtepi8_epi32(src, 0b00000000_11111111, a);
+ let e = _mm512_set_epi32(-1, -1, -1, -1, -1, -1, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi8_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtepi8_epi32(0b00000000_11111111, a);
+ let e = _mm512_set_epi32(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_cvtepi8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm256_set1_epi32(-1);
+ let r = _mm256_mask_cvtepi8_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtepi8_epi32(src, 0b11111111, a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepi8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm256_maskz_cvtepi8_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtepi8_epi32(0b11111111, a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm_set1_epi32(-1);
+ let r = _mm_mask_cvtepi8_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepi8_epi32(src, 0b00001111, a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_maskz_cvtepi8_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepi8_epi32(0b00001111, a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepu8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepu8_epi32(a);
+ let e = _mm512_set_epi32(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_mask_cvtepu8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_epi32(-1);
+ let r = _mm512_mask_cvtepu8_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtepu8_epi32(src, 0b00000000_11111111, a);
+ let e = _mm512_set_epi32(-1, -1, -1, -1, -1, -1, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepu8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepu8_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtepu8_epi32(0b00000000_11111111, a);
+ let e = _mm512_set_epi32(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_cvtepu8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm256_set1_epi32(-1);
+ let r = _mm256_mask_cvtepu8_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtepu8_epi32(src, 0b11111111, a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepu8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm256_maskz_cvtepu8_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtepu8_epi32(0b11111111, a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepu8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm_set1_epi32(-1);
+ let r = _mm_mask_cvtepu8_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepu8_epi32(src, 0b00001111, a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepu8_epi32() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_maskz_cvtepu8_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepu8_epi32(0b00001111, a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi16_epi32() {
+ let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi16_epi32(a);
+ let e = _mm512_set_epi32(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_mask_cvtepi16_epi32() {
+ let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_epi32(-1);
+ let r = _mm512_mask_cvtepi16_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtepi16_epi32(src, 0b00000000_11111111, a);
+ let e = _mm512_set_epi32(-1, -1, -1, -1, -1, -1, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi16_epi32() {
+ let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi16_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtepi16_epi32(0b00000000_11111111, a);
+ let e = _mm512_set_epi32(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_cvtepi16_epi32() {
+ let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let src = _mm256_set1_epi32(-1);
+ let r = _mm256_mask_cvtepi16_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtepi16_epi32(src, 0b11111111, a);
+ let e = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepi16_epi32() {
+ let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_maskz_cvtepi16_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtepi16_epi32(0b11111111, a);
+ let e = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi16_epi32() {
+ let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let src = _mm_set1_epi32(-1);
+ let r = _mm_mask_cvtepi16_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepi16_epi32(src, 0b00001111, a);
+ let e = _mm_set_epi32(4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi16_epi32() {
+ let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm_maskz_cvtepi16_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepi16_epi32(0b00001111, a);
+ let e = _mm_set_epi32(4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepu16_epi32() {
+ let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepu16_epi32(a);
+ let e = _mm512_set_epi32(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_mask_cvtepu16_epi32() {
+ let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_epi32(-1);
+ let r = _mm512_mask_cvtepu16_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtepu16_epi32(src, 0b00000000_11111111, a);
+ let e = _mm512_set_epi32(-1, -1, -1, -1, -1, -1, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepu16_epi32() {
+ let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepu16_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtepu16_epi32(0b00000000_11111111, a);
+ let e = _mm512_set_epi32(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_cvtepu16_epi32() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm256_set1_epi32(-1);
+ let r = _mm256_mask_cvtepu16_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtepu16_epi32(src, 0b11111111, a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepu16_epi32() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm256_maskz_cvtepu16_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtepu16_epi32(0b11111111, a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepu16_epi32() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm_set1_epi32(-1);
+ let r = _mm_mask_cvtepu16_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepu16_epi32(src, 0b00001111, a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepu16_epi32() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_maskz_cvtepu16_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepu16_epi32(0b00001111, a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi32_ps() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi32_ps(a);
+ let e = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi32_ps() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_ps(-1.);
+ let r = _mm512_mask_cvtepi32_ps(src, 0, a);
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_cvtepi32_ps(src, 0b00000000_11111111, a);
+ let e = _mm512_set_ps(
+ -1., -1., -1., -1., -1., -1., -1., -1., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi32_ps() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi32_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_cvtepi32_ps(0b00000000_11111111, a);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi32_ps() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let src = _mm256_set1_ps(-1.);
+ let r = _mm256_mask_cvtepi32_ps(src, 0, a);
+ assert_eq_m256(r, src);
+ let r = _mm256_mask_cvtepi32_ps(src, 0b11111111, a);
+ let e = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepi32_ps() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_maskz_cvtepi32_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_cvtepi32_ps(0b11111111, a);
+ let e = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi32_ps() {
+ let a = _mm_set_epi32(1, 2, 3, 4);
+ let src = _mm_set1_ps(-1.);
+ let r = _mm_mask_cvtepi32_ps(src, 0, a);
+ assert_eq_m128(r, src);
+ let r = _mm_mask_cvtepi32_ps(src, 0b00001111, a);
+ let e = _mm_set_ps(1., 2., 3., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi32_ps() {
+ let a = _mm_set_epi32(1, 2, 3, 4);
+ let r = _mm_maskz_cvtepi32_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_cvtepi32_ps(0b00001111, a);
+ let e = _mm_set_ps(1., 2., 3., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepu32_ps() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepu32_ps(a);
+ let e = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepu32_ps() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_ps(-1.);
+ let r = _mm512_mask_cvtepu32_ps(src, 0, a);
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_cvtepu32_ps(src, 0b00000000_11111111, a);
+ let e = _mm512_set_ps(
+ -1., -1., -1., -1., -1., -1., -1., -1., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepu32_ps() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepu32_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_cvtepu32_ps(0b00000000_11111111, a);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi32_epi16() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi32_epi16(a);
+ 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")]
+ unsafe fn test_mm512_mask_cvtepi32_epi16() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm256_set1_epi16(-1);
+ let r = _mm512_mask_cvtepi32_epi16(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtepi32_epi16(src, 0b00000000_11111111, a);
+ let e = _mm256_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi32_epi16() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi32_epi16(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtepi32_epi16(0b00000000_11111111, a);
+ 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_mm256_cvtepi32_epi16() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_cvtepi32_epi16(a);
+ 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_mm256_mask_cvtepi32_epi16() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let src = _mm_set1_epi16(-1);
+ let r = _mm256_mask_cvtepi32_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtepi32_epi16(src, 0b11111111, a);
+ 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_mm256_maskz_cvtepi32_epi16() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_maskz_cvtepi32_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtepi32_epi16(0b11111111, a);
+ 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_cvtepi32_epi16() {
+ let a = _mm_set_epi32(4, 5, 6, 7);
+ let r = _mm_cvtepi32_epi16(a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi32_epi16() {
+ let a = _mm_set_epi32(4, 5, 6, 7);
+ let src = _mm_set1_epi16(0);
+ let r = _mm_mask_cvtepi32_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepi32_epi16(src, 0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi32_epi16() {
+ let a = _mm_set_epi32(4, 5, 6, 7);
+ let r = _mm_maskz_cvtepi32_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepi32_epi16(0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi32_epi8() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi32_epi8(a);
+ 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")]
+ unsafe fn test_mm512_mask_cvtepi32_epi8() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm_set1_epi8(-1);
+ let r = _mm512_mask_cvtepi32_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm512_mask_cvtepi32_epi8(src, 0b00000000_11111111, a);
+ let e = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi32_epi8() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi32_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm512_maskz_cvtepi32_epi8(0b00000000_11111111, a);
+ 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 = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtepi32_epi8() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_cvtepi32_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi32_epi8() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let src = _mm_set1_epi8(0);
+ let r = _mm256_mask_cvtepi32_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtepi32_epi8(src, 0b11111111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepi32_epi8() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_maskz_cvtepi32_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtepi32_epi8(0b11111111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtepi32_epi8() {
+ let a = _mm_set_epi32(4, 5, 6, 7);
+ let r = _mm_cvtepi32_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi32_epi8() {
+ let a = _mm_set_epi32(4, 5, 6, 7);
+ let src = _mm_set1_epi8(0);
+ let r = _mm_mask_cvtepi32_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepi32_epi8(src, 0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi32_epi8() {
+ let a = _mm_set_epi32(4, 5, 6, 7);
+ let r = _mm_maskz_cvtepi32_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepi32_epi8(0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtsepi32_epi16() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MAX,
+ );
+ let r = _mm512_cvtsepi32_epi16(a);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi16(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i16::MIN, i16::MAX,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtsepi32_epi16() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MAX,
+ );
+ let src = _mm256_set1_epi16(-1);
+ let r = _mm512_mask_cvtsepi32_epi16(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtsepi32_epi16(src, 0b00000000_11111111, a);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi16(
+ -1, -1, -1, -1,
+ -1, -1, -1, -1,
+ 8, 9, 10, 11,
+ 12, 13, i16::MIN, i16::MAX,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtsepi32_epi16() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MAX,
+ );
+ let r = _mm512_maskz_cvtsepi32_epi16(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtsepi32_epi16(0b00000000_11111111, a);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi16(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 8, 9, 10, 11,
+ 12, 13, i16::MIN, i16::MAX,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtsepi32_epi16() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_cvtsepi32_epi16(a);
+ 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_mm256_mask_cvtsepi32_epi16() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let src = _mm_set1_epi16(-1);
+ let r = _mm256_mask_cvtsepi32_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtsepi32_epi16(src, 0b11111111, a);
+ 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_mm256_maskz_cvtsepi32_epi16() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_maskz_cvtsepi32_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtsepi32_epi16(0b11111111, a);
+ 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_cvtsepi32_epi16() {
+ let a = _mm_set_epi32(4, 5, 6, 7);
+ let r = _mm_cvtsepi32_epi16(a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtsepi32_epi16() {
+ let a = _mm_set_epi32(4, 5, 6, 7);
+ let src = _mm_set1_epi16(0);
+ let r = _mm_mask_cvtsepi32_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtsepi32_epi16(src, 0b11111111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtsepi32_epi16() {
+ let a = _mm_set_epi32(4, 5, 6, 7);
+ let r = _mm_maskz_cvtsepi32_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtsepi32_epi16(0b11111111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtsepi32_epi8() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MAX,
+ );
+ let r = _mm512_cvtsepi32_epi8(a);
+ #[rustfmt::skip]
+ let e = _mm_set_epi8(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i8::MIN, i8::MAX,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtsepi32_epi8() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MAX,
+ );
+ let src = _mm_set1_epi8(-1);
+ let r = _mm512_mask_cvtsepi32_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm512_mask_cvtsepi32_epi8(src, 0b00000000_11111111, a);
+ #[rustfmt::skip]
+ let e = _mm_set_epi8(
+ -1, -1, -1, -1,
+ -1, -1, -1, -1,
+ 8, 9, 10, 11,
+ 12, 13, i8::MIN, i8::MAX,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtsepi32_epi8() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MAX,
+ );
+ let r = _mm512_maskz_cvtsepi32_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm512_maskz_cvtsepi32_epi8(0b00000000_11111111, a);
+ #[rustfmt::skip]
+ let e = _mm_set_epi8(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 8, 9, 10, 11,
+ 12, 13, i8::MIN, i8::MAX,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtsepi32_epi8() {
+ let a = _mm256_set_epi32(9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm256_cvtsepi32_epi8(a);
+ #[rustfmt::skip]
+ let e = _mm_set_epi8(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtsepi32_epi8() {
+ let a = _mm256_set_epi32(9, 10, 11, 12, 13, 14, 15, 16);
+ let src = _mm_set1_epi8(0);
+ let r = _mm256_mask_cvtsepi32_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtsepi32_epi8(src, 0b11111111, a);
+ #[rustfmt::skip]
+ let e = _mm_set_epi8(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtsepi32_epi8() {
+ let a = _mm256_set_epi32(9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm256_maskz_cvtsepi32_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtsepi32_epi8(0b11111111, a);
+ #[rustfmt::skip]
+ let e = _mm_set_epi8(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtsepi32_epi8() {
+ let a = _mm_set_epi32(13, 14, 15, 16);
+ let r = _mm_cvtsepi32_epi8(a);
+ #[rustfmt::skip]
+ let e = _mm_set_epi8(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 13, 14, 15, 16,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtsepi32_epi8() {
+ let a = _mm_set_epi32(13, 14, 15, 16);
+ let src = _mm_set1_epi8(0);
+ let r = _mm_mask_cvtsepi32_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtsepi32_epi8(src, 0b00001111, a);
+ #[rustfmt::skip]
+ let e = _mm_set_epi8(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 13, 14, 15, 16,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtsepi32_epi8() {
+ let a = _mm_set_epi32(13, 14, 15, 16);
+ let r = _mm_maskz_cvtsepi32_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtsepi32_epi8(0b00001111, a);
+ #[rustfmt::skip]
+ let e = _mm_set_epi8(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 13, 14, 15, 16,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtusepi32_epi16() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MIN,
+ );
+ let r = _mm512_cvtusepi32_epi16(a);
+ let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, -1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtusepi32_epi16() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MIN,
+ );
+ let src = _mm256_set1_epi16(-1);
+ let r = _mm512_mask_cvtusepi32_epi16(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtusepi32_epi16(src, 0b00000000_11111111, a);
+ let e = _mm256_set_epi16(-1, -1, -1, -1, -1, -1, -1, -1, 8, 9, 10, 11, 12, 13, -1, -1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtusepi32_epi16() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MIN,
+ );
+ let r = _mm512_maskz_cvtusepi32_epi16(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtusepi32_epi16(0b00000000_11111111, a);
+ let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, -1, -1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtusepi32_epi16() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_cvtusepi32_epi16(a);
+ let e = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtusepi32_epi16() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let src = _mm_set1_epi16(0);
+ let r = _mm256_mask_cvtusepi32_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtusepi32_epi16(src, 0b11111111, a);
+ let e = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtusepi32_epi16() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_maskz_cvtusepi32_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtusepi32_epi16(0b11111111, a);
+ let e = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtusepi32_epi16() {
+ let a = _mm_set_epi32(5, 6, 7, 8);
+ let r = _mm_cvtusepi32_epi16(a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 5, 6, 7, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtusepi32_epi16() {
+ let a = _mm_set_epi32(5, 6, 7, 8);
+ let src = _mm_set1_epi16(0);
+ let r = _mm_mask_cvtusepi32_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtusepi32_epi16(src, 0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 5, 6, 7, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtusepi32_epi16() {
+ let a = _mm_set_epi32(5, 6, 7, 8);
+ let r = _mm_maskz_cvtusepi32_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtusepi32_epi16(0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 5, 6, 7, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtusepi32_epi8() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MIN,
+ );
+ let r = _mm512_cvtusepi32_epi8(a);
+ let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, -1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtusepi32_epi8() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MIN,
+ );
+ let src = _mm_set1_epi8(-1);
+ let r = _mm512_mask_cvtusepi32_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm512_mask_cvtusepi32_epi8(src, 0b00000000_11111111, a);
+ let e = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 8, 9, 10, 11, 12, 13, -1, -1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtusepi32_epi8() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, i32::MIN, i32::MIN,
+ );
+ let r = _mm512_maskz_cvtusepi32_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm512_maskz_cvtusepi32_epi8(0b00000000_11111111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, -1, -1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtusepi32_epi8() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, i32::MAX);
+ let r = _mm256_cvtusepi32_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtusepi32_epi8() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, i32::MAX);
+ let src = _mm_set1_epi8(0);
+ let r = _mm256_mask_cvtusepi32_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtusepi32_epi8(src, 0b11111111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtusepi32_epi8() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, i32::MAX);
+ let r = _mm256_maskz_cvtusepi32_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtusepi32_epi8(0b11111111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtusepi32_epi8() {
+ let a = _mm_set_epi32(5, 6, 7, i32::MAX);
+ let r = _mm_cvtusepi32_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtusepi32_epi8() {
+ let a = _mm_set_epi32(5, 6, 7, i32::MAX);
+ let src = _mm_set1_epi8(0);
+ let r = _mm_mask_cvtusepi32_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtusepi32_epi8(src, 0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtusepi32_epi8() {
+ let a = _mm_set_epi32(5, 6, 7, i32::MAX);
+ let r = _mm_maskz_cvtusepi32_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtusepi32_epi8(0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvt_roundps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_cvt_roundps_epi32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a);
+ let e = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16);
+ assert_eq_m512i(r, e);
+ let r = _mm512_cvt_roundps_epi32::<{ _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC }>(a);
+ let e = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvt_roundps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let src = _mm512_set1_epi32(0);
+ let r = _mm512_mask_cvt_roundps_epi32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ src, 0, a,
+ );
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvt_roundps_epi32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ src,
+ 0b00000000_11111111,
+ a,
+ );
+ let e = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvt_roundps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_maskz_cvt_roundps_epi32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a,
+ );
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvt_roundps_epi32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00000000_11111111,
+ a,
+ );
+ let e = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvt_roundps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_cvt_roundps_epu32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 8, 10, 10, 12, 12, 14, 14, 16);
+ assert_eq_m512i(r, e);
+ let r = _mm512_cvt_roundps_epu32::<{ _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC }>(a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvt_roundps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let src = _mm512_set1_epi32(0);
+ let r = _mm512_mask_cvt_roundps_epu32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ src, 0, a,
+ );
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvt_roundps_epu32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ src,
+ 0b00000000_11111111,
+ a,
+ );
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvt_roundps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_maskz_cvt_roundps_epu32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a,
+ );
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvt_roundps_epu32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00000000_11111111,
+ a,
+ );
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvt_roundepi32_ps() {
+ let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16);
+ let r = _mm512_cvt_roundepi32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a);
+ let e = _mm512_setr_ps(
+ 0., -2., 2., -4., 4., -6., 6., -8., 8., 10., 10., 12., 12., 14., 14., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvt_roundepi32_ps() {
+ let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16);
+ let src = _mm512_set1_ps(0.);
+ let r = _mm512_mask_cvt_roundepi32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ src, 0, a,
+ );
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_cvt_roundepi32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ src,
+ 0b00000000_11111111,
+ a,
+ );
+ let e = _mm512_setr_ps(
+ 0., -2., 2., -4., 4., -6., 6., -8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvt_roundepi32_ps() {
+ let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16);
+ let r = _mm512_maskz_cvt_roundepi32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a,
+ );
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_cvt_roundepi32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00000000_11111111,
+ a,
+ );
+ let e = _mm512_setr_ps(
+ 0., -2., 2., -4., 4., -6., 6., -8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvt_roundepu32_ps() {
+ let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16);
+ let r = _mm512_cvt_roundepu32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a);
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 4294967300., 2., 4294967300.,
+ 4., 4294967300., 6., 4294967300.,
+ 8., 10., 10., 12.,
+ 12., 14., 14., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvt_roundepu32_ps() {
+ let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16);
+ let src = _mm512_set1_ps(0.);
+ let r = _mm512_mask_cvt_roundepu32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ src, 0, a,
+ );
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_cvt_roundepu32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ src,
+ 0b00000000_11111111,
+ a,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 4294967300., 2., 4294967300.,
+ 4., 4294967300., 6., 4294967300.,
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvt_roundepu32_ps() {
+ let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16);
+ let r = _mm512_maskz_cvt_roundepu32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a,
+ );
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_cvt_roundepu32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00000000_11111111,
+ a,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_setr_ps(
+ 0., 4294967300., 2., 4294967300.,
+ 4., 4294967300., 6., 4294967300.,
+ 0., 0., 0., 0.,
+ 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvt_roundps_ph() {
+ let a = _mm512_set1_ps(1.);
+ let r = _mm512_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(a);
+ let e = _mm256_setr_epi64x(
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvt_roundps_ph() {
+ let a = _mm512_set1_ps(1.);
+ let src = _mm256_set1_epi16(0);
+ let r = _mm512_mask_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(src, 0b00000000_11111111, a);
+ let e = _mm256_setr_epi64x(4323521613979991040, 4323521613979991040, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvt_roundps_ph() {
+ let a = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(0b00000000_11111111, a);
+ let e = _mm256_setr_epi64x(4323521613979991040, 4323521613979991040, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvt_roundps_ph() {
+ let a = _mm256_set1_ps(1.);
+ let src = _mm_set1_epi16(0);
+ let r = _mm256_mask_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(src, 0b11111111, a);
+ let e = _mm_setr_epi64x(4323521613979991040, 4323521613979991040);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvt_roundps_ph() {
+ let a = _mm256_set1_ps(1.);
+ let r = _mm256_maskz_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(0b11111111, a);
+ let e = _mm_setr_epi64x(4323521613979991040, 4323521613979991040);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvt_roundps_ph() {
+ let a = _mm_set1_ps(1.);
+ let src = _mm_set1_epi16(0);
+ let r = _mm_mask_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(src, 0b00001111, a);
+ let e = _mm_setr_epi64x(4323521613979991040, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvt_roundps_ph() {
+ let a = _mm_set1_ps(1.);
+ let r = _mm_maskz_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(0b00001111, a);
+ let e = _mm_setr_epi64x(4323521613979991040, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtps_ph() {
+ let a = _mm512_set1_ps(1.);
+ let r = _mm512_cvtps_ph::<_MM_FROUND_NO_EXC>(a);
+ let e = _mm256_setr_epi64x(
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtps_ph() {
+ let a = _mm512_set1_ps(1.);
+ let src = _mm256_set1_epi16(0);
+ let r = _mm512_mask_cvtps_ph::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtps_ph::<_MM_FROUND_NO_EXC>(src, 0b00000000_11111111, a);
+ let e = _mm256_setr_epi64x(4323521613979991040, 4323521613979991040, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtps_ph() {
+ let a = _mm512_set1_ps(1.);
+ let r = _mm512_maskz_cvtps_ph::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtps_ph::<_MM_FROUND_NO_EXC>(0b00000000_11111111, a);
+ let e = _mm256_setr_epi64x(4323521613979991040, 4323521613979991040, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtps_ph() {
+ let a = _mm256_set1_ps(1.);
+ let src = _mm_set1_epi16(0);
+ let r = _mm256_mask_cvtps_ph::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtps_ph::<_MM_FROUND_NO_EXC>(src, 0b11111111, a);
+ let e = _mm_setr_epi64x(4323521613979991040, 4323521613979991040);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtps_ph() {
+ let a = _mm256_set1_ps(1.);
+ let r = _mm256_maskz_cvtps_ph::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtps_ph::<_MM_FROUND_NO_EXC>(0b11111111, a);
+ let e = _mm_setr_epi64x(4323521613979991040, 4323521613979991040);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtps_ph() {
+ let a = _mm_set1_ps(1.);
+ let src = _mm_set1_epi16(0);
+ let r = _mm_mask_cvtps_ph::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtps_ph::<_MM_FROUND_NO_EXC>(src, 0b00001111, a);
+ let e = _mm_setr_epi64x(4323521613979991040, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtps_ph() {
+ let a = _mm_set1_ps(1.);
+ let r = _mm_maskz_cvtps_ph::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtps_ph::<_MM_FROUND_NO_EXC>(0b00001111, a);
+ let e = _mm_setr_epi64x(4323521613979991040, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvt_roundph_ps() {
+ let a = _mm256_setr_epi64x(
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ );
+ let r = _mm512_cvt_roundph_ps::<_MM_FROUND_NO_EXC>(a);
+ let e = _mm512_set1_ps(1.);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvt_roundph_ps() {
+ let a = _mm256_setr_epi64x(
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ );
+ let src = _mm512_set1_ps(0.);
+ let r = _mm512_mask_cvt_roundph_ps::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_cvt_roundph_ps::<_MM_FROUND_NO_EXC>(src, 0b00000000_11111111, a);
+ let e = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvt_roundph_ps() {
+ let a = _mm256_setr_epi64x(
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ );
+ let r = _mm512_maskz_cvt_roundph_ps::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_cvt_roundph_ps::<_MM_FROUND_NO_EXC>(0b00000000_11111111, a);
+ let e = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtph_ps() {
+ let a = _mm256_setr_epi64x(
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ );
+ let r = _mm512_cvtph_ps(a);
+ let e = _mm512_set1_ps(1.);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtph_ps() {
+ let a = _mm256_setr_epi64x(
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ );
+ let src = _mm512_set1_ps(0.);
+ let r = _mm512_mask_cvtph_ps(src, 0, a);
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_cvtph_ps(src, 0b00000000_11111111, a);
+ let e = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtph_ps() {
+ let a = _mm256_setr_epi64x(
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ 4323521613979991040,
+ );
+ let r = _mm512_maskz_cvtph_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_cvtph_ps(0b00000000_11111111, a);
+ let e = _mm512_setr_ps(
+ 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtph_ps() {
+ let a = _mm_setr_epi64x(4323521613979991040, 4323521613979991040);
+ let src = _mm256_set1_ps(0.);
+ let r = _mm256_mask_cvtph_ps(src, 0, a);
+ assert_eq_m256(r, src);
+ let r = _mm256_mask_cvtph_ps(src, 0b11111111, a);
+ let e = _mm256_setr_ps(1., 1., 1., 1., 1., 1., 1., 1.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtph_ps() {
+ let a = _mm_setr_epi64x(4323521613979991040, 4323521613979991040);
+ let r = _mm256_maskz_cvtph_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_cvtph_ps(0b11111111, a);
+ let e = _mm256_setr_ps(1., 1., 1., 1., 1., 1., 1., 1.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtph_ps() {
+ let a = _mm_setr_epi64x(4323521613979991040, 4323521613979991040);
+ let src = _mm_set1_ps(0.);
+ let r = _mm_mask_cvtph_ps(src, 0, a);
+ assert_eq_m128(r, src);
+ let r = _mm_mask_cvtph_ps(src, 0b00001111, a);
+ let e = _mm_setr_ps(1., 1., 1., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtph_ps() {
+ let a = _mm_setr_epi64x(4323521613979991040, 4323521613979991040);
+ let r = _mm_maskz_cvtph_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_cvtph_ps(0b00001111, a);
+ let e = _mm_setr_ps(1., 1., 1., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtt_roundps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_cvtt_roundps_epi32::<_MM_FROUND_NO_EXC>(a);
+ let e = _mm512_setr_epi32(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_mask_cvtt_roundps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let src = _mm512_set1_epi32(0);
+ let r = _mm512_mask_cvtt_roundps_epi32::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtt_roundps_epi32::<_MM_FROUND_NO_EXC>(src, 0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -3, 4, -5, 6, -7, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtt_roundps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_maskz_cvtt_roundps_epi32::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtt_roundps_epi32::<_MM_FROUND_NO_EXC>(0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -3, 4, -5, 6, -7, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtt_roundps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_cvtt_roundps_epu32::<_MM_FROUND_NO_EXC>(a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtt_roundps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let src = _mm512_set1_epi32(0);
+ let r = _mm512_mask_cvtt_roundps_epu32::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtt_roundps_epu32::<_MM_FROUND_NO_EXC>(src, 0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtt_roundps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_maskz_cvtt_roundps_epu32::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtt_roundps_epu32::<_MM_FROUND_NO_EXC>(0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvttps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_cvttps_epi32(a);
+ let e = _mm512_setr_epi32(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_mask_cvttps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let src = _mm512_set1_epi32(0);
+ let r = _mm512_mask_cvttps_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvttps_epi32(src, 0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -3, 4, -5, 6, -7, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvttps_epi32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_maskz_cvttps_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvttps_epi32(0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -3, 4, -5, 6, -7, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvttps_epi32() {
+ let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm256_mask_cvttps_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvttps_epi32(src, 0b11111111, a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvttps_epi32() {
+ let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5);
+ let r = _mm256_maskz_cvttps_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvttps_epi32(0b11111111, a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvttps_epi32() {
+ let a = _mm_set_ps(12., 13.5, 14., 15.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvttps_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvttps_epi32(src, 0b00001111, a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvttps_epi32() {
+ let a = _mm_set_ps(12., 13.5, 14., 15.5);
+ let r = _mm_maskz_cvttps_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvttps_epi32(0b00001111, a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvttps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_cvttps_epu32(a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvttps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let src = _mm512_set1_epi32(0);
+ let r = _mm512_mask_cvttps_epu32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvttps_epu32(src, 0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvttps_epu32() {
+ let a = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5,
+ );
+ let r = _mm512_maskz_cvttps_epu32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvttps_epu32(0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvttps_epu32() {
+ let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5);
+ let r = _mm256_cvttps_epu32(a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvttps_epu32() {
+ let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm256_mask_cvttps_epu32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvttps_epu32(src, 0b11111111, a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvttps_epu32() {
+ let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5);
+ let r = _mm256_maskz_cvttps_epu32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvttps_epu32(0b11111111, a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvttps_epu32() {
+ let a = _mm_set_ps(12., 13.5, 14., 15.5);
+ let r = _mm_cvttps_epu32(a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvttps_epu32() {
+ let a = _mm_set_ps(12., 13.5, 14., 15.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvttps_epu32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvttps_epu32(src, 0b00001111, a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvttps_epu32() {
+ let a = _mm_set_ps(12., 13.5, 14., 15.5);
+ let r = _mm_maskz_cvttps_epu32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvttps_epu32(0b00001111, a);
+ let e = _mm_set_epi32(12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i32gather_ps() {
+ let mut arr = [0f32; 256];
+ for i in 0..256 {
+ arr[i] = i as f32;
+ }
+ // A multiplier of 4 is word-addressing
+ #[rustfmt::skip]
+ let index = _mm512_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112,
+ 120, 128, 136, 144, 152, 160, 168, 176);
+ let r = _mm512_i32gather_ps::<4>(index, arr.as_ptr() as *const u8);
+ #[rustfmt::skip]
+ assert_eq_m512(r, _mm512_setr_ps(0., 16., 32., 48., 64., 80., 96., 112.,
+ 120., 128., 136., 144., 152., 160., 168., 176.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i32gather_ps() {
+ let mut arr = [0f32; 256];
+ for i in 0..256 {
+ arr[i] = i as f32;
+ }
+ let src = _mm512_set1_ps(2.);
+ let mask = 0b10101010_10101010;
+ #[rustfmt::skip]
+ let index = _mm512_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112,
+ 120, 128, 136, 144, 152, 160, 168, 176);
+ // A multiplier of 4 is word-addressing
+ let r = _mm512_mask_i32gather_ps::<4>(src, mask, index, arr.as_ptr() as *const u8);
+ #[rustfmt::skip]
+ assert_eq_m512(r, _mm512_setr_ps(2., 16., 2., 48., 2., 80., 2., 112.,
+ 2., 128., 2., 144., 2., 160., 2., 176.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i32gather_epi32() {
+ let mut arr = [0i32; 256];
+ for i in 0..256 {
+ arr[i] = i as i32;
+ }
+ // A multiplier of 4 is word-addressing
+ #[rustfmt::skip]
+ let index = _mm512_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112,
+ 120, 128, 136, 144, 152, 160, 168, 176);
+ let r = _mm512_i32gather_epi32::<4>(index, arr.as_ptr() as *const u8);
+ #[rustfmt::skip]
+ assert_eq_m512i(r, _mm512_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112,
+ 120, 128, 136, 144, 152, 160, 168, 176));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i32gather_epi32() {
+ let mut arr = [0i32; 256];
+ for i in 0..256 {
+ arr[i] = i as i32;
+ }
+ let src = _mm512_set1_epi32(2);
+ let mask = 0b10101010_10101010;
+ let index = _mm512_setr_epi32(
+ 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240,
+ );
+ // A multiplier of 4 is word-addressing
+ let r = _mm512_mask_i32gather_epi32::<4>(src, mask, index, arr.as_ptr() as *const u8);
+ assert_eq_m512i(
+ r,
+ _mm512_setr_epi32(2, 16, 2, 48, 2, 80, 2, 112, 2, 144, 2, 176, 2, 208, 2, 240),
+ );
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i32scatter_ps() {
+ let mut arr = [0f32; 256];
+ #[rustfmt::skip]
+ let index = _mm512_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112,
+ 128, 144, 160, 176, 192, 208, 224, 240);
+ let src = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ // A multiplier of 4 is word-addressing
+ _mm512_i32scatter_ps::<4>(arr.as_mut_ptr() as *mut u8, index, src);
+ let mut expected = [0f32; 256];
+ for i in 0..16 {
+ expected[i * 16] = (i + 1) as f32;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i32scatter_ps() {
+ let mut arr = [0f32; 256];
+ let mask = 0b10101010_10101010;
+ #[rustfmt::skip]
+ let index = _mm512_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112,
+ 128, 144, 160, 176, 192, 208, 224, 240);
+ let src = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ // A multiplier of 4 is word-addressing
+ _mm512_mask_i32scatter_ps::<4>(arr.as_mut_ptr() as *mut u8, mask, index, src);
+ let mut expected = [0f32; 256];
+ for i in 0..8 {
+ expected[i * 32 + 16] = 2. * (i + 1) as f32;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i32scatter_epi32() {
+ let mut arr = [0i32; 256];
+ #[rustfmt::skip]
+
+ let index = _mm512_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112,
+ 128, 144, 160, 176, 192, 208, 224, 240);
+ let src = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ // A multiplier of 4 is word-addressing
+ _mm512_i32scatter_epi32::<4>(arr.as_mut_ptr() as *mut u8, index, src);
+ let mut expected = [0i32; 256];
+ for i in 0..16 {
+ expected[i * 16] = (i + 1) as i32;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i32scatter_epi32() {
+ let mut arr = [0i32; 256];
+ let mask = 0b10101010_10101010;
+ #[rustfmt::skip]
+ let index = _mm512_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112,
+ 128, 144, 160, 176, 192, 208, 224, 240);
+ let src = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ // A multiplier of 4 is word-addressing
+ _mm512_mask_i32scatter_epi32::<4>(arr.as_mut_ptr() as *mut u8, mask, index, src);
+ let mut expected = [0i32; 256];
+ for i in 0..8 {
+ expected[i * 32 + 16] = 2 * (i + 1) as i32;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmplt_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.,
+ 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ let m = _mm512_cmplt_ps_mask(a, b);
+ assert_eq!(m, 0b00000101_00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmplt_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.,
+ 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ let mask = 0b01100110_01100110;
+ let r = _mm512_mask_cmplt_ps_mask(mask, a, b);
+ assert_eq!(r, 0b00000100_00000100);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpnlt_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.,
+ 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ assert_eq!(_mm512_cmpnlt_ps_mask(a, b), !_mm512_cmplt_ps_mask(a, b));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpnlt_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.,
+ 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ let mask = 0b01111010_01111010;
+ assert_eq!(_mm512_mask_cmpnlt_ps_mask(mask, a, b), 0b01111010_01111010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpnle_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.,
+ 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ let m = _mm512_cmpnle_ps_mask(b, a);
+ assert_eq!(m, 0b00001101_00001101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpnle_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.,
+ 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ let mask = 0b01100110_01100110;
+ let r = _mm512_mask_cmpnle_ps_mask(mask, b, a);
+ assert_eq!(r, 0b00000100_00000100);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmple_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.,
+ 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ assert_eq!(_mm512_cmple_ps_mask(a, b), 0b00100101_00100101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmple_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.,
+ 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ let mask = 0b01111010_01111010;
+ assert_eq!(_mm512_mask_cmple_ps_mask(mask, a, b), 0b00100000_00100000);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpeq_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.,
+ 0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.);
+ #[rustfmt::skip]
+ let b = _mm512_set_ps(0., 1., 13., 42., f32::MAX, f32::MIN, f32::NAN, -100.,
+ 0., 1., 13., 42., f32::MAX, f32::MIN, f32::NAN, -100.);
+ let m = _mm512_cmpeq_ps_mask(b, a);
+ assert_eq!(m, 0b11001101_11001101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpeq_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.,
+ 0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.);
+ #[rustfmt::skip]
+ let b = _mm512_set_ps(0., 1., 13., 42., f32::MAX, f32::MIN, f32::NAN, -100.,
+ 0., 1., 13., 42., f32::MAX, f32::MIN, f32::NAN, -100.);
+ let mask = 0b01111010_01111010;
+ let r = _mm512_mask_cmpeq_ps_mask(mask, b, a);
+ assert_eq!(r, 0b01001000_01001000);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpneq_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.,
+ 0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.);
+ #[rustfmt::skip]
+ let b = _mm512_set_ps(0., 1., 13., 42., f32::MAX, f32::MIN, f32::NAN, -100.,
+ 0., 1., 13., 42., f32::MAX, f32::MIN, f32::NAN, -100.);
+ let m = _mm512_cmpneq_ps_mask(b, a);
+ assert_eq!(m, 0b00110010_00110010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpneq_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.,
+ 0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.);
+ #[rustfmt::skip]
+ let b = _mm512_set_ps(0., 1., 13., 42., f32::MAX, f32::MIN, f32::NAN, -100.,
+ 0., 1., 13., 42., f32::MAX, f32::MIN, f32::NAN, -100.);
+ let mask = 0b01111010_01111010;
+ let r = _mm512_mask_cmpneq_ps_mask(mask, b, a);
+ assert_eq!(r, 0b00110010_00110010)
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmp_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.,
+ 0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ let m = _mm512_cmp_ps_mask::<_CMP_LT_OQ>(a, b);
+ assert_eq!(m, 0b00000101_00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmp_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.,
+ 0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ let mask = 0b01100110_01100110;
+ let r = _mm512_mask_cmp_ps_mask::<_CMP_LT_OQ>(mask, a, b);
+ assert_eq!(r, 0b00000100_00000100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmp_ps_mask() {
+ let a = _mm256_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.);
+ let b = _mm256_set1_ps(-1.);
+ let m = _mm256_cmp_ps_mask::<_CMP_LT_OQ>(a, b);
+ assert_eq!(m, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmp_ps_mask() {
+ let a = _mm256_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.);
+ let b = _mm256_set1_ps(-1.);
+ let mask = 0b01100110;
+ let r = _mm256_mask_cmp_ps_mask::<_CMP_LT_OQ>(mask, a, b);
+ assert_eq!(r, 0b00000100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmp_ps_mask() {
+ let a = _mm_set_ps(0., 1., -1., 13.);
+ let b = _mm_set1_ps(1.);
+ let m = _mm_cmp_ps_mask::<_CMP_LT_OQ>(a, b);
+ assert_eq!(m, 0b00001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmp_ps_mask() {
+ let a = _mm_set_ps(0., 1., -1., 13.);
+ let b = _mm_set1_ps(1.);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmp_ps_mask::<_CMP_LT_OQ>(mask, a, b);
+ assert_eq!(r, 0b00001010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmp_round_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.,
+ 0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ let m = _mm512_cmp_round_ps_mask::<_CMP_LT_OQ, _MM_FROUND_CUR_DIRECTION>(a, b);
+ assert_eq!(m, 0b00000101_00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmp_round_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.,
+ 0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.);
+ let b = _mm512_set1_ps(-1.);
+ let mask = 0b01100110_01100110;
+ let r = _mm512_mask_cmp_round_ps_mask::<_CMP_LT_OQ, _MM_FROUND_CUR_DIRECTION>(mask, a, b);
+ assert_eq!(r, 0b00000100_00000100);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpord_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, -1., f32::NAN, 0.,
+ f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, 1., f32::NAN, 2.);
+ #[rustfmt::skip]
+ let b = _mm512_set_ps(f32::NAN, f32::NAN, f32::NAN, f32::NAN, f32::MIN, f32::MAX, -1., 0.,
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN, f32::MIN, f32::MAX, -1., 2.);
+ let m = _mm512_cmpord_ps_mask(a, b);
+ assert_eq!(m, 0b00000101_00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpord_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, -1., f32::NAN, 0.,
+ f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, 1., f32::NAN, 2.);
+ #[rustfmt::skip]
+ let b = _mm512_set_ps(f32::NAN, f32::NAN, f32::NAN, f32::NAN, f32::MIN, f32::MAX, -1., 0.,
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN, f32::MIN, f32::MAX, -1., 2.);
+ let mask = 0b11000011_11000011;
+ let m = _mm512_mask_cmpord_ps_mask(mask, a, b);
+ assert_eq!(m, 0b00000001_00000001);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpunord_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, -1., f32::NAN, 0.,
+ f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, 1., f32::NAN, 2.);
+ #[rustfmt::skip]
+ let b = _mm512_set_ps(f32::NAN, f32::NAN, f32::NAN, f32::NAN, f32::MIN, f32::MAX, -1., 0.,
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN, f32::MIN, f32::MAX, -1., 2.);
+ let m = _mm512_cmpunord_ps_mask(a, b);
+
+ assert_eq!(m, 0b11111010_11111010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpunord_ps_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_ps(f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, -1., f32::NAN, 0.,
+ f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, 1., f32::NAN, 2.);
+ #[rustfmt::skip]
+ let b = _mm512_set_ps(f32::NAN, f32::NAN, f32::NAN, f32::NAN, f32::MIN, f32::MAX, -1., 0.,
+ f32::NAN, f32::NAN, f32::NAN, f32::NAN, f32::MIN, f32::MAX, -1., 2.);
+ let mask = 0b00001111_00001111;
+ let m = _mm512_mask_cmpunord_ps_mask(mask, a, b);
+ assert_eq!(m, 0b000001010_00001010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cmp_ss_mask() {
+ let a = _mm_setr_ps(2., 1., 1., 1.);
+ let b = _mm_setr_ps(1., 2., 2., 2.);
+ let m = _mm_cmp_ss_mask::<_CMP_GE_OS>(a, b);
+ assert_eq!(m, 1);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_cmp_ss_mask() {
+ let a = _mm_setr_ps(2., 1., 1., 1.);
+ let b = _mm_setr_ps(1., 2., 2., 2.);
+ let m = _mm_mask_cmp_ss_mask::<_CMP_GE_OS>(0b10, a, b);
+ assert_eq!(m, 0);
+ let m = _mm_mask_cmp_ss_mask::<_CMP_GE_OS>(0b1, a, b);
+ assert_eq!(m, 1);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cmp_round_ss_mask() {
+ let a = _mm_setr_ps(2., 1., 1., 1.);
+ let b = _mm_setr_ps(1., 2., 2., 2.);
+ let m = _mm_cmp_round_ss_mask::<_CMP_GE_OS, _MM_FROUND_CUR_DIRECTION>(a, b);
+ assert_eq!(m, 1);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_cmp_round_ss_mask() {
+ let a = _mm_setr_ps(2., 1., 1., 1.);
+ let b = _mm_setr_ps(1., 2., 2., 2.);
+ let m = _mm_mask_cmp_round_ss_mask::<_CMP_GE_OS, _MM_FROUND_CUR_DIRECTION>(0b10, a, b);
+ assert_eq!(m, 0);
+ let m = _mm_mask_cmp_round_ss_mask::<_CMP_GE_OS, _MM_FROUND_CUR_DIRECTION>(0b1, a, b);
+ assert_eq!(m, 1);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cmp_sd_mask() {
+ let a = _mm_setr_pd(2., 1.);
+ let b = _mm_setr_pd(1., 2.);
+ let m = _mm_cmp_sd_mask::<_CMP_GE_OS>(a, b);
+ assert_eq!(m, 1);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_cmp_sd_mask() {
+ let a = _mm_setr_pd(2., 1.);
+ let b = _mm_setr_pd(1., 2.);
+ let m = _mm_mask_cmp_sd_mask::<_CMP_GE_OS>(0b10, a, b);
+ assert_eq!(m, 0);
+ let m = _mm_mask_cmp_sd_mask::<_CMP_GE_OS>(0b1, a, b);
+ assert_eq!(m, 1);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cmp_round_sd_mask() {
+ let a = _mm_setr_pd(2., 1.);
+ let b = _mm_setr_pd(1., 2.);
+ let m = _mm_cmp_round_sd_mask::<_CMP_GE_OS, _MM_FROUND_CUR_DIRECTION>(a, b);
+ assert_eq!(m, 1);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_cmp_round_sd_mask() {
+ let a = _mm_setr_pd(2., 1.);
+ let b = _mm_setr_pd(1., 2.);
+ let m = _mm_mask_cmp_round_sd_mask::<_CMP_GE_OS, _MM_FROUND_CUR_DIRECTION>(0b10, a, b);
+ assert_eq!(m, 0);
+ let m = _mm_mask_cmp_round_sd_mask::<_CMP_GE_OS, _MM_FROUND_CUR_DIRECTION>(0b1, a, b);
+ assert_eq!(m, 1);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmplt_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let m = _mm512_cmplt_epu32_mask(a, b);
+ assert_eq!(m, 0b11001111_11001111);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmplt_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let mask = 0b01111010_01111010;
+ let r = _mm512_mask_cmplt_epu32_mask(mask, a, b);
+ assert_eq!(r, 0b01001010_01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmplt_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 101, 100, 99);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_cmplt_epu32_mask(a, b);
+ assert_eq!(r, 0b10000000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmplt_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 101, 100, 99);
+ let b = _mm256_set1_epi32(1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmplt_epu32_mask(mask, a, b);
+ assert_eq!(r, 0b10000000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmplt_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_cmplt_epu32_mask(a, b);
+ assert_eq!(r, 0b00001000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmplt_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32);
+ let b = _mm_set1_epi32(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmplt_epu32_mask(mask, a, b);
+ assert_eq!(r, 0b00001000);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpgt_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let m = _mm512_cmpgt_epu32_mask(b, a);
+ assert_eq!(m, 0b11001111_11001111);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpgt_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let mask = 0b01111010_01111010;
+ let r = _mm512_mask_cmpgt_epu32_mask(mask, b, a);
+ assert_eq!(r, 0b01001010_01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpgt_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 99, 100, 101);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_cmpgt_epu32_mask(a, b);
+ assert_eq!(r, 0b00111111);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpgt_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 99, 100, 101);
+ let b = _mm256_set1_epi32(1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpgt_epu32_mask(mask, a, b);
+ assert_eq!(r, 0b00111111);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpgt_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_cmpgt_epu32_mask(a, b);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpgt_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32);
+ let b = _mm_set1_epi32(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpgt_epu32_mask(mask, a, b);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmple_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ assert_eq!(
+ _mm512_cmple_epu32_mask(a, b),
+ !_mm512_cmpgt_epu32_mask(a, b)
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmple_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let mask = 0b01111010_01111010;
+ assert_eq!(
+ _mm512_mask_cmple_epu32_mask(mask, a, b),
+ 0b01111010_01111010
+ );
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmple_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 200, 100, 101);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_cmple_epu32_mask(a, b);
+ assert_eq!(r, 0b11000000)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmple_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 200, 100, 101);
+ let b = _mm256_set1_epi32(1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmple_epu32_mask(mask, a, b);
+ assert_eq!(r, 0b11000000)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmple_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_cmple_epu32_mask(a, b);
+ assert_eq!(r, 0b00001100)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmple_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32);
+ let b = _mm_set1_epi32(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmple_epu32_mask(mask, a, b);
+ assert_eq!(r, 0b00001100)
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpge_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ assert_eq!(
+ _mm512_cmpge_epu32_mask(a, b),
+ !_mm512_cmplt_epu32_mask(a, b)
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpge_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let mask = 0b01111010_01111010;
+ assert_eq!(_mm512_mask_cmpge_epu32_mask(mask, a, b), 0b01100000_0110000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpge_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 300, 100, 200);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_cmpge_epu32_mask(a, b);
+ assert_eq!(r, 0b01111111)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpge_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 300, 100, 200);
+ let b = _mm256_set1_epi32(1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpge_epu32_mask(mask, a, b);
+ assert_eq!(r, 0b01111111)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpge_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_cmpge_epu32_mask(a, b);
+ assert_eq!(r, 0b00000111)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpge_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32);
+ let b = _mm_set1_epi32(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpge_epu32_mask(mask, a, b);
+ assert_eq!(r, 0b00000111)
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpeq_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let m = _mm512_cmpeq_epu32_mask(b, a);
+ assert_eq!(m, 0b11001111_11001111);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpeq_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let mask = 0b01111010_01111010;
+ let r = _mm512_mask_cmpeq_epu32_mask(mask, b, a);
+ assert_eq!(r, 0b01001010_01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpeq_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let m = _mm256_cmpeq_epu32_mask(b, a);
+ assert_eq!(m, 0b11001111);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpeq_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let mask = 0b01111010;
+ let r = _mm256_mask_cmpeq_epu32_mask(mask, b, a);
+ assert_eq!(r, 0b01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpeq_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32);
+ let b = _mm_set_epi32(0, 1, 13, 42);
+ let m = _mm_cmpeq_epu32_mask(b, a);
+ assert_eq!(m, 0b00001100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpeq_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32);
+ let b = _mm_set_epi32(0, 1, 13, 42);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpeq_epu32_mask(mask, b, a);
+ assert_eq!(r, 0b00001100);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpneq_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let m = _mm512_cmpneq_epu32_mask(b, a);
+ assert_eq!(m, !_mm512_cmpeq_epu32_mask(b, a));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpneq_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, -100, 100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, -100, 100);
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let mask = 0b01111010_01111010;
+ let r = _mm512_mask_cmpneq_epu32_mask(mask, b, a);
+ assert_eq!(r, 0b00110010_00110010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpneq_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, -100, 100);
+ let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, -100, 100);
+ let r = _mm256_cmpneq_epu32_mask(b, a);
+ assert_eq!(r, 0b00110000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpneq_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, -100, 100);
+ let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, -100, 100);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpneq_epu32_mask(mask, b, a);
+ assert_eq!(r, 0b00110000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpneq_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32);
+ let b = _mm_set_epi32(0, 1, 13, 42);
+ let r = _mm_cmpneq_epu32_mask(b, a);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpneq_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32);
+ let b = _mm_set_epi32(0, 1, 13, 42);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpneq_epu32_mask(mask, b, a);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmp_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let m = _mm512_cmp_epu32_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b11001111_11001111);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmp_epu32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let mask = 0b01111010_01111010;
+ let r = _mm512_mask_cmp_epu32_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b01001010_01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmp_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let m = _mm256_cmp_epu32_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b11001111);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmp_epu32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmp_epu32_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b11001111);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmp_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, i32::MAX);
+ let b = _mm_set1_epi32(1);
+ let m = _mm_cmp_epu32_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b00001000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmp_epu32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, i32::MAX);
+ let b = _mm_set1_epi32(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmp_epu32_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b00001000);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmplt_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let m = _mm512_cmplt_epi32_mask(a, b);
+ assert_eq!(m, 0b00000101_00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmplt_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let mask = 0b01100110_01100110;
+ let r = _mm512_mask_cmplt_epi32_mask(mask, a, b);
+ assert_eq!(r, 0b00000100_00000100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmplt_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 101, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let r = _mm256_cmplt_epi32_mask(a, b);
+ assert_eq!(r, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmplt_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 101, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmplt_epi32_mask(mask, a, b);
+ assert_eq!(r, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmplt_epi32_mask() {
+ let a = _mm_set_epi32(i32::MAX, i32::MIN, 100, -100);
+ let b = _mm_set1_epi32(-1);
+ let r = _mm_cmplt_epi32_mask(a, b);
+ assert_eq!(r, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmplt_epi32_mask() {
+ let a = _mm_set_epi32(i32::MAX, i32::MIN, 100, -100);
+ let b = _mm_set1_epi32(-1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmplt_epi32_mask(mask, a, b);
+ assert_eq!(r, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpgt_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let m = _mm512_cmpgt_epi32_mask(b, a);
+ assert_eq!(m, 0b00000101_00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpgt_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let mask = 0b01100110_01100110;
+ let r = _mm512_mask_cmpgt_epi32_mask(mask, b, a);
+ assert_eq!(r, 0b00000100_00000100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpgt_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let r = _mm256_cmpgt_epi32_mask(a, b);
+ assert_eq!(r, 0b11011010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpgt_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpgt_epi32_mask(mask, a, b);
+ assert_eq!(r, 0b11011010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpgt_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, 13);
+ let b = _mm_set1_epi32(-1);
+ let r = _mm_cmpgt_epi32_mask(a, b);
+ assert_eq!(r, 0b00001101);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpgt_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, 13);
+ let b = _mm_set1_epi32(-1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpgt_epi32_mask(mask, a, b);
+ assert_eq!(r, 0b00001101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmple_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ assert_eq!(
+ _mm512_cmple_epi32_mask(a, b),
+ !_mm512_cmpgt_epi32_mask(a, b)
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmple_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let mask = 0b01111010_01111010;
+ assert_eq!(_mm512_mask_cmple_epi32_mask(mask, a, b), 0b01100000_0110000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmple_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 200, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let r = _mm256_cmple_epi32_mask(a, b);
+ assert_eq!(r, 0b00100101)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmple_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 200, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmple_epi32_mask(mask, a, b);
+ assert_eq!(r, 0b00100101)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmple_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, 200);
+ let b = _mm_set1_epi32(-1);
+ let r = _mm_cmple_epi32_mask(a, b);
+ assert_eq!(r, 0b00000010)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmple_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, 200);
+ let b = _mm_set1_epi32(-1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmple_epi32_mask(mask, a, b);
+ assert_eq!(r, 0b00000010)
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpge_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ assert_eq!(
+ _mm512_cmpge_epi32_mask(a, b),
+ !_mm512_cmplt_epi32_mask(a, b)
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpge_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let mask = 0b01111010_01111010;
+ assert_eq!(
+ _mm512_mask_cmpge_epi32_mask(mask, a, b),
+ 0b01111010_01111010
+ );
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpge_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let r = _mm256_cmpge_epi32_mask(a, b);
+ assert_eq!(r, 0b11111010)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpge_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpge_epi32_mask(mask, a, b);
+ assert_eq!(r, 0b11111010)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpge_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32);
+ let b = _mm_set1_epi32(-1);
+ let r = _mm_cmpge_epi32_mask(a, b);
+ assert_eq!(r, 0b00001111)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpge_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32);
+ let b = _mm_set1_epi32(-1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpge_epi32_mask(mask, a, b);
+ assert_eq!(r, 0b00001111)
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpeq_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let m = _mm512_cmpeq_epi32_mask(b, a);
+ assert_eq!(m, 0b11001111_11001111);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpeq_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let mask = 0b01111010_01111010;
+ let r = _mm512_mask_cmpeq_epi32_mask(mask, b, a);
+ assert_eq!(r, 0b01001010_01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpeq_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let m = _mm256_cmpeq_epi32_mask(b, a);
+ assert_eq!(m, 0b11001111);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpeq_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let mask = 0b01111010;
+ let r = _mm256_mask_cmpeq_epi32_mask(mask, b, a);
+ assert_eq!(r, 0b01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpeq_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, 13);
+ let b = _mm_set_epi32(0, 1, 13, 42);
+ let m = _mm_cmpeq_epi32_mask(b, a);
+ assert_eq!(m, 0b00001100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpeq_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, 13);
+ let b = _mm_set_epi32(0, 1, 13, 42);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpeq_epi32_mask(mask, b, a);
+ assert_eq!(r, 0b00001100);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpneq_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let m = _mm512_cmpneq_epi32_mask(b, a);
+ assert_eq!(m, !_mm512_cmpeq_epi32_mask(b, a));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpneq_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, -100, 100,
+ 0, 1, -1, 13, i32::MAX, i32::MIN, -100, 100);
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let mask = 0b01111010_01111010;
+ let r = _mm512_mask_cmpneq_epi32_mask(mask, b, a);
+ assert_eq!(r, 0b00110010_00110010)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpneq_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let m = _mm256_cmpneq_epi32_mask(b, a);
+ assert_eq!(m, !_mm256_cmpeq_epi32_mask(b, a));
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpneq_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, -100, 100);
+ let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpneq_epi32_mask(mask, b, a);
+ assert_eq!(r, 0b00110011)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpneq_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, 13);
+ let b = _mm_set_epi32(0, 1, 13, 42);
+ let r = _mm_cmpneq_epi32_mask(b, a);
+ assert_eq!(r, 0b00000011)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpneq_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, 13);
+ let b = _mm_set_epi32(0, 1, 13, 42);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpneq_epi32_mask(mask, b, a);
+ assert_eq!(r, 0b00000011)
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmp_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let m = _mm512_cmp_epi32_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b00000101_00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmp_epi32_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100,
+ 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm512_set1_epi32(-1);
+ let mask = 0b01100110_01100110;
+ let r = _mm512_mask_cmp_epi32_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b00000100_00000100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmp_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let m = _mm256_cmp_epi32_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmp_epi32_mask() {
+ let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100);
+ let b = _mm256_set1_epi32(-1);
+ let mask = 0b01100110;
+ let r = _mm256_mask_cmp_epi32_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b00000100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmp_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, 13);
+ let b = _mm_set1_epi32(1);
+ let m = _mm_cmp_epi32_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b00001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmp_epi32_mask() {
+ let a = _mm_set_epi32(0, 1, -1, 13);
+ let b = _mm_set1_epi32(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmp_epi32_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b00001010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set_epi8() {
+ let r = _mm512_set1_epi8(2);
+ assert_eq_m512i(
+ r,
+ _mm512_set_epi8(
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ ),
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set_epi16() {
+ let r = _mm512_set1_epi16(2);
+ assert_eq_m512i(
+ r,
+ _mm512_set_epi16(
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2,
+ ),
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set_epi32() {
+ let r = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(
+ r,
+ _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0),
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setr_epi32() {
+ let r = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(
+ r,
+ _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0),
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set1_epi8() {
+ let r = _mm512_set_epi8(
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2,
+ );
+ assert_eq_m512i(r, _mm512_set1_epi8(2));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set1_epi16() {
+ let r = _mm512_set_epi16(
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2,
+ );
+ assert_eq_m512i(r, _mm512_set1_epi16(2));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set1_epi32() {
+ let r = _mm512_set_epi32(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m512i(r, _mm512_set1_epi32(2));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setzero_si512() {
+ assert_eq_m512i(_mm512_set1_epi32(0), _mm512_setzero_si512());
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setzero_epi32() {
+ assert_eq_m512i(_mm512_set1_epi32(0), _mm512_setzero_epi32());
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set_ps() {
+ let r = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(
+ r,
+ _mm512_set_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ ),
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setr_ps() {
+ let r = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ assert_eq_m512(
+ r,
+ _mm512_setr_ps(
+ 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1., 0.,
+ ),
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set1_ps() {
+ #[rustfmt::skip]
+ let expected = _mm512_set_ps(2., 2., 2., 2., 2., 2., 2., 2.,
+ 2., 2., 2., 2., 2., 2., 2., 2.);
+ assert_eq_m512(expected, _mm512_set1_ps(2.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set4_epi32() {
+ let r = _mm512_set_epi32(4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1);
+ assert_eq_m512i(r, _mm512_set4_epi32(4, 3, 2, 1));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set4_ps() {
+ let r = _mm512_set_ps(
+ 4., 3., 2., 1., 4., 3., 2., 1., 4., 3., 2., 1., 4., 3., 2., 1.,
+ );
+ assert_eq_m512(r, _mm512_set4_ps(4., 3., 2., 1.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setr4_epi32() {
+ let r = _mm512_set_epi32(4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1);
+ assert_eq_m512i(r, _mm512_setr4_epi32(1, 2, 3, 4));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setr4_ps() {
+ let r = _mm512_set_ps(
+ 4., 3., 2., 1., 4., 3., 2., 1., 4., 3., 2., 1., 4., 3., 2., 1.,
+ );
+ assert_eq_m512(r, _mm512_setr4_ps(1., 2., 3., 4.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setzero_ps() {
+ assert_eq_m512(_mm512_setzero_ps(), _mm512_set1_ps(0.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setzero() {
+ assert_eq_m512(_mm512_setzero(), _mm512_set1_ps(0.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_loadu_pd() {
+ let a = &[4., 3., 2., 5., 8., 9., 64., 50.];
+ let p = a.as_ptr();
+ let r = _mm512_loadu_pd(black_box(p));
+ let e = _mm512_setr_pd(4., 3., 2., 5., 8., 9., 64., 50.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_storeu_pd() {
+ let a = _mm512_set1_pd(9.);
+ let mut r = _mm512_undefined_pd();
+ _mm512_storeu_pd(&mut r as *mut _ as *mut f64, a);
+ assert_eq_m512d(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_loadu_ps() {
+ let a = &[
+ 4., 3., 2., 5., 8., 9., 64., 50., -4., -3., -2., -5., -8., -9., -64., -50.,
+ ];
+ let p = a.as_ptr();
+ let r = _mm512_loadu_ps(black_box(p));
+ let e = _mm512_setr_ps(
+ 4., 3., 2., 5., 8., 9., 64., 50., -4., -3., -2., -5., -8., -9., -64., -50.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_storeu_ps() {
+ let a = _mm512_set1_ps(9.);
+ let mut r = _mm512_undefined_ps();
+ _mm512_storeu_ps(&mut r as *mut _ as *mut f32, a);
+ assert_eq_m512(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_loadu_epi32() {
+ let src = _mm512_set1_epi32(42);
+ let a = &[1_i32, 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 = _mm512_mask_loadu_epi32(src, m, black_box(p));
+ let e = _mm512_setr_epi32(42, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_loadu_epi32() {
+ let a = &[1_i32, 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 = _mm512_maskz_loadu_epi32(m, black_box(p));
+ let e = _mm512_setr_epi32(0, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_load_epi32() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i32; 16], // 64 bytes
+ }
+ let src = _mm512_set1_epi32(42);
+ let a = Align {
+ data: [1_i32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11101000_11001010;
+ let r = _mm512_mask_load_epi32(src, m, black_box(p));
+ let e = _mm512_setr_epi32(42, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_load_epi32() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i32; 16], // 64 bytes
+ }
+ let a = Align {
+ data: [1_i32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11101000_11001010;
+ let r = _mm512_maskz_load_epi32(m, black_box(p));
+ let e = _mm512_setr_epi32(0, 2, 0, 4, 0, 0, 7, 8, 0, 0, 0, 12, 0, 14, 15, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_storeu_epi32() {
+ let mut r = [42_i32; 16];
+ let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let m = 0b11101000_11001010;
+ _mm512_mask_storeu_epi32(r.as_mut_ptr(), m, a);
+ let e = _mm512_setr_epi32(42, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16);
+ assert_eq_m512i(_mm512_loadu_epi32(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_store_epi32() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i32; 16],
+ }
+ let mut r = Align { data: [42; 16] };
+ let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let m = 0b11101000_11001010;
+ _mm512_mask_store_epi32(r.data.as_mut_ptr(), m, a);
+ let e = _mm512_setr_epi32(42, 2, 42, 4, 42, 42, 7, 8, 42, 42, 42, 12, 42, 14, 15, 16);
+ assert_eq_m512i(_mm512_load_epi32(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_loadu_epi64() {
+ let src = _mm512_set1_epi64(42);
+ let a = &[1_i64, 2, 3, 4, 5, 6, 7, 8];
+ let p = a.as_ptr();
+ let m = 0b11001010;
+ let r = _mm512_mask_loadu_epi64(src, m, black_box(p));
+ let e = _mm512_setr_epi64(42, 2, 42, 4, 42, 42, 7, 8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_loadu_epi64() {
+ let a = &[1_i64, 2, 3, 4, 5, 6, 7, 8];
+ let p = a.as_ptr();
+ let m = 0b11001010;
+ let r = _mm512_maskz_loadu_epi64(m, black_box(p));
+ let e = _mm512_setr_epi64(0, 2, 0, 4, 0, 0, 7, 8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_load_epi64() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i64; 8], // 64 bytes
+ }
+ let src = _mm512_set1_epi64(42);
+ let a = Align {
+ data: [1_i64, 2, 3, 4, 5, 6, 7, 8],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11001010;
+ let r = _mm512_mask_load_epi64(src, m, black_box(p));
+ let e = _mm512_setr_epi64(42, 2, 42, 4, 42, 42, 7, 8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_load_epi64() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i64; 8], // 64 bytes
+ }
+ let a = Align {
+ data: [1_i64, 2, 3, 4, 5, 6, 7, 8],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11001010;
+ let r = _mm512_maskz_load_epi64(m, black_box(p));
+ let e = _mm512_setr_epi64(0, 2, 0, 4, 0, 0, 7, 8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_storeu_epi64() {
+ let mut r = [42_i64; 8];
+ let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let m = 0b11001010;
+ _mm512_mask_storeu_epi64(r.as_mut_ptr(), m, a);
+ let e = _mm512_setr_epi64(42, 2, 42, 4, 42, 42, 7, 8);
+ assert_eq_m512i(_mm512_loadu_epi64(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_store_epi64() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i64; 8],
+ }
+ let mut r = Align { data: [42; 8] };
+ let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let m = 0b11001010;
+ let p = r.data.as_mut_ptr();
+ _mm512_mask_store_epi64(p, m, a);
+ let e = _mm512_setr_epi64(42, 2, 42, 4, 42, 42, 7, 8);
+ assert_eq_m512i(_mm512_load_epi64(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_loadu_ps() {
+ let src = _mm512_set1_ps(42.0);
+ let a = &[
+ 1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0,
+ 16.0,
+ ];
+ let p = a.as_ptr();
+ let m = 0b11101000_11001010;
+ let r = _mm512_mask_loadu_ps(src, m, black_box(p));
+ let e = _mm512_setr_ps(
+ 42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0, 42.0, 42.0, 42.0, 12.0, 42.0, 14.0, 15.0,
+ 16.0,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_loadu_ps() {
+ let a = &[
+ 1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0,
+ 16.0,
+ ];
+ let p = a.as_ptr();
+ let m = 0b11101000_11001010;
+ let r = _mm512_maskz_loadu_ps(m, black_box(p));
+ let e = _mm512_setr_ps(
+ 0.0, 2.0, 0.0, 4.0, 0.0, 0.0, 7.0, 8.0, 0.0, 0.0, 0.0, 12.0, 0.0, 14.0, 15.0, 16.0,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_load_ps() {
+ #[repr(align(64))]
+ struct Align {
+ data: [f32; 16], // 64 bytes
+ }
+ let src = _mm512_set1_ps(42.0);
+ let a = Align {
+ data: [
+ 1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0,
+ 15.0, 16.0,
+ ],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11101000_11001010;
+ let r = _mm512_mask_load_ps(src, m, black_box(p));
+ let e = _mm512_setr_ps(
+ 42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0, 42.0, 42.0, 42.0, 12.0, 42.0, 14.0, 15.0,
+ 16.0,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_load_ps() {
+ #[repr(align(64))]
+ struct Align {
+ data: [f32; 16], // 64 bytes
+ }
+ let a = Align {
+ data: [
+ 1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0,
+ 15.0, 16.0,
+ ],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11101000_11001010;
+ let r = _mm512_maskz_load_ps(m, black_box(p));
+ let e = _mm512_setr_ps(
+ 0.0, 2.0, 0.0, 4.0, 0.0, 0.0, 7.0, 8.0, 0.0, 0.0, 0.0, 12.0, 0.0, 14.0, 15.0, 16.0,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_storeu_ps() {
+ let mut r = [42_f32; 16];
+ let a = _mm512_setr_ps(
+ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0,
+ );
+ let m = 0b11101000_11001010;
+ _mm512_mask_storeu_ps(r.as_mut_ptr(), m, a);
+ let e = _mm512_setr_ps(
+ 42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0, 42.0, 42.0, 42.0, 12.0, 42.0, 14.0, 15.0,
+ 16.0,
+ );
+ assert_eq_m512(_mm512_loadu_ps(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_store_ps() {
+ #[repr(align(64))]
+ struct Align {
+ data: [f32; 16],
+ }
+ let mut r = Align { data: [42.0; 16] };
+ let a = _mm512_setr_ps(
+ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0,
+ );
+ let m = 0b11101000_11001010;
+ _mm512_mask_store_ps(r.data.as_mut_ptr(), m, a);
+ let e = _mm512_setr_ps(
+ 42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0, 42.0, 42.0, 42.0, 12.0, 42.0, 14.0, 15.0,
+ 16.0,
+ );
+ assert_eq_m512(_mm512_load_ps(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_loadu_pd() {
+ let src = _mm512_set1_pd(42.0);
+ let a = &[1.0_f64, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0];
+ let p = a.as_ptr();
+ let m = 0b11001010;
+ let r = _mm512_mask_loadu_pd(src, m, black_box(p));
+ let e = _mm512_setr_pd(42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_loadu_pd() {
+ let a = &[1.0_f64, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0];
+ let p = a.as_ptr();
+ let m = 0b11001010;
+ let r = _mm512_maskz_loadu_pd(m, black_box(p));
+ let e = _mm512_setr_pd(0.0, 2.0, 0.0, 4.0, 0.0, 0.0, 7.0, 8.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_load_pd() {
+ #[repr(align(64))]
+ struct Align {
+ data: [f64; 8], // 64 bytes
+ }
+ let src = _mm512_set1_pd(42.0);
+ let a = Align {
+ data: [1.0_f64, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11001010;
+ let r = _mm512_mask_load_pd(src, m, black_box(p));
+ let e = _mm512_setr_pd(42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_load_pd() {
+ #[repr(align(64))]
+ struct Align {
+ data: [f64; 8], // 64 bytes
+ }
+ let a = Align {
+ data: [1.0_f64, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11001010;
+ let r = _mm512_maskz_load_pd(m, black_box(p));
+ let e = _mm512_setr_pd(0.0, 2.0, 0.0, 4.0, 0.0, 0.0, 7.0, 8.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_storeu_pd() {
+ let mut r = [42_f64; 8];
+ let a = _mm512_setr_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0);
+ let m = 0b11001010;
+ _mm512_mask_storeu_pd(r.as_mut_ptr(), m, a);
+ let e = _mm512_setr_pd(42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0);
+ assert_eq_m512d(_mm512_loadu_pd(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_store_pd() {
+ #[repr(align(64))]
+ struct Align {
+ data: [f64; 8],
+ }
+ let mut r = Align { data: [42.0; 8] };
+ let a = _mm512_setr_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0);
+ let m = 0b11001010;
+ _mm512_mask_store_pd(r.data.as_mut_ptr(), m, a);
+ let e = _mm512_setr_pd(42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0);
+ assert_eq_m512d(_mm512_load_pd(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_loadu_epi32() {
+ let src = _mm256_set1_epi32(42);
+ let a = &[1_i32, 2, 3, 4, 5, 6, 7, 8];
+ let p = a.as_ptr();
+ let m = 0b11001010;
+ let r = _mm256_mask_loadu_epi32(src, m, black_box(p));
+ let e = _mm256_setr_epi32(42, 2, 42, 4, 42, 42, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_loadu_epi32() {
+ let a = &[1_i32, 2, 3, 4, 5, 6, 7, 8];
+ let p = a.as_ptr();
+ let m = 0b11001010;
+ let r = _mm256_maskz_loadu_epi32(m, black_box(p));
+ let e = _mm256_setr_epi32(0, 2, 0, 4, 0, 0, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_load_epi32() {
+ #[repr(align(32))]
+ struct Align {
+ data: [i32; 8], // 32 bytes
+ }
+ let src = _mm256_set1_epi32(42);
+ let a = Align {
+ data: [1_i32, 2, 3, 4, 5, 6, 7, 8],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11001010;
+ let r = _mm256_mask_load_epi32(src, m, black_box(p));
+ let e = _mm256_setr_epi32(42, 2, 42, 4, 42, 42, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_load_epi32() {
+ #[repr(align(32))]
+ struct Align {
+ data: [i32; 8], // 32 bytes
+ }
+ let a = Align {
+ data: [1_i32, 2, 3, 4, 5, 6, 7, 8],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11001010;
+ let r = _mm256_maskz_load_epi32(m, black_box(p));
+ let e = _mm256_setr_epi32(0, 2, 0, 4, 0, 0, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_storeu_epi32() {
+ let mut r = [42_i32; 8];
+ let a = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let m = 0b11001010;
+ _mm256_mask_storeu_epi32(r.as_mut_ptr(), m, a);
+ let e = _mm256_setr_epi32(42, 2, 42, 4, 42, 42, 7, 8);
+ assert_eq_m256i(_mm256_loadu_epi32(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_store_epi32() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i32; 8],
+ }
+ let mut r = Align { data: [42; 8] };
+ let a = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let m = 0b11001010;
+ _mm256_mask_store_epi32(r.data.as_mut_ptr(), m, a);
+ let e = _mm256_setr_epi32(42, 2, 42, 4, 42, 42, 7, 8);
+ assert_eq_m256i(_mm256_load_epi32(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_loadu_epi64() {
+ let src = _mm256_set1_epi64x(42);
+ let a = &[1_i64, 2, 3, 4];
+ let p = a.as_ptr();
+ let m = 0b1010;
+ let r = _mm256_mask_loadu_epi64(src, m, black_box(p));
+ let e = _mm256_setr_epi64x(42, 2, 42, 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_loadu_epi64() {
+ let a = &[1_i64, 2, 3, 4];
+ let p = a.as_ptr();
+ let m = 0b1010;
+ let r = _mm256_maskz_loadu_epi64(m, black_box(p));
+ let e = _mm256_setr_epi64x(0, 2, 0, 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_load_epi64() {
+ #[repr(align(32))]
+ struct Align {
+ data: [i64; 4], // 32 bytes
+ }
+ let src = _mm256_set1_epi64x(42);
+ let a = Align {
+ data: [1_i64, 2, 3, 4],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b1010;
+ let r = _mm256_mask_load_epi64(src, m, black_box(p));
+ let e = _mm256_setr_epi64x(42, 2, 42, 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_load_epi64() {
+ #[repr(align(32))]
+ struct Align {
+ data: [i64; 4], // 32 bytes
+ }
+ let a = Align {
+ data: [1_i64, 2, 3, 4],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b1010;
+ let r = _mm256_maskz_load_epi64(m, black_box(p));
+ let e = _mm256_setr_epi64x(0, 2, 0, 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_storeu_epi64() {
+ let mut r = [42_i64; 4];
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let m = 0b1010;
+ _mm256_mask_storeu_epi64(r.as_mut_ptr(), m, a);
+ let e = _mm256_setr_epi64x(42, 2, 42, 4);
+ assert_eq_m256i(_mm256_loadu_epi64(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_store_epi64() {
+ #[repr(align(32))]
+ struct Align {
+ data: [i64; 4],
+ }
+ let mut r = Align { data: [42; 4] };
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let m = 0b1010;
+ _mm256_mask_store_epi64(r.data.as_mut_ptr(), m, a);
+ let e = _mm256_setr_epi64x(42, 2, 42, 4);
+ assert_eq_m256i(_mm256_load_epi64(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_loadu_ps() {
+ let src = _mm256_set1_ps(42.0);
+ let a = &[1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0];
+ let p = a.as_ptr();
+ let m = 0b11001010;
+ let r = _mm256_mask_loadu_ps(src, m, black_box(p));
+ let e = _mm256_setr_ps(42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_loadu_ps() {
+ let a = &[1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0];
+ let p = a.as_ptr();
+ let m = 0b11001010;
+ let r = _mm256_maskz_loadu_ps(m, black_box(p));
+ let e = _mm256_setr_ps(0.0, 2.0, 0.0, 4.0, 0.0, 0.0, 7.0, 8.0);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_load_ps() {
+ #[repr(align(32))]
+ struct Align {
+ data: [f32; 8], // 32 bytes
+ }
+ let src = _mm256_set1_ps(42.0);
+ let a = Align {
+ data: [1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11001010;
+ let r = _mm256_mask_load_ps(src, m, black_box(p));
+ let e = _mm256_setr_ps(42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_load_ps() {
+ #[repr(align(32))]
+ struct Align {
+ data: [f32; 8], // 32 bytes
+ }
+ let a = Align {
+ data: [1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b11001010;
+ let r = _mm256_maskz_load_ps(m, black_box(p));
+ let e = _mm256_setr_ps(0.0, 2.0, 0.0, 4.0, 0.0, 0.0, 7.0, 8.0);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_storeu_ps() {
+ let mut r = [42_f32; 8];
+ let a = _mm256_setr_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0);
+ let m = 0b11001010;
+ _mm256_mask_storeu_ps(r.as_mut_ptr(), m, a);
+ let e = _mm256_setr_ps(42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0);
+ assert_eq_m256(_mm256_loadu_ps(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_store_ps() {
+ #[repr(align(32))]
+ struct Align {
+ data: [f32; 8],
+ }
+ let mut r = Align { data: [42.0; 8] };
+ let a = _mm256_setr_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0);
+ let m = 0b11001010;
+ _mm256_mask_store_ps(r.data.as_mut_ptr(), m, a);
+ let e = _mm256_setr_ps(42.0, 2.0, 42.0, 4.0, 42.0, 42.0, 7.0, 8.0);
+ assert_eq_m256(_mm256_load_ps(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_loadu_pd() {
+ let src = _mm256_set1_pd(42.0);
+ let a = &[1.0_f64, 2.0, 3.0, 4.0];
+ let p = a.as_ptr();
+ let m = 0b1010;
+ let r = _mm256_mask_loadu_pd(src, m, black_box(p));
+ let e = _mm256_setr_pd(42.0, 2.0, 42.0, 4.0);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_loadu_pd() {
+ let a = &[1.0_f64, 2.0, 3.0, 4.0];
+ let p = a.as_ptr();
+ let m = 0b1010;
+ let r = _mm256_maskz_loadu_pd(m, black_box(p));
+ let e = _mm256_setr_pd(0.0, 2.0, 0.0, 4.0);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_load_pd() {
+ #[repr(align(32))]
+ struct Align {
+ data: [f64; 4], // 32 bytes
+ }
+ let src = _mm256_set1_pd(42.0);
+ let a = Align {
+ data: [1.0_f64, 2.0, 3.0, 4.0],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b1010;
+ let r = _mm256_mask_load_pd(src, m, black_box(p));
+ let e = _mm256_setr_pd(42.0, 2.0, 42.0, 4.0);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_load_pd() {
+ #[repr(align(32))]
+ struct Align {
+ data: [f64; 4], // 32 bytes
+ }
+ let a = Align {
+ data: [1.0_f64, 2.0, 3.0, 4.0],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b1010;
+ let r = _mm256_maskz_load_pd(m, black_box(p));
+ let e = _mm256_setr_pd(0.0, 2.0, 0.0, 4.0);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_storeu_pd() {
+ let mut r = [42_f64; 4];
+ let a = _mm256_setr_pd(1.0, 2.0, 3.0, 4.0);
+ let m = 0b1010;
+ _mm256_mask_storeu_pd(r.as_mut_ptr(), m, a);
+ let e = _mm256_setr_pd(42.0, 2.0, 42.0, 4.0);
+ assert_eq_m256d(_mm256_loadu_pd(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_store_pd() {
+ #[repr(align(32))]
+ struct Align {
+ data: [f64; 4],
+ }
+ let mut r = Align { data: [42.0; 4] };
+ let a = _mm256_setr_pd(1.0, 2.0, 3.0, 4.0);
+ let m = 0b1010;
+ _mm256_mask_store_pd(r.data.as_mut_ptr(), m, a);
+ let e = _mm256_setr_pd(42.0, 2.0, 42.0, 4.0);
+ assert_eq_m256d(_mm256_load_pd(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_loadu_epi32() {
+ let src = _mm_set1_epi32(42);
+ let a = &[1_i32, 2, 3, 4];
+ let p = a.as_ptr();
+ let m = 0b1010;
+ let r = _mm_mask_loadu_epi32(src, m, black_box(p));
+ let e = _mm_setr_epi32(42, 2, 42, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_loadu_epi32() {
+ let a = &[1_i32, 2, 3, 4];
+ let p = a.as_ptr();
+ let m = 0b1010;
+ let r = _mm_maskz_loadu_epi32(m, black_box(p));
+ let e = _mm_setr_epi32(0, 2, 0, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_load_epi32() {
+ #[repr(align(16))]
+ struct Align {
+ data: [i32; 4], // 32 bytes
+ }
+ let src = _mm_set1_epi32(42);
+ let a = Align {
+ data: [1_i32, 2, 3, 4],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b1010;
+ let r = _mm_mask_load_epi32(src, m, black_box(p));
+ let e = _mm_setr_epi32(42, 2, 42, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_load_epi32() {
+ #[repr(align(16))]
+ struct Align {
+ data: [i32; 4], // 16 bytes
+ }
+ let a = Align {
+ data: [1_i32, 2, 3, 4],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b1010;
+ let r = _mm_maskz_load_epi32(m, black_box(p));
+ let e = _mm_setr_epi32(0, 2, 0, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_storeu_epi32() {
+ let mut r = [42_i32; 4];
+ let a = _mm_setr_epi32(1, 2, 3, 4);
+ let m = 0b1010;
+ _mm_mask_storeu_epi32(r.as_mut_ptr(), m, a);
+ let e = _mm_setr_epi32(42, 2, 42, 4);
+ assert_eq_m128i(_mm_loadu_epi32(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_store_epi32() {
+ #[repr(align(16))]
+ struct Align {
+ data: [i32; 4], // 16 bytes
+ }
+ let mut r = Align { data: [42; 4] };
+ let a = _mm_setr_epi32(1, 2, 3, 4);
+ let m = 0b1010;
+ _mm_mask_store_epi32(r.data.as_mut_ptr(), m, a);
+ let e = _mm_setr_epi32(42, 2, 42, 4);
+ assert_eq_m128i(_mm_load_epi32(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_loadu_epi64() {
+ let src = _mm_set1_epi64x(42);
+ let a = &[1_i64, 2];
+ let p = a.as_ptr();
+ let m = 0b10;
+ let r = _mm_mask_loadu_epi64(src, m, black_box(p));
+ let e = _mm_setr_epi64x(42, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_loadu_epi64() {
+ let a = &[1_i64, 2];
+ let p = a.as_ptr();
+ let m = 0b10;
+ let r = _mm_maskz_loadu_epi64(m, black_box(p));
+ let e = _mm_setr_epi64x(0, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_load_epi64() {
+ #[repr(align(16))]
+ struct Align {
+ data: [i64; 2], // 16 bytes
+ }
+ let src = _mm_set1_epi64x(42);
+ let a = Align { data: [1_i64, 2] };
+ let p = a.data.as_ptr();
+ let m = 0b10;
+ let r = _mm_mask_load_epi64(src, m, black_box(p));
+ let e = _mm_setr_epi64x(42, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_load_epi64() {
+ #[repr(align(16))]
+ struct Align {
+ data: [i64; 2], // 16 bytes
+ }
+ let a = Align { data: [1_i64, 2] };
+ let p = a.data.as_ptr();
+ let m = 0b10;
+ let r = _mm_maskz_load_epi64(m, black_box(p));
+ let e = _mm_setr_epi64x(0, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_storeu_epi64() {
+ let mut r = [42_i64; 2];
+ let a = _mm_setr_epi64x(1, 2);
+ let m = 0b10;
+ _mm_mask_storeu_epi64(r.as_mut_ptr(), m, a);
+ let e = _mm_setr_epi64x(42, 2);
+ assert_eq_m128i(_mm_loadu_epi64(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_store_epi64() {
+ #[repr(align(16))]
+ struct Align {
+ data: [i64; 2], // 16 bytes
+ }
+ let mut r = Align { data: [42; 2] };
+ let a = _mm_setr_epi64x(1, 2);
+ let m = 0b10;
+ _mm_mask_store_epi64(r.data.as_mut_ptr(), m, a);
+ let e = _mm_setr_epi64x(42, 2);
+ assert_eq_m128i(_mm_load_epi64(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_loadu_ps() {
+ let src = _mm_set1_ps(42.0);
+ let a = &[1.0_f32, 2.0, 3.0, 4.0];
+ let p = a.as_ptr();
+ let m = 0b1010;
+ let r = _mm_mask_loadu_ps(src, m, black_box(p));
+ let e = _mm_setr_ps(42.0, 2.0, 42.0, 4.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_loadu_ps() {
+ let a = &[1.0_f32, 2.0, 3.0, 4.0];
+ let p = a.as_ptr();
+ let m = 0b1010;
+ let r = _mm_maskz_loadu_ps(m, black_box(p));
+ let e = _mm_setr_ps(0.0, 2.0, 0.0, 4.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_load_ps() {
+ #[repr(align(16))]
+ struct Align {
+ data: [f32; 4], // 16 bytes
+ }
+ let src = _mm_set1_ps(42.0);
+ let a = Align {
+ data: [1.0_f32, 2.0, 3.0, 4.0],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b1010;
+ let r = _mm_mask_load_ps(src, m, black_box(p));
+ let e = _mm_setr_ps(42.0, 2.0, 42.0, 4.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_load_ps() {
+ #[repr(align(16))]
+ struct Align {
+ data: [f32; 4], // 16 bytes
+ }
+ let a = Align {
+ data: [1.0_f32, 2.0, 3.0, 4.0],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b1010;
+ let r = _mm_maskz_load_ps(m, black_box(p));
+ let e = _mm_setr_ps(0.0, 2.0, 0.0, 4.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_storeu_ps() {
+ let mut r = [42_f32; 4];
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let m = 0b1010;
+ _mm_mask_storeu_ps(r.as_mut_ptr(), m, a);
+ let e = _mm_setr_ps(42.0, 2.0, 42.0, 4.0);
+ assert_eq_m128(_mm_loadu_ps(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_store_ps() {
+ #[repr(align(16))]
+ struct Align {
+ data: [f32; 4], // 16 bytes
+ }
+ let mut r = Align { data: [42.0; 4] };
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let m = 0b1010;
+ _mm_mask_store_ps(r.data.as_mut_ptr(), m, a);
+ let e = _mm_setr_ps(42.0, 2.0, 42.0, 4.0);
+ assert_eq_m128(_mm_load_ps(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_loadu_pd() {
+ let src = _mm_set1_pd(42.0);
+ let a = &[1.0_f64, 2.0];
+ let p = a.as_ptr();
+ let m = 0b10;
+ let r = _mm_mask_loadu_pd(src, m, black_box(p));
+ let e = _mm_setr_pd(42.0, 2.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_loadu_pd() {
+ let a = &[1.0_f64, 2.0];
+ let p = a.as_ptr();
+ let m = 0b10;
+ let r = _mm_maskz_loadu_pd(m, black_box(p));
+ let e = _mm_setr_pd(0.0, 2.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_load_pd() {
+ #[repr(align(16))]
+ struct Align {
+ data: [f64; 2], // 16 bytes
+ }
+ let src = _mm_set1_pd(42.0);
+ let a = Align {
+ data: [1.0_f64, 2.0],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b10;
+ let r = _mm_mask_load_pd(src, m, black_box(p));
+ let e = _mm_setr_pd(42.0, 2.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_load_pd() {
+ #[repr(align(16))]
+ struct Align {
+ data: [f64; 2], // 16 bytes
+ }
+ let a = Align {
+ data: [1.0_f64, 2.0],
+ };
+ let p = a.data.as_ptr();
+ let m = 0b10;
+ let r = _mm_maskz_load_pd(m, black_box(p));
+ let e = _mm_setr_pd(0.0, 2.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_storeu_pd() {
+ let mut r = [42_f64; 2];
+ let a = _mm_setr_pd(1.0, 2.0);
+ let m = 0b10;
+ _mm_mask_storeu_pd(r.as_mut_ptr(), m, a);
+ let e = _mm_setr_pd(42.0, 2.0);
+ assert_eq_m128d(_mm_loadu_pd(r.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_store_pd() {
+ #[repr(align(16))]
+ struct Align {
+ data: [f64; 2], // 16 bytes
+ }
+ let mut r = Align { data: [42.0; 2] };
+ let a = _mm_setr_pd(1.0, 2.0);
+ let m = 0b10;
+ _mm_mask_store_pd(r.data.as_mut_ptr(), m, a);
+ let e = _mm_setr_pd(42.0, 2.0);
+ assert_eq_m128d(_mm_load_pd(r.data.as_ptr()), e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setr_pd() {
+ let r = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ assert_eq_m512d(r, _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set_pd() {
+ let r = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ assert_eq_m512d(r, _mm512_set_pd(7., 6., 5., 4., 3., 2., 1., 0.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_rol_epi32() {
+ let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm512_rol_epi32::<1>(a);
+ let e = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_rol_epi32() {
+ let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm512_mask_rol_epi32::<1>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_rol_epi32::<1>(a, 0b11111111_11111111, a);
+ let e = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_rol_epi32() {
+ let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 31);
+ let r = _mm512_maskz_rol_epi32::<1>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_rol_epi32::<1>(0b00000000_11111111, a);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 1 << 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_rol_epi32() {
+ let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm256_rol_epi32::<1>(a);
+ let e = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_rol_epi32() {
+ let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm256_mask_rol_epi32::<1>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_rol_epi32::<1>(a, 0b11111111, a);
+ let e = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_rol_epi32() {
+ let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm256_maskz_rol_epi32::<1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_rol_epi32::<1>(0b11111111, a);
+ let e = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_rol_epi32() {
+ let a = _mm_set_epi32(1 << 31, 1, 1, 1);
+ let r = _mm_rol_epi32::<1>(a);
+ let e = _mm_set_epi32(1 << 0, 2, 2, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_rol_epi32() {
+ let a = _mm_set_epi32(1 << 31, 1, 1, 1);
+ let r = _mm_mask_rol_epi32::<1>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_rol_epi32::<1>(a, 0b00001111, a);
+ let e = _mm_set_epi32(1 << 0, 2, 2, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_rol_epi32() {
+ let a = _mm_set_epi32(1 << 31, 1, 1, 1);
+ let r = _mm_maskz_rol_epi32::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_rol_epi32::<1>(0b00001111, a);
+ let e = _mm_set_epi32(1 << 0, 2, 2, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_ror_epi32() {
+ let a = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let r = _mm512_ror_epi32::<1>(a);
+ let e = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_ror_epi32() {
+ let a = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let r = _mm512_mask_ror_epi32::<1>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_ror_epi32::<1>(a, 0b11111111_11111111, a);
+ let e = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_ror_epi32() {
+ let a = _mm512_set_epi32(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 << 0);
+ let r = _mm512_maskz_ror_epi32::<1>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_ror_epi32::<1>(0b00000000_11111111, a);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 << 31);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_ror_epi32() {
+ let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ let r = _mm256_ror_epi32::<1>(a);
+ let e = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_ror_epi32() {
+ let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ let r = _mm256_mask_ror_epi32::<1>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_ror_epi32::<1>(a, 0b11111111, a);
+ let e = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_ror_epi32() {
+ let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ let r = _mm256_maskz_ror_epi32::<1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_ror_epi32::<1>(0b11111111, a);
+ let e = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_ror_epi32() {
+ let a = _mm_set_epi32(1 << 0, 2, 2, 2);
+ let r = _mm_ror_epi32::<1>(a);
+ let e = _mm_set_epi32(1 << 31, 1, 1, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_ror_epi32() {
+ let a = _mm_set_epi32(1 << 0, 2, 2, 2);
+ let r = _mm_mask_ror_epi32::<1>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_ror_epi32::<1>(a, 0b00001111, a);
+ let e = _mm_set_epi32(1 << 31, 1, 1, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_ror_epi32() {
+ let a = _mm_set_epi32(1 << 0, 2, 2, 2);
+ let r = _mm_maskz_ror_epi32::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_ror_epi32::<1>(0b00001111, a);
+ let e = _mm_set_epi32(1 << 31, 1, 1, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_slli_epi32() {
+ let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm512_slli_epi32::<1>(a);
+ let e = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_slli_epi32() {
+ let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm512_mask_slli_epi32::<1>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_slli_epi32::<1>(a, 0b11111111_11111111, a);
+ let e = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_slli_epi32() {
+ let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 31);
+ let r = _mm512_maskz_slli_epi32::<1>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_slli_epi32::<1>(0b00000000_11111111, a);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_slli_epi32() {
+ let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm256_mask_slli_epi32::<1>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_slli_epi32::<1>(a, 0b11111111, a);
+ let e = _mm256_set_epi32(0, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_slli_epi32() {
+ let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm256_maskz_slli_epi32::<1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_slli_epi32::<1>(0b11111111, a);
+ let e = _mm256_set_epi32(0, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_slli_epi32() {
+ let a = _mm_set_epi32(1 << 31, 1, 1, 1);
+ let r = _mm_mask_slli_epi32::<1>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_slli_epi32::<1>(a, 0b00001111, a);
+ let e = _mm_set_epi32(0, 2, 2, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_slli_epi32() {
+ let a = _mm_set_epi32(1 << 31, 1, 1, 1);
+ let r = _mm_maskz_slli_epi32::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_slli_epi32::<1>(0b00001111, a);
+ let e = _mm_set_epi32(0, 2, 2, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_srli_epi32() {
+ let a = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let r = _mm512_srli_epi32::<1>(a);
+ let e = _mm512_set_epi32(0 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_srli_epi32() {
+ let a = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let r = _mm512_mask_srli_epi32::<1>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_srli_epi32::<1>(a, 0b11111111_11111111, a);
+ let e = _mm512_set_epi32(0 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_srli_epi32() {
+ let a = _mm512_set_epi32(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0);
+ let r = _mm512_maskz_srli_epi32::<1>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_srli_epi32::<1>(0b00000000_11111111, a);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 << 31);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_srli_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm256_mask_srli_epi32::<1>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_srli_epi32::<1>(a, 0b11111111, a);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_srli_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm256_maskz_srli_epi32::<1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_srli_epi32::<1>(0b11111111, a);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_srli_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let r = _mm_mask_srli_epi32::<1>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_srli_epi32::<1>(a, 0b00001111, a);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_srli_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let r = _mm_maskz_srli_epi32::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_srli_epi32::<1>(0b00001111, a);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_rolv_epi32() {
+ let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_rolv_epi32(a, b);
+ let e = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_rolv_epi32() {
+ let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_mask_rolv_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_rolv_epi32(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_rolv_epi32() {
+ let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 31);
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_maskz_rolv_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_rolv_epi32(0b00000000_11111111, a, b);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 1 << 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_rolv_epi32() {
+ let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_rolv_epi32(a, b);
+ let e = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_rolv_epi32() {
+ let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_mask_rolv_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_rolv_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_rolv_epi32() {
+ let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_maskz_rolv_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_rolv_epi32(0b11111111, a, b);
+ let e = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_rolv_epi32() {
+ let a = _mm_set_epi32(1 << 31, 1, 1, 1);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_rolv_epi32(a, b);
+ let e = _mm_set_epi32(1 << 0, 2, 2, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_rolv_epi32() {
+ let a = _mm_set_epi32(1 << 31, 1, 1, 1);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_mask_rolv_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_rolv_epi32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(1 << 0, 2, 2, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_rolv_epi32() {
+ let a = _mm_set_epi32(1 << 31, 1, 1, 1);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_maskz_rolv_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_rolv_epi32(0b00001111, a, b);
+ let e = _mm_set_epi32(1 << 0, 2, 2, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_rorv_epi32() {
+ let a = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_rorv_epi32(a, b);
+ let e = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_rorv_epi32() {
+ let a = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_mask_rorv_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_rorv_epi32(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_rorv_epi32() {
+ let a = _mm512_set_epi32(3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 << 0);
+ let b = _mm512_set1_epi32(1);
+ let r = _mm512_maskz_rorv_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_rorv_epi32(0b00000000_11111111, a, b);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 << 31);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_rorv_epi32() {
+ let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_rorv_epi32(a, b);
+ let e = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_rorv_epi32() {
+ let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_mask_rorv_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_rorv_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_rorv_epi32() {
+ let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2);
+ let b = _mm256_set1_epi32(1);
+ let r = _mm256_maskz_rorv_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_rorv_epi32(0b11111111, a, b);
+ let e = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_rorv_epi32() {
+ let a = _mm_set_epi32(1 << 0, 2, 2, 2);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_rorv_epi32(a, b);
+ let e = _mm_set_epi32(1 << 31, 1, 1, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_rorv_epi32() {
+ let a = _mm_set_epi32(1 << 0, 2, 2, 2);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_mask_rorv_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_rorv_epi32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(1 << 31, 1, 1, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_rorv_epi32() {
+ let a = _mm_set_epi32(1 << 0, 2, 2, 2);
+ let b = _mm_set1_epi32(1);
+ let r = _mm_maskz_rorv_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_rorv_epi32(0b00001111, a, b);
+ let e = _mm_set_epi32(1 << 31, 1, 1, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sllv_epi32() {
+ let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let count = _mm512_set1_epi32(1);
+ let r = _mm512_sllv_epi32(a, count);
+ let e = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sllv_epi32() {
+ let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let count = _mm512_set1_epi32(1);
+ let r = _mm512_mask_sllv_epi32(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_sllv_epi32(a, 0b11111111_11111111, a, count);
+ let e = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sllv_epi32() {
+ let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 31);
+ let count = _mm512_set_epi32(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm512_maskz_sllv_epi32(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_sllv_epi32(0b00000000_11111111, a, count);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sllv_epi32() {
+ let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ let count = _mm256_set1_epi32(1);
+ let r = _mm256_mask_sllv_epi32(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_sllv_epi32(a, 0b11111111, a, count);
+ let e = _mm256_set_epi32(0, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sllv_epi32() {
+ let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1);
+ let count = _mm256_set1_epi32(1);
+ let r = _mm256_maskz_sllv_epi32(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_sllv_epi32(0b11111111, a, count);
+ let e = _mm256_set_epi32(0, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sllv_epi32() {
+ let a = _mm_set_epi32(1 << 31, 1, 1, 1);
+ let count = _mm_set1_epi32(1);
+ let r = _mm_mask_sllv_epi32(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_sllv_epi32(a, 0b00001111, a, count);
+ let e = _mm_set_epi32(0, 2, 2, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sllv_epi32() {
+ let a = _mm_set_epi32(1 << 31, 1, 1, 1);
+ let count = _mm_set1_epi32(1);
+ let r = _mm_maskz_sllv_epi32(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_sllv_epi32(0b00001111, a, count);
+ let e = _mm_set_epi32(0, 2, 2, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_srlv_epi32() {
+ let a = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let count = _mm512_set1_epi32(1);
+ let r = _mm512_srlv_epi32(a, count);
+ let e = _mm512_set_epi32(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_srlv_epi32() {
+ let a = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let count = _mm512_set1_epi32(1);
+ let r = _mm512_mask_srlv_epi32(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_srlv_epi32(a, 0b11111111_11111111, a, count);
+ let e = _mm512_set_epi32(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_srlv_epi32() {
+ let a = _mm512_set_epi32(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0);
+ let count = _mm512_set_epi32(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r = _mm512_maskz_srlv_epi32(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_srlv_epi32(0b00000000_11111111, a, count);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_srlv_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let count = _mm256_set1_epi32(1);
+ let r = _mm256_mask_srlv_epi32(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_srlv_epi32(a, 0b11111111, a, count);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_srlv_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let count = _mm256_set1_epi32(1);
+ let r = _mm256_maskz_srlv_epi32(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_srlv_epi32(0b11111111, a, count);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_srlv_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let count = _mm_set1_epi32(1);
+ let r = _mm_mask_srlv_epi32(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_srlv_epi32(a, 0b00001111, a, count);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_srlv_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let count = _mm_set1_epi32(1);
+ let r = _mm_maskz_srlv_epi32(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_srlv_epi32(0b00001111, a, count);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sll_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 31, 1 << 0, 1 << 1, 1 << 2,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ );
+ let count = _mm_set_epi32(0, 0, 0, 2);
+ let r = _mm512_sll_epi32(a, count);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 0, 1 << 2, 1 << 3, 1 << 4,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sll_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 31, 1 << 0, 1 << 1, 1 << 2,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ );
+ let count = _mm_set_epi32(0, 0, 0, 2);
+ let r = _mm512_mask_sll_epi32(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_sll_epi32(a, 0b11111111_11111111, a, count);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 0, 1 << 2, 1 << 3, 1 << 4,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sll_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 31, 1 << 0, 1 << 1, 1 << 2,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 31,
+ );
+ let count = _mm_set_epi32(2, 0, 0, 2);
+ let r = _mm512_maskz_sll_epi32(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_sll_epi32(0b00000000_11111111, a, count);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sll_epi32() {
+ let a = _mm256_set_epi32(1 << 13, 0, 0, 0, 0, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm256_mask_sll_epi32(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_sll_epi32(a, 0b11111111, a, count);
+ let e = _mm256_set_epi32(1 << 14, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sll_epi32() {
+ let a = _mm256_set_epi32(1 << 13, 0, 0, 0, 0, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm256_maskz_sll_epi32(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_sll_epi32(0b11111111, a, count);
+ let e = _mm256_set_epi32(1 << 14, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sll_epi32() {
+ let a = _mm_set_epi32(1 << 13, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm_mask_sll_epi32(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_sll_epi32(a, 0b00001111, a, count);
+ let e = _mm_set_epi32(1 << 14, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sll_epi32() {
+ let a = _mm_set_epi32(1 << 13, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm_maskz_sll_epi32(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_sll_epi32(0b00001111, a, count);
+ let e = _mm_set_epi32(1 << 14, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_srl_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 31, 1 << 0, 1 << 1, 1 << 2,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ );
+ let count = _mm_set_epi32(0, 0, 0, 2);
+ let r = _mm512_srl_epi32(a, count);
+ let e = _mm512_set_epi32(1 << 29, 0, 0, 1 << 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_srl_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 31, 1 << 0, 1 << 1, 1 << 2,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ );
+ let count = _mm_set_epi32(0, 0, 0, 2);
+ let r = _mm512_mask_srl_epi32(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_srl_epi32(a, 0b11111111_11111111, a, count);
+ let e = _mm512_set_epi32(1 << 29, 0, 0, 1 << 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_srl_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 31, 1 << 0, 1 << 1, 1 << 2,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 31,
+ );
+ let count = _mm_set_epi32(2, 0, 0, 2);
+ let r = _mm512_maskz_srl_epi32(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_srl_epi32(0b00000000_11111111, a, count);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 << 29);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_srl_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm256_mask_srl_epi32(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_srl_epi32(a, 0b11111111, a, count);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_srl_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm256_maskz_srl_epi32(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_srl_epi32(0b11111111, a, count);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_srl_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm_mask_srl_epi32(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_srl_epi32(a, 0b00001111, a, count);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_srl_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm_maskz_srl_epi32(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_srl_epi32(0b00001111, a, count);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sra_epi32() {
+ let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
+ let count = _mm_set_epi32(1, 0, 0, 2);
+ let r = _mm512_sra_epi32(a, count);
+ let e = _mm512_set_epi32(2, -2, 4, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sra_epi32() {
+ let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16);
+ let count = _mm_set_epi32(0, 0, 0, 2);
+ let r = _mm512_mask_sra_epi32(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_sra_epi32(a, 0b11111111_11111111, a, count);
+ let e = _mm512_set_epi32(2, -2, 4, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sra_epi32() {
+ let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -14);
+ let count = _mm_set_epi32(2, 0, 0, 2);
+ let r = _mm512_maskz_sra_epi32(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_sra_epi32(0b00000000_11111111, a, count);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sra_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm256_mask_sra_epi32(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_sra_epi32(a, 0b11111111, a, count);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sra_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm256_maskz_sra_epi32(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_sra_epi32(0b11111111, a, count);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sra_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm_mask_sra_epi32(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_sra_epi32(a, 0b00001111, a, count);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sra_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let count = _mm_set_epi32(0, 0, 0, 1);
+ let r = _mm_maskz_sra_epi32(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_sra_epi32(0b00001111, a, count);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_srav_epi32() {
+ let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
+ let count = _mm512_set_epi32(2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm512_srav_epi32(a, count);
+ let e = _mm512_set_epi32(2, -2, 4, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_srav_epi32() {
+ let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16);
+ let count = _mm512_set_epi32(2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
+ let r = _mm512_mask_srav_epi32(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_srav_epi32(a, 0b11111111_11111111, a, count);
+ let e = _mm512_set_epi32(2, -2, 4, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_srav_epi32() {
+ let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -14);
+ let count = _mm512_set_epi32(2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
+ let r = _mm512_maskz_srav_epi32(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_srav_epi32(0b00000000_11111111, a, count);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_srav_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let count = _mm256_set1_epi32(1);
+ let r = _mm256_mask_srav_epi32(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_srav_epi32(a, 0b11111111, a, count);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_srav_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let count = _mm256_set1_epi32(1);
+ let r = _mm256_maskz_srav_epi32(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_srav_epi32(0b11111111, a, count);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_srav_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let count = _mm_set1_epi32(1);
+ let r = _mm_mask_srav_epi32(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_srav_epi32(a, 0b00001111, a, count);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_srav_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let count = _mm_set1_epi32(1);
+ let r = _mm_maskz_srav_epi32(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_srav_epi32(0b00001111, a, count);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_srai_epi32() {
+ let a = _mm512_set_epi32(8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, -15);
+ let r = _mm512_srai_epi32::<2>(a);
+ let e = _mm512_set_epi32(2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_srai_epi32() {
+ let a = _mm512_set_epi32(8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, -15);
+ let r = _mm512_mask_srai_epi32::<2>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_srai_epi32::<2>(a, 0b11111111_11111111, a);
+ let e = _mm512_set_epi32(2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_srai_epi32() {
+ let a = _mm512_set_epi32(8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, -15);
+ let r = _mm512_maskz_srai_epi32::<2>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_srai_epi32::<2>(0b00000000_11111111, a);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_srai_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm256_mask_srai_epi32::<1>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_srai_epi32::<1>(a, 0b11111111, a);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_srai_epi32() {
+ let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm256_maskz_srai_epi32::<1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_srai_epi32::<1>(0b11111111, a);
+ let e = _mm256_set_epi32(1 << 4, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_srai_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let r = _mm_mask_srai_epi32::<1>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_srai_epi32::<1>(a, 0b00001111, a);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_srai_epi32() {
+ let a = _mm_set_epi32(1 << 5, 0, 0, 0);
+ let r = _mm_maskz_srai_epi32::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_srai_epi32::<1>(0b00001111, a);
+ let e = _mm_set_epi32(1 << 4, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permute_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let r = _mm512_permute_ps::<0b11_11_11_11>(a);
+ let e = _mm512_setr_ps(
+ 3., 3., 3., 3., 7., 7., 7., 7., 11., 11., 11., 11., 15., 15., 15., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permute_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let r = _mm512_mask_permute_ps::<0b11_11_11_11>(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_permute_ps::<0b11_11_11_11>(a, 0b11111111_11111111, a);
+ let e = _mm512_setr_ps(
+ 3., 3., 3., 3., 7., 7., 7., 7., 11., 11., 11., 11., 15., 15., 15., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permute_ps() {
+ let a = _mm512_setr_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let r = _mm512_maskz_permute_ps::<0b11_11_11_11>(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_permute_ps::<0b11_11_11_11>(0b11111111_11111111, a);
+ let e = _mm512_setr_ps(
+ 3., 3., 3., 3., 7., 7., 7., 7., 11., 11., 11., 11., 15., 15., 15., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permute_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm256_mask_permute_ps::<0b11_11_11_11>(a, 0, a);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_permute_ps::<0b11_11_11_11>(a, 0b11111111, a);
+ let e = _mm256_set_ps(0., 0., 0., 0., 4., 4., 4., 4.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permute_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm256_maskz_permute_ps::<0b11_11_11_11>(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_permute_ps::<0b11_11_11_11>(0b11111111, a);
+ let e = _mm256_set_ps(0., 0., 0., 0., 4., 4., 4., 4.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_permute_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let r = _mm_mask_permute_ps::<0b11_11_11_11>(a, 0, a);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_permute_ps::<0b11_11_11_11>(a, 0b00001111, a);
+ let e = _mm_set_ps(0., 0., 0., 0.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_permute_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let r = _mm_maskz_permute_ps::<0b11_11_11_11>(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_permute_ps::<0b11_11_11_11>(0b00001111, a);
+ let e = _mm_set_ps(0., 0., 0., 0.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutevar_epi32() {
+ let idx = _mm512_set1_epi32(1);
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_permutevar_epi32(idx, a);
+ let e = _mm512_set1_epi32(14);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutevar_epi32() {
+ let idx = _mm512_set1_epi32(1);
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_mask_permutevar_epi32(a, 0, idx, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_permutevar_epi32(a, 0b11111111_11111111, idx, a);
+ let e = _mm512_set1_epi32(14);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutevar_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_set1_epi32(0b01);
+ let r = _mm512_permutevar_ps(a, b);
+ let e = _mm512_set_ps(
+ 2., 2., 2., 2., 6., 6., 6., 6., 10., 10., 10., 10., 14., 14., 14., 14.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutevar_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_set1_epi32(0b01);
+ let r = _mm512_mask_permutevar_ps(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_permutevar_ps(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set_ps(
+ 2., 2., 2., 2., 6., 6., 6., 6., 10., 10., 10., 10., 14., 14., 14., 14.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutevar_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let b = _mm512_set1_epi32(0b01);
+ let r = _mm512_maskz_permutevar_ps(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_permutevar_ps(0b00000000_11111111, a, b);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 10., 10., 10., 10., 14., 14., 14., 14.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutevar_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm256_set1_epi32(0b01);
+ let r = _mm256_mask_permutevar_ps(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_permutevar_ps(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(2., 2., 2., 2., 6., 6., 6., 6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutevar_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm256_set1_epi32(0b01);
+ let r = _mm256_maskz_permutevar_ps(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_permutevar_ps(0b11111111, a, b);
+ let e = _mm256_set_ps(2., 2., 2., 2., 6., 6., 6., 6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_permutevar_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set1_epi32(0b01);
+ let r = _mm_mask_permutevar_ps(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_permutevar_ps(a, 0b00001111, a, b);
+ let e = _mm_set_ps(2., 2., 2., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_permutevar_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set1_epi32(0b01);
+ let r = _mm_maskz_permutevar_ps(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_permutevar_ps(0b00001111, a, b);
+ let e = _mm_set_ps(2., 2., 2., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutexvar_epi32() {
+ let idx = _mm512_set1_epi32(1);
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_permutexvar_epi32(idx, a);
+ let e = _mm512_set1_epi32(14);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutexvar_epi32() {
+ let idx = _mm512_set1_epi32(1);
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_mask_permutexvar_epi32(a, 0, idx, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_permutexvar_epi32(a, 0b11111111_11111111, idx, a);
+ let e = _mm512_set1_epi32(14);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutexvar_epi32() {
+ let idx = _mm512_set1_epi32(1);
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_permutexvar_epi32(0, idx, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_permutexvar_epi32(0b00000000_11111111, idx, a);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_permutexvar_epi32() {
+ let idx = _mm256_set1_epi32(1);
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_permutexvar_epi32(idx, a);
+ let e = _mm256_set1_epi32(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutexvar_epi32() {
+ let idx = _mm256_set1_epi32(1);
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_mask_permutexvar_epi32(a, 0, idx, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_permutexvar_epi32(a, 0b11111111, idx, a);
+ let e = _mm256_set1_epi32(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutexvar_epi32() {
+ let idx = _mm256_set1_epi32(1);
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_maskz_permutexvar_epi32(0, idx, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_permutexvar_epi32(0b11111111, idx, a);
+ let e = _mm256_set1_epi32(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutexvar_ps() {
+ let idx = _mm512_set1_epi32(1);
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let r = _mm512_permutexvar_ps(idx, a);
+ let e = _mm512_set1_ps(14.);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutexvar_ps() {
+ let idx = _mm512_set1_epi32(1);
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let r = _mm512_mask_permutexvar_ps(a, 0, idx, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_permutexvar_ps(a, 0b11111111_11111111, idx, a);
+ let e = _mm512_set1_ps(14.);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutexvar_ps() {
+ let idx = _mm512_set1_epi32(1);
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let r = _mm512_maskz_permutexvar_ps(0, idx, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_permutexvar_ps(0b00000000_11111111, idx, a);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 14., 14., 14., 14., 14., 14., 14., 14.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_permutexvar_ps() {
+ let idx = _mm256_set1_epi32(1);
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm256_permutexvar_ps(idx, a);
+ let e = _mm256_set1_ps(6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutexvar_ps() {
+ let idx = _mm256_set1_epi32(1);
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm256_mask_permutexvar_ps(a, 0, idx, a);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_permutexvar_ps(a, 0b11111111, idx, a);
+ let e = _mm256_set1_ps(6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutexvar_ps() {
+ let idx = _mm256_set1_epi32(1);
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm256_maskz_permutexvar_ps(0, idx, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_permutexvar_ps(0b11111111, idx, a);
+ let e = _mm256_set1_ps(6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutex2var_epi32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi32(
+ 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 = _mm512_set1_epi32(100);
+ let r = _mm512_permutex2var_epi32(a, idx, b);
+ let e = _mm512_set_epi32(
+ 14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutex2var_epi32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi32(
+ 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 = _mm512_set1_epi32(100);
+ let r = _mm512_mask_permutex2var_epi32(a, 0, idx, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_permutex2var_epi32(a, 0b11111111_11111111, idx, b);
+ let e = _mm512_set_epi32(
+ 14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutex2var_epi32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi32(
+ 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 = _mm512_set1_epi32(100);
+ let r = _mm512_maskz_permutex2var_epi32(0, a, idx, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_permutex2var_epi32(0b00000000_11111111, a, idx, b);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 10, 100, 9, 100, 8, 100, 7, 100);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask2_permutex2var_epi32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi32(
+ 1000, 1 << 4, 2000, 1 << 4,
+ 3000, 1 << 4, 4000, 1 << 4,
+ 5, 1 << 4, 6, 1 << 4,
+ 7, 1 << 4, 8, 1 << 4,
+ );
+ let b = _mm512_set1_epi32(100);
+ let r = _mm512_mask2_permutex2var_epi32(a, idx, 0, b);
+ assert_eq_m512i(r, idx);
+ let r = _mm512_mask2_permutex2var_epi32(a, idx, 0b00000000_11111111, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 1000, 1 << 4, 2000, 1 << 4,
+ 3000, 1 << 4, 4000, 1 << 4,
+ 10, 100, 9, 100,
+ 8, 100, 7, 100,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_permutex2var_epi32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm256_set1_epi32(100);
+ let r = _mm256_permutex2var_epi32(a, idx, b);
+ let e = _mm256_set_epi32(6, 100, 5, 100, 4, 100, 3, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutex2var_epi32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm256_set1_epi32(100);
+ let r = _mm256_mask_permutex2var_epi32(a, 0, idx, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_permutex2var_epi32(a, 0b11111111, idx, b);
+ let e = _mm256_set_epi32(6, 100, 5, 100, 4, 100, 3, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutex2var_epi32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm256_set1_epi32(100);
+ let r = _mm256_maskz_permutex2var_epi32(0, a, idx, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_permutex2var_epi32(0b11111111, a, idx, b);
+ let e = _mm256_set_epi32(6, 100, 5, 100, 4, 100, 3, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask2_permutex2var_epi32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm256_set1_epi32(100);
+ let r = _mm256_mask2_permutex2var_epi32(a, idx, 0, b);
+ assert_eq_m256i(r, idx);
+ let r = _mm256_mask2_permutex2var_epi32(a, idx, 0b11111111, b);
+ let e = _mm256_set_epi32(6, 100, 5, 100, 4, 100, 3, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_permutex2var_epi32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2);
+ let b = _mm_set1_epi32(100);
+ let r = _mm_permutex2var_epi32(a, idx, b);
+ let e = _mm_set_epi32(2, 100, 1, 100);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_permutex2var_epi32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2);
+ let b = _mm_set1_epi32(100);
+ let r = _mm_mask_permutex2var_epi32(a, 0, idx, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_permutex2var_epi32(a, 0b00001111, idx, b);
+ let e = _mm_set_epi32(2, 100, 1, 100);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_permutex2var_epi32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2);
+ let b = _mm_set1_epi32(100);
+ let r = _mm_maskz_permutex2var_epi32(0, a, idx, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_permutex2var_epi32(0b00001111, a, idx, b);
+ let e = _mm_set_epi32(2, 100, 1, 100);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask2_permutex2var_epi32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2);
+ let b = _mm_set1_epi32(100);
+ let r = _mm_mask2_permutex2var_epi32(a, idx, 0, b);
+ assert_eq_m128i(r, idx);
+ let r = _mm_mask2_permutex2var_epi32(a, idx, 0b00001111, b);
+ let e = _mm_set_epi32(2, 100, 1, 100);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutex2var_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi32(
+ 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 = _mm512_set1_ps(100.);
+ let r = _mm512_permutex2var_ps(a, idx, b);
+ let e = _mm512_set_ps(
+ 14., 100., 13., 100., 12., 100., 11., 100., 10., 100., 9., 100., 8., 100., 7., 100.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutex2var_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi32(
+ 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 = _mm512_set1_ps(100.);
+ let r = _mm512_mask_permutex2var_ps(a, 0, idx, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_permutex2var_ps(a, 0b11111111_11111111, idx, b);
+ let e = _mm512_set_ps(
+ 14., 100., 13., 100., 12., 100., 11., 100., 10., 100., 9., 100., 8., 100., 7., 100.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutex2var_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi32(
+ 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 = _mm512_set1_ps(100.);
+ let r = _mm512_maskz_permutex2var_ps(0, a, idx, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_permutex2var_ps(0b00000000_11111111, a, idx, b);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 10., 100., 9., 100., 8., 100., 7., 100.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask2_permutex2var_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi32(
+ 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 = _mm512_set1_ps(100.);
+ let r = _mm512_mask2_permutex2var_ps(a, idx, 0, b);
+ assert_eq_m512(r, _mm512_castsi512_ps(idx));
+ let r = _mm512_mask2_permutex2var_ps(a, idx, 0b11111111_11111111, b);
+ let e = _mm512_set_ps(
+ 14., 100., 13., 100., 12., 100., 11., 100., 10., 100., 9., 100., 8., 100., 7., 100.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_permutex2var_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm256_set1_ps(100.);
+ let r = _mm256_permutex2var_ps(a, idx, b);
+ let e = _mm256_set_ps(6., 100., 5., 100., 4., 100., 3., 100.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutex2var_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm256_set1_ps(100.);
+ let r = _mm256_mask_permutex2var_ps(a, 0, idx, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_permutex2var_ps(a, 0b11111111, idx, b);
+ let e = _mm256_set_ps(6., 100., 5., 100., 4., 100., 3., 100.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutex2var_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm256_set1_ps(100.);
+ let r = _mm256_maskz_permutex2var_ps(0, a, idx, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_permutex2var_ps(0b11111111, a, idx, b);
+ let e = _mm256_set_ps(6., 100., 5., 100., 4., 100., 3., 100.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask2_permutex2var_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm256_set1_ps(100.);
+ let r = _mm256_mask2_permutex2var_ps(a, idx, 0, b);
+ assert_eq_m256(r, _mm256_castsi256_ps(idx));
+ let r = _mm256_mask2_permutex2var_ps(a, idx, 0b11111111, b);
+ let e = _mm256_set_ps(6., 100., 5., 100., 4., 100., 3., 100.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_permutex2var_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2);
+ let b = _mm_set1_ps(100.);
+ let r = _mm_permutex2var_ps(a, idx, b);
+ let e = _mm_set_ps(2., 100., 1., 100.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_permutex2var_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2);
+ let b = _mm_set1_ps(100.);
+ let r = _mm_mask_permutex2var_ps(a, 0, idx, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_permutex2var_ps(a, 0b00001111, idx, b);
+ let e = _mm_set_ps(2., 100., 1., 100.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_permutex2var_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2);
+ let b = _mm_set1_ps(100.);
+ let r = _mm_maskz_permutex2var_ps(0, a, idx, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_permutex2var_ps(0b00001111, a, idx, b);
+ let e = _mm_set_ps(2., 100., 1., 100.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask2_permutex2var_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2);
+ let b = _mm_set1_ps(100.);
+ let r = _mm_mask2_permutex2var_ps(a, idx, 0, b);
+ assert_eq_m128(r, _mm_castsi128_ps(idx));
+ let r = _mm_mask2_permutex2var_ps(a, idx, 0b00001111, b);
+ let e = _mm_set_ps(2., 100., 1., 100.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_shuffle_epi32() {
+ let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16);
+ let r = _mm512_shuffle_epi32::<_MM_PERM_AADD>(a);
+ let e = _mm512_setr_epi32(8, 8, 1, 1, 16, 16, 9, 9, 8, 8, 1, 1, 16, 16, 9, 9);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_shuffle_epi32() {
+ let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16);
+ let r = _mm512_mask_shuffle_epi32::<_MM_PERM_AADD>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shuffle_epi32::<_MM_PERM_AADD>(a, 0b11111111_11111111, a);
+ let e = _mm512_setr_epi32(8, 8, 1, 1, 16, 16, 9, 9, 8, 8, 1, 1, 16, 16, 9, 9);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_shuffle_epi32() {
+ let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16);
+ let r = _mm512_maskz_shuffle_epi32::<_MM_PERM_AADD>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shuffle_epi32::<_MM_PERM_AADD>(0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(8, 8, 1, 1, 16, 16, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_shuffle_epi32() {
+ let a = _mm256_set_epi32(1, 4, 5, 8, 9, 12, 13, 16);
+ let r = _mm256_mask_shuffle_epi32::<_MM_PERM_AADD>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shuffle_epi32::<_MM_PERM_AADD>(a, 0b11111111, a);
+ let e = _mm256_set_epi32(8, 8, 1, 1, 16, 16, 9, 9);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_shuffle_epi32() {
+ let a = _mm256_set_epi32(1, 4, 5, 8, 9, 12, 13, 16);
+ let r = _mm256_maskz_shuffle_epi32::<_MM_PERM_AADD>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shuffle_epi32::<_MM_PERM_AADD>(0b11111111, a);
+ let e = _mm256_set_epi32(8, 8, 1, 1, 16, 16, 9, 9);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_shuffle_epi32() {
+ let a = _mm_set_epi32(1, 4, 5, 8);
+ let r = _mm_mask_shuffle_epi32::<_MM_PERM_AADD>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shuffle_epi32::<_MM_PERM_AADD>(a, 0b00001111, a);
+ let e = _mm_set_epi32(8, 8, 1, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_shuffle_epi32() {
+ let a = _mm_set_epi32(1, 4, 5, 8);
+ let r = _mm_maskz_shuffle_epi32::<_MM_PERM_AADD>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shuffle_epi32::<_MM_PERM_AADD>(0b00001111, a);
+ let e = _mm_set_epi32(8, 8, 1, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_shuffle_ps() {
+ let a = _mm512_setr_ps(
+ 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16.,
+ );
+ let b = _mm512_setr_ps(
+ 2., 3., 6., 7., 10., 11., 14., 15., 2., 3., 6., 7., 10., 11., 14., 15.,
+ );
+ let r = _mm512_shuffle_ps::<0b00_00_11_11>(a, b);
+ let e = _mm512_setr_ps(
+ 8., 8., 2., 2., 16., 16., 10., 10., 8., 8., 2., 2., 16., 16., 10., 10.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_shuffle_ps() {
+ let a = _mm512_setr_ps(
+ 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16.,
+ );
+ let b = _mm512_setr_ps(
+ 2., 3., 6., 7., 10., 11., 14., 15., 2., 3., 6., 7., 10., 11., 14., 15.,
+ );
+ let r = _mm512_mask_shuffle_ps::<0b00_00_11_11>(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_shuffle_ps::<0b00_00_11_11>(a, 0b11111111_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 8., 8., 2., 2., 16., 16., 10., 10., 8., 8., 2., 2., 16., 16., 10., 10.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_shuffle_ps() {
+ let a = _mm512_setr_ps(
+ 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16.,
+ );
+ let b = _mm512_setr_ps(
+ 2., 3., 6., 7., 10., 11., 14., 15., 2., 3., 6., 7., 10., 11., 14., 15.,
+ );
+ let r = _mm512_maskz_shuffle_ps::<0b00_00_11_11>(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_shuffle_ps::<0b00_00_11_11>(0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 8., 8., 2., 2., 16., 16., 10., 10., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_shuffle_ps() {
+ let a = _mm256_set_ps(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm256_set_ps(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm256_mask_shuffle_ps::<0b11_11_11_11>(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_shuffle_ps::<0b00_00_11_11>(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(7., 7., 1., 1., 15., 15., 9., 9.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_shuffle_ps() {
+ let a = _mm256_set_ps(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm256_set_ps(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm256_maskz_shuffle_ps::<0b11_11_11_11>(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_shuffle_ps::<0b00_00_11_11>(0b11111111, a, b);
+ let e = _mm256_set_ps(7., 7., 1., 1., 15., 15., 9., 9.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_shuffle_ps() {
+ let a = _mm_set_ps(1., 4., 5., 8.);
+ let b = _mm_set_ps(2., 3., 6., 7.);
+ let r = _mm_mask_shuffle_ps::<0b11_11_11_11>(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_shuffle_ps::<0b00_00_11_11>(a, 0b00001111, a, b);
+ let e = _mm_set_ps(7., 7., 1., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_shuffle_ps() {
+ let a = _mm_set_ps(1., 4., 5., 8.);
+ let b = _mm_set_ps(2., 3., 6., 7.);
+ let r = _mm_maskz_shuffle_ps::<0b11_11_11_11>(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_shuffle_ps::<0b00_00_11_11>(0b00001111, a, b);
+ let e = _mm_set_ps(7., 7., 1., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_shuffle_i32x4() {
+ let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm512_setr_epi32(2, 3, 6, 7, 10, 11, 14, 15, 2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm512_shuffle_i32x4::<0b00_00_00_00>(a, b);
+ let e = _mm512_setr_epi32(1, 4, 5, 8, 1, 4, 5, 8, 2, 3, 6, 7, 2, 3, 6, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_shuffle_i32x4() {
+ let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm512_setr_epi32(2, 3, 6, 7, 10, 11, 14, 15, 2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm512_mask_shuffle_i32x4::<0b00_00_00_00>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shuffle_i32x4::<0b00_00_00_00>(a, 0b11111111_11111111, a, b);
+ let e = _mm512_setr_epi32(1, 4, 5, 8, 1, 4, 5, 8, 2, 3, 6, 7, 2, 3, 6, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_shuffle_i32x4() {
+ let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm512_setr_epi32(2, 3, 6, 7, 10, 11, 14, 15, 2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm512_maskz_shuffle_i32x4::<0b00_00_00_00>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shuffle_i32x4::<0b00_00_00_00>(0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(1, 4, 5, 8, 1, 4, 5, 8, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_shuffle_i32x4() {
+ let a = _mm256_set_epi32(1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm256_set_epi32(2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm256_shuffle_i32x4::<0b00>(a, b);
+ let e = _mm256_set_epi32(10, 11, 14, 15, 9, 12, 13, 16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_shuffle_i32x4() {
+ let a = _mm256_set_epi32(1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm256_set_epi32(2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm256_mask_shuffle_i32x4::<0b00>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shuffle_i32x4::<0b00>(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(10, 11, 14, 15, 9, 12, 13, 16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_shuffle_i32x4() {
+ let a = _mm256_set_epi32(1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm256_set_epi32(2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm256_maskz_shuffle_i32x4::<0b00>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shuffle_i32x4::<0b00>(0b11111111, a, b);
+ let e = _mm256_set_epi32(10, 11, 14, 15, 9, 12, 13, 16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_shuffle_f32x4() {
+ let a = _mm512_setr_ps(
+ 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16.,
+ );
+ let b = _mm512_setr_ps(
+ 2., 3., 6., 7., 10., 11., 14., 15., 2., 3., 6., 7., 10., 11., 14., 15.,
+ );
+ let r = _mm512_shuffle_f32x4::<0b00_00_00_00>(a, b);
+ let e = _mm512_setr_ps(
+ 1., 4., 5., 8., 1., 4., 5., 8., 2., 3., 6., 7., 2., 3., 6., 7.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_shuffle_f32x4() {
+ let a = _mm512_setr_ps(
+ 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16.,
+ );
+ let b = _mm512_setr_ps(
+ 2., 3., 6., 7., 10., 11., 14., 15., 2., 3., 6., 7., 10., 11., 14., 15.,
+ );
+ let r = _mm512_mask_shuffle_f32x4::<0b00_00_00_00>(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_shuffle_f32x4::<0b00_00_00_00>(a, 0b11111111_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 1., 4., 5., 8., 1., 4., 5., 8., 2., 3., 6., 7., 2., 3., 6., 7.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_shuffle_f32x4() {
+ let a = _mm512_setr_ps(
+ 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16.,
+ );
+ let b = _mm512_setr_ps(
+ 2., 3., 6., 7., 10., 11., 14., 15., 2., 3., 6., 7., 10., 11., 14., 15.,
+ );
+ let r = _mm512_maskz_shuffle_f32x4::<0b00_00_00_00>(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_shuffle_f32x4::<0b00_00_00_00>(0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 1., 4., 5., 8., 1., 4., 5., 8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_shuffle_f32x4() {
+ let a = _mm256_set_ps(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm256_set_ps(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm256_shuffle_f32x4::<0b00>(a, b);
+ let e = _mm256_set_ps(10., 11., 14., 15., 9., 12., 13., 16.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_shuffle_f32x4() {
+ let a = _mm256_set_ps(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm256_set_ps(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm256_mask_shuffle_f32x4::<0b00>(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_shuffle_f32x4::<0b00>(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(10., 11., 14., 15., 9., 12., 13., 16.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_shuffle_f32x4() {
+ let a = _mm256_set_ps(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm256_set_ps(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm256_maskz_shuffle_f32x4::<0b00>(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_shuffle_f32x4::<0b00>(0b11111111, a, b);
+ let e = _mm256_set_ps(10., 11., 14., 15., 9., 12., 13., 16.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_extractf32x4_ps() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let r = _mm512_extractf32x4_ps::<1>(a);
+ let e = _mm_setr_ps(5., 6., 7., 8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_extractf32x4_ps() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let src = _mm_set1_ps(100.);
+ let r = _mm512_mask_extractf32x4_ps::<1>(src, 0, a);
+ assert_eq_m128(r, src);
+ let r = _mm512_mask_extractf32x4_ps::<1>(src, 0b11111111, a);
+ let e = _mm_setr_ps(5., 6., 7., 8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_extractf32x4_ps() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let r = _mm512_maskz_extractf32x4_ps::<1>(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm512_maskz_extractf32x4_ps::<1>(0b00000001, a);
+ let e = _mm_setr_ps(5., 0., 0., 0.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_extractf32x4_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_extractf32x4_ps::<1>(a);
+ let e = _mm_set_ps(1., 2., 3., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_extractf32x4_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let src = _mm_set1_ps(100.);
+ let r = _mm256_mask_extractf32x4_ps::<1>(src, 0, a);
+ assert_eq_m128(r, src);
+ let r = _mm256_mask_extractf32x4_ps::<1>(src, 0b00001111, a);
+ let e = _mm_set_ps(1., 2., 3., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_extractf32x4_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_maskz_extractf32x4_ps::<1>(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm256_maskz_extractf32x4_ps::<1>(0b00001111, a);
+ let e = _mm_set_ps(1., 2., 3., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_extracti32x4_epi32() {
+ let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm512_extracti32x4_epi32::<1>(a);
+ let e = _mm_setr_epi32(5, 6, 7, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_extracti32x4_epi32() {
+ let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let src = _mm_set1_epi32(100);
+ let r = _mm512_mask_extracti32x4_epi32::<1>(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm512_mask_extracti32x4_epi32::<1>(src, 0b11111111, a);
+ let e = _mm_setr_epi32(5, 6, 7, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm512_maskz_extracti32x4_epi32() {
+ let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm512_maskz_extracti32x4_epi32::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm512_maskz_extracti32x4_epi32::<1>(0b00000001, a);
+ let e = _mm_setr_epi32(5, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_extracti32x4_epi32() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_extracti32x4_epi32::<1>(a);
+ let e = _mm_set_epi32(1, 2, 3, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_extracti32x4_epi32() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let src = _mm_set1_epi32(100);
+ let r = _mm256_mask_extracti32x4_epi32::<1>(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_extracti32x4_epi32::<1>(src, 0b00001111, a);
+ let e = _mm_set_epi32(1, 2, 3, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_extracti32x4_epi32() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_maskz_extracti32x4_epi32::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_extracti32x4_epi32::<1>(0b00001111, a);
+ let e = _mm_set_epi32(1, 2, 3, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_moveldup_ps() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let r = _mm512_moveldup_ps(a);
+ let e = _mm512_setr_ps(
+ 1., 1., 3., 3., 5., 5., 7., 7., 9., 9., 11., 11., 13., 13., 15., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_moveldup_ps() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let r = _mm512_mask_moveldup_ps(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_moveldup_ps(a, 0b11111111_11111111, a);
+ let e = _mm512_setr_ps(
+ 1., 1., 3., 3., 5., 5., 7., 7., 9., 9., 11., 11., 13., 13., 15., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_moveldup_ps() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let r = _mm512_maskz_moveldup_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_moveldup_ps(0b00000000_11111111, a);
+ let e = _mm512_setr_ps(
+ 1., 1., 3., 3., 5., 5., 7., 7., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_moveldup_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_mask_moveldup_ps(a, 0, a);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_moveldup_ps(a, 0b11111111, a);
+ let e = _mm256_set_ps(2., 2., 4., 4., 6., 6., 8., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_moveldup_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_maskz_moveldup_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_moveldup_ps(0b11111111, a);
+ let e = _mm256_set_ps(2., 2., 4., 4., 6., 6., 8., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_moveldup_ps() {
+ let a = _mm_set_ps(1., 2., 3., 4.);
+ let r = _mm_mask_moveldup_ps(a, 0, a);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_moveldup_ps(a, 0b00001111, a);
+ let e = _mm_set_ps(2., 2., 4., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_moveldup_ps() {
+ let a = _mm_set_ps(1., 2., 3., 4.);
+ let r = _mm_maskz_moveldup_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_moveldup_ps(0b00001111, a);
+ let e = _mm_set_ps(2., 2., 4., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_movehdup_ps() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let r = _mm512_movehdup_ps(a);
+ let e = _mm512_setr_ps(
+ 2., 2., 4., 4., 6., 6., 8., 8., 10., 10., 12., 12., 14., 14., 16., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_movehdup_ps() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let r = _mm512_mask_movehdup_ps(a, 0, a);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_movehdup_ps(a, 0b11111111_11111111, a);
+ let e = _mm512_setr_ps(
+ 2., 2., 4., 4., 6., 6., 8., 8., 10., 10., 12., 12., 14., 14., 16., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_movehdup_ps() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let r = _mm512_maskz_movehdup_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_movehdup_ps(0b00000000_11111111, a);
+ let e = _mm512_setr_ps(
+ 2., 2., 4., 4., 6., 6., 8., 8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_movehdup_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_mask_movehdup_ps(a, 0, a);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_movehdup_ps(a, 0b11111111, a);
+ let e = _mm256_set_ps(1., 1., 3., 3., 5., 5., 7., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_movehdup_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm256_maskz_movehdup_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_movehdup_ps(0b11111111, a);
+ let e = _mm256_set_ps(1., 1., 3., 3., 5., 5., 7., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_movehdup_ps() {
+ let a = _mm_set_ps(1., 2., 3., 4.);
+ let r = _mm_mask_movehdup_ps(a, 0, a);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_movehdup_ps(a, 0b00001111, a);
+ let e = _mm_set_ps(1., 1., 3., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_movehdup_ps() {
+ let a = _mm_set_ps(1., 2., 3., 4.);
+ let r = _mm_maskz_movehdup_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_movehdup_ps(0b00001111, a);
+ let e = _mm_set_ps(1., 1., 3., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_inserti32x4() {
+ let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b = _mm_setr_epi32(17, 18, 19, 20);
+ let r = _mm512_inserti32x4::<0>(a, b);
+ let e = _mm512_setr_epi32(17, 18, 19, 20, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_inserti32x4() {
+ let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b = _mm_setr_epi32(17, 18, 19, 20);
+ let r = _mm512_mask_inserti32x4::<0>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_inserti32x4::<0>(a, 0b11111111_11111111, a, b);
+ let e = _mm512_setr_epi32(17, 18, 19, 20, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_inserti32x4() {
+ let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b = _mm_setr_epi32(17, 18, 19, 20);
+ let r = _mm512_maskz_inserti32x4::<0>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_inserti32x4::<0>(0b00000000_11111111, a, b);
+ let e = _mm512_setr_epi32(17, 18, 19, 20, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_inserti32x4() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm256_inserti32x4::<1>(a, b);
+ let e = _mm256_set_epi32(17, 18, 19, 20, 5, 6, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_inserti32x4() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm256_mask_inserti32x4::<0>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_inserti32x4::<1>(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(17, 18, 19, 20, 5, 6, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_inserti32x4() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm256_maskz_inserti32x4::<0>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_inserti32x4::<1>(0b11111111, a, b);
+ let e = _mm256_set_epi32(17, 18, 19, 20, 5, 6, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_insertf32x4() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let b = _mm_setr_ps(17., 18., 19., 20.);
+ let r = _mm512_insertf32x4::<0>(a, b);
+ let e = _mm512_setr_ps(
+ 17., 18., 19., 20., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_insertf32x4() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let b = _mm_setr_ps(17., 18., 19., 20.);
+ let r = _mm512_mask_insertf32x4::<0>(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_insertf32x4::<0>(a, 0b11111111_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 17., 18., 19., 20., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_insertf32x4() {
+ let a = _mm512_setr_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let b = _mm_setr_ps(17., 18., 19., 20.);
+ let r = _mm512_maskz_insertf32x4::<0>(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_insertf32x4::<0>(0b00000000_11111111, a, b);
+ let e = _mm512_setr_ps(
+ 17., 18., 19., 20., 5., 6., 7., 8., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_insertf32x4() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm256_insertf32x4::<1>(a, b);
+ let e = _mm256_set_ps(17., 18., 19., 20., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_insertf32x4() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm256_mask_insertf32x4::<0>(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_insertf32x4::<1>(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(17., 18., 19., 20., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_insertf32x4() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm256_maskz_insertf32x4::<0>(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_insertf32x4::<1>(0b11111111, a, b);
+ let e = _mm256_set_ps(17., 18., 19., 20., 5., 6., 7., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castps128_ps512() {
+ let a = _mm_setr_ps(17., 18., 19., 20.);
+ let r = _mm512_castps128_ps512(a);
+ let e = _mm512_setr_ps(
+ 17., 18., 19., 20., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castps256_ps512() {
+ let a = _mm256_setr_ps(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm512_castps256_ps512(a);
+ let e = _mm512_setr_ps(
+ 17., 18., 19., 20., 21., 22., 23., 24., -1., -1., -1., -1., -1., -1., -1., -1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_zextps128_ps512() {
+ let a = _mm_setr_ps(17., 18., 19., 20.);
+ let r = _mm512_zextps128_ps512(a);
+ let e = _mm512_setr_ps(
+ 17., 18., 19., 20., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_zextps256_ps512() {
+ let a = _mm256_setr_ps(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm512_zextps256_ps512(a);
+ let e = _mm512_setr_ps(
+ 17., 18., 19., 20., 21., 22., 23., 24., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castps512_ps128() {
+ let a = _mm512_setr_ps(
+ 17., 18., 19., 20., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
+ );
+ let r = _mm512_castps512_ps128(a);
+ let e = _mm_setr_ps(17., 18., 19., 20.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castps512_ps256() {
+ let a = _mm512_setr_ps(
+ 17., 18., 19., 20., 21., 22., 23., 24., -1., -1., -1., -1., -1., -1., -1., -1.,
+ );
+ let r = _mm512_castps512_ps256(a);
+ let e = _mm256_setr_ps(17., 18., 19., 20., 21., 22., 23., 24.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castps_pd() {
+ let a = _mm512_set1_ps(1.);
+ let r = _mm512_castps_pd(a);
+ let e = _mm512_set1_pd(0.007812501848093234);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castps_si512() {
+ let a = _mm512_set1_ps(1.);
+ let r = _mm512_castps_si512(a);
+ let e = _mm512_set1_epi32(1065353216);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_broadcastd_epi32() {
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm512_broadcastd_epi32(a);
+ let e = _mm512_set1_epi32(20);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_broadcastd_epi32() {
+ let src = _mm512_set1_epi32(20);
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm512_mask_broadcastd_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_broadcastd_epi32(src, 0b11111111_11111111, a);
+ let e = _mm512_set1_epi32(20);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_broadcastd_epi32() {
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm512_maskz_broadcastd_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_broadcastd_epi32(0b00000000_11111111, a);
+ let e = _mm512_setr_epi32(20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_broadcastd_epi32() {
+ let src = _mm256_set1_epi32(20);
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm256_mask_broadcastd_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_broadcastd_epi32(src, 0b11111111, a);
+ let e = _mm256_set1_epi32(20);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_broadcastd_epi32() {
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm256_maskz_broadcastd_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_broadcastd_epi32(0b11111111, a);
+ let e = _mm256_set1_epi32(20);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_broadcastd_epi32() {
+ let src = _mm_set1_epi32(20);
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm_mask_broadcastd_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_broadcastd_epi32(src, 0b00001111, a);
+ let e = _mm_set1_epi32(20);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_broadcastd_epi32() {
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm_maskz_broadcastd_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_broadcastd_epi32(0b00001111, a);
+ let e = _mm_set1_epi32(20);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_broadcastss_ps() {
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm512_broadcastss_ps(a);
+ let e = _mm512_set1_ps(20.);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_broadcastss_ps() {
+ let src = _mm512_set1_ps(20.);
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm512_mask_broadcastss_ps(src, 0, a);
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_broadcastss_ps(src, 0b11111111_11111111, a);
+ let e = _mm512_set1_ps(20.);
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_broadcastss_ps() {
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm512_maskz_broadcastss_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_broadcastss_ps(0b00000000_11111111, a);
+ let e = _mm512_setr_ps(
+ 20., 20., 20., 20., 20., 20., 20., 20., 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_broadcastss_ps() {
+ let src = _mm256_set1_ps(20.);
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm256_mask_broadcastss_ps(src, 0, a);
+ assert_eq_m256(r, src);
+ let r = _mm256_mask_broadcastss_ps(src, 0b11111111, a);
+ let e = _mm256_set1_ps(20.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_broadcastss_ps() {
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm256_maskz_broadcastss_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_broadcastss_ps(0b11111111, a);
+ let e = _mm256_set1_ps(20.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_broadcastss_ps() {
+ let src = _mm_set1_ps(20.);
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm_mask_broadcastss_ps(src, 0, a);
+ assert_eq_m128(r, src);
+ let r = _mm_mask_broadcastss_ps(src, 0b00001111, a);
+ let e = _mm_set1_ps(20.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_broadcastss_ps() {
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm_maskz_broadcastss_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_broadcastss_ps(0b00001111, a);
+ let e = _mm_set1_ps(20.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_broadcast_i32x4() {
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm512_broadcast_i32x4(a);
+ let e = _mm512_set_epi32(
+ 17, 18, 19, 20, 17, 18, 19, 20, 17, 18, 19, 20, 17, 18, 19, 20,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_broadcast_i32x4() {
+ let src = _mm512_set1_epi32(20);
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm512_mask_broadcast_i32x4(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_broadcast_i32x4(src, 0b11111111_11111111, a);
+ let e = _mm512_set_epi32(
+ 17, 18, 19, 20, 17, 18, 19, 20, 17, 18, 19, 20, 17, 18, 19, 20,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_broadcast_i32x4() {
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm512_maskz_broadcast_i32x4(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_broadcast_i32x4(0b00000000_11111111, a);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 17, 18, 19, 20, 17, 18, 19, 20);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_broadcast_i32x4() {
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm256_broadcast_i32x4(a);
+ let e = _mm256_set_epi32(17, 18, 19, 20, 17, 18, 19, 20);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_broadcast_i32x4() {
+ let src = _mm256_set1_epi32(20);
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm256_mask_broadcast_i32x4(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_broadcast_i32x4(src, 0b11111111, a);
+ let e = _mm256_set_epi32(17, 18, 19, 20, 17, 18, 19, 20);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_broadcast_i32x4() {
+ let a = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm256_maskz_broadcast_i32x4(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_broadcast_i32x4(0b11111111, a);
+ let e = _mm256_set_epi32(17, 18, 19, 20, 17, 18, 19, 20);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_broadcast_f32x4() {
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm512_broadcast_f32x4(a);
+ let e = _mm512_set_ps(
+ 17., 18., 19., 20., 17., 18., 19., 20., 17., 18., 19., 20., 17., 18., 19., 20.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_broadcast_f32x4() {
+ let src = _mm512_set1_ps(20.);
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm512_mask_broadcast_f32x4(src, 0, a);
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_broadcast_f32x4(src, 0b11111111_11111111, a);
+ let e = _mm512_set_ps(
+ 17., 18., 19., 20., 17., 18., 19., 20., 17., 18., 19., 20., 17., 18., 19., 20.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_broadcast_f32x4() {
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm512_maskz_broadcast_f32x4(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_broadcast_f32x4(0b00000000_11111111, a);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 17., 18., 19., 20., 17., 18., 19., 20.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_broadcast_f32x4() {
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm256_broadcast_f32x4(a);
+ let e = _mm256_set_ps(17., 18., 19., 20., 17., 18., 19., 20.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_broadcast_f32x4() {
+ let src = _mm256_set1_ps(20.);
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm256_mask_broadcast_f32x4(src, 0, a);
+ assert_eq_m256(r, src);
+ let r = _mm256_mask_broadcast_f32x4(src, 0b11111111, a);
+ let e = _mm256_set_ps(17., 18., 19., 20., 17., 18., 19., 20.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_broadcast_f32x4() {
+ let a = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm256_maskz_broadcast_f32x4(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_broadcast_f32x4(0b11111111, a);
+ let e = _mm256_set_ps(17., 18., 19., 20., 17., 18., 19., 20.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_blend_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_set1_epi32(2);
+ let r = _mm512_mask_blend_epi32(0b11111111_00000000, a, b);
+ let e = _mm512_set_epi32(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_blend_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set1_epi32(2);
+ let r = _mm256_mask_blend_epi32(0b11111111, a, b);
+ let e = _mm256_set1_epi32(2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_blend_epi32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set1_epi32(2);
+ let r = _mm_mask_blend_epi32(0b00001111, a, b);
+ let e = _mm_set1_epi32(2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_blend_ps() {
+ let a = _mm512_set1_ps(1.);
+ let b = _mm512_set1_ps(2.);
+ let r = _mm512_mask_blend_ps(0b11111111_00000000, a, b);
+ let e = _mm512_set_ps(
+ 2., 2., 2., 2., 2., 2., 2., 2., 1., 1., 1., 1., 1., 1., 1., 1.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_blend_ps() {
+ let a = _mm256_set1_ps(1.);
+ let b = _mm256_set1_ps(2.);
+ let r = _mm256_mask_blend_ps(0b11111111, a, b);
+ let e = _mm256_set1_ps(2.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_blend_ps() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let r = _mm_mask_blend_ps(0b00001111, a, b);
+ let e = _mm_set1_ps(2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_unpackhi_epi32() {
+ let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b = _mm512_set_epi32(
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ );
+ let r = _mm512_unpackhi_epi32(a, b);
+ let e = _mm512_set_epi32(17, 1, 18, 2, 21, 5, 22, 6, 25, 9, 26, 10, 29, 13, 30, 14);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_unpackhi_epi32() {
+ let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b = _mm512_set_epi32(
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ );
+ let r = _mm512_mask_unpackhi_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_unpackhi_epi32(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set_epi32(17, 1, 18, 2, 21, 5, 22, 6, 25, 9, 26, 10, 29, 13, 30, 14);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_unpackhi_epi32() {
+ let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b = _mm512_set_epi32(
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ );
+ let r = _mm512_maskz_unpackhi_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_unpackhi_epi32(0b00000000_11111111, a, b);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 25, 9, 26, 10, 29, 13, 30, 14);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_unpackhi_epi32() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24);
+ let r = _mm256_mask_unpackhi_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_unpackhi_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(17, 1, 18, 2, 21, 5, 22, 6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_unpackhi_epi32() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24);
+ let r = _mm256_maskz_unpackhi_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_unpackhi_epi32(0b11111111, a, b);
+ let e = _mm256_set_epi32(17, 1, 18, 2, 21, 5, 22, 6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_unpackhi_epi32() {
+ let a = _mm_set_epi32(1, 2, 3, 4);
+ let b = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm_mask_unpackhi_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_unpackhi_epi32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(17, 1, 18, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_unpackhi_epi32() {
+ let a = _mm_set_epi32(1, 2, 3, 4);
+ let b = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm_maskz_unpackhi_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_unpackhi_epi32(0b00001111, a, b);
+ let e = _mm_set_epi32(17, 1, 18, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_unpackhi_ps() {
+ let a = _mm512_set_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let b = _mm512_set_ps(
+ 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32.,
+ );
+ let r = _mm512_unpackhi_ps(a, b);
+ let e = _mm512_set_ps(
+ 17., 1., 18., 2., 21., 5., 22., 6., 25., 9., 26., 10., 29., 13., 30., 14.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_unpackhi_ps() {
+ let a = _mm512_set_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let b = _mm512_set_ps(
+ 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32.,
+ );
+ let r = _mm512_mask_unpackhi_ps(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_unpackhi_ps(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set_ps(
+ 17., 1., 18., 2., 21., 5., 22., 6., 25., 9., 26., 10., 29., 13., 30., 14.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_unpackhi_ps() {
+ let a = _mm512_set_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let b = _mm512_set_ps(
+ 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32.,
+ );
+ let r = _mm512_maskz_unpackhi_ps(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_unpackhi_ps(0b00000000_11111111, a, b);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 25., 9., 26., 10., 29., 13., 30., 14.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_unpackhi_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_set_ps(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm256_mask_unpackhi_ps(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_unpackhi_ps(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(17., 1., 18., 2., 21., 5., 22., 6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_unpackhi_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_set_ps(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm256_maskz_unpackhi_ps(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_unpackhi_ps(0b11111111, a, b);
+ let e = _mm256_set_ps(17., 1., 18., 2., 21., 5., 22., 6.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_unpackhi_ps() {
+ let a = _mm_set_ps(1., 2., 3., 4.);
+ let b = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm_mask_unpackhi_ps(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_unpackhi_ps(a, 0b00001111, a, b);
+ let e = _mm_set_ps(17., 1., 18., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_unpackhi_ps() {
+ let a = _mm_set_ps(1., 2., 3., 4.);
+ let b = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm_maskz_unpackhi_ps(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_unpackhi_ps(0b00001111, a, b);
+ let e = _mm_set_ps(17., 1., 18., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_unpacklo_epi32() {
+ let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b = _mm512_set_epi32(
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ );
+ let r = _mm512_unpacklo_epi32(a, b);
+ let e = _mm512_set_epi32(19, 3, 20, 4, 23, 7, 24, 8, 27, 11, 28, 12, 31, 15, 32, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_unpacklo_epi32() {
+ let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b = _mm512_set_epi32(
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ );
+ let r = _mm512_mask_unpacklo_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_unpacklo_epi32(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set_epi32(19, 3, 20, 4, 23, 7, 24, 8, 27, 11, 28, 12, 31, 15, 32, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_unpacklo_epi32() {
+ let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b = _mm512_set_epi32(
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ );
+ let r = _mm512_maskz_unpacklo_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_unpacklo_epi32(0b00000000_11111111, a, b);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 27, 11, 28, 12, 31, 15, 32, 16);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_unpacklo_epi32() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24);
+ let r = _mm256_mask_unpacklo_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_unpacklo_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(19, 3, 20, 4, 23, 7, 24, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_unpacklo_epi32() {
+ let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24);
+ let r = _mm256_maskz_unpacklo_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_unpacklo_epi32(0b11111111, a, b);
+ let e = _mm256_set_epi32(19, 3, 20, 4, 23, 7, 24, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_unpacklo_epi32() {
+ let a = _mm_set_epi32(1, 2, 3, 4);
+ let b = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm_mask_unpacklo_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_unpacklo_epi32(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(19, 3, 20, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_unpacklo_epi32() {
+ let a = _mm_set_epi32(1, 2, 3, 4);
+ let b = _mm_set_epi32(17, 18, 19, 20);
+ let r = _mm_maskz_unpacklo_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_unpacklo_epi32(0b00001111, a, b);
+ let e = _mm_set_epi32(19, 3, 20, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_unpacklo_ps() {
+ let a = _mm512_set_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let b = _mm512_set_ps(
+ 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32.,
+ );
+ let r = _mm512_unpacklo_ps(a, b);
+ let e = _mm512_set_ps(
+ 19., 3., 20., 4., 23., 7., 24., 8., 27., 11., 28., 12., 31., 15., 32., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_unpacklo_ps() {
+ let a = _mm512_set_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let b = _mm512_set_ps(
+ 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32.,
+ );
+ let r = _mm512_mask_unpacklo_ps(a, 0, a, b);
+ assert_eq_m512(r, a);
+ let r = _mm512_mask_unpacklo_ps(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set_ps(
+ 19., 3., 20., 4., 23., 7., 24., 8., 27., 11., 28., 12., 31., 15., 32., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_unpacklo_ps() {
+ let a = _mm512_set_ps(
+ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.,
+ );
+ let b = _mm512_set_ps(
+ 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32.,
+ );
+ let r = _mm512_maskz_unpacklo_ps(0, a, b);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_unpacklo_ps(0b00000000_11111111, a, b);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 27., 11., 28., 12., 31., 15., 32., 16.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_unpacklo_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_set_ps(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm256_mask_unpacklo_ps(a, 0, a, b);
+ assert_eq_m256(r, a);
+ let r = _mm256_mask_unpacklo_ps(a, 0b11111111, a, b);
+ let e = _mm256_set_ps(19., 3., 20., 4., 23., 7., 24., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_unpacklo_ps() {
+ let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_set_ps(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm256_maskz_unpacklo_ps(0, a, b);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_unpacklo_ps(0b11111111, a, b);
+ let e = _mm256_set_ps(19., 3., 20., 4., 23., 7., 24., 8.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_unpacklo_ps() {
+ let a = _mm_set_ps(1., 2., 3., 4.);
+ let b = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm_mask_unpacklo_ps(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_unpacklo_ps(a, 0b00001111, a, b);
+ let e = _mm_set_ps(19., 3., 20., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_unpacklo_ps() {
+ let a = _mm_set_ps(1., 2., 3., 4.);
+ let b = _mm_set_ps(17., 18., 19., 20.);
+ let r = _mm_maskz_unpacklo_ps(0, a, b);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_unpacklo_ps(0b00001111, a, b);
+ let e = _mm_set_ps(19., 3., 20., 4.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_alignr_epi32() {
+ let a = _mm512_set_epi32(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let b = _mm512_set_epi32(
+ 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
+ );
+ let r = _mm512_alignr_epi32::<0>(a, b);
+ assert_eq_m512i(r, b);
+ let r = _mm512_alignr_epi32::<16>(a, b);
+ assert_eq_m512i(r, b);
+ let r = _mm512_alignr_epi32::<1>(a, b);
+ let e = _mm512_set_epi32(
+ 1, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_alignr_epi32() {
+ let a = _mm512_set_epi32(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let b = _mm512_set_epi32(
+ 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
+ );
+ let r = _mm512_mask_alignr_epi32::<1>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_alignr_epi32::<1>(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set_epi32(
+ 1, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_alignr_epi32() {
+ let a = _mm512_set_epi32(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let b = _mm512_set_epi32(
+ 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
+ );
+ let r = _mm512_maskz_alignr_epi32::<1>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_alignr_epi32::<1>(0b00000000_11111111, a, b);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 25, 24, 23, 22, 21, 20, 19, 18);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_alignr_epi32() {
+ let a = _mm256_set_epi32(8, 7, 6, 5, 4, 3, 2, 1);
+ let b = _mm256_set_epi32(16, 15, 14, 13, 12, 11, 10, 9);
+ let r = _mm256_alignr_epi32::<0>(a, b);
+ assert_eq_m256i(r, b);
+ let r = _mm256_alignr_epi32::<1>(a, b);
+ let e = _mm256_set_epi32(1, 16, 15, 14, 13, 12, 11, 10);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_alignr_epi32() {
+ let a = _mm256_set_epi32(8, 7, 6, 5, 4, 3, 2, 1);
+ let b = _mm256_set_epi32(16, 15, 14, 13, 12, 11, 10, 9);
+ let r = _mm256_mask_alignr_epi32::<1>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_alignr_epi32::<1>(a, 0b11111111, a, b);
+ let e = _mm256_set_epi32(1, 16, 15, 14, 13, 12, 11, 10);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_alignr_epi32() {
+ let a = _mm256_set_epi32(8, 7, 6, 5, 4, 3, 2, 1);
+ let b = _mm256_set_epi32(16, 15, 14, 13, 12, 11, 10, 9);
+ let r = _mm256_maskz_alignr_epi32::<1>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_alignr_epi32::<1>(0b11111111, a, b);
+ let e = _mm256_set_epi32(1, 16, 15, 14, 13, 12, 11, 10);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_alignr_epi32() {
+ let a = _mm_set_epi32(4, 3, 2, 1);
+ let b = _mm_set_epi32(8, 7, 6, 5);
+ let r = _mm_alignr_epi32::<0>(a, b);
+ assert_eq_m128i(r, b);
+ let r = _mm_alignr_epi32::<1>(a, b);
+ let e = _mm_set_epi32(1, 8, 7, 6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_alignr_epi32() {
+ let a = _mm_set_epi32(4, 3, 2, 1);
+ let b = _mm_set_epi32(8, 7, 6, 5);
+ let r = _mm_mask_alignr_epi32::<1>(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_alignr_epi32::<1>(a, 0b00001111, a, b);
+ let e = _mm_set_epi32(1, 8, 7, 6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_alignr_epi32() {
+ let a = _mm_set_epi32(4, 3, 2, 1);
+ let b = _mm_set_epi32(8, 7, 6, 5);
+ let r = _mm_maskz_alignr_epi32::<1>(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_alignr_epi32::<1>(0b00001111, a, b);
+ let e = _mm_set_epi32(1, 8, 7, 6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_and_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_and_epi32(a, b);
+ let e = _mm512_set_epi32(1 << 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 << 3);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_and_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_mask_and_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_and_epi32(a, 0b01111111_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_and_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_maskz_and_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_and_epi32(0b00000000_11111111, a, b);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 << 3);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_and_epi32() {
+ let a = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi32(1 << 1);
+ let r = _mm256_mask_and_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_and_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set1_epi32(1 << 1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_and_epi32() {
+ let a = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi32(1 << 1);
+ let r = _mm256_maskz_and_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_and_epi32(0b11111111, a, b);
+ let e = _mm256_set1_epi32(1 << 1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_and_epi32() {
+ let a = _mm_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi32(1 << 1);
+ let r = _mm_mask_and_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_and_epi32(a, 0b00001111, a, b);
+ let e = _mm_set1_epi32(1 << 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_and_epi32() {
+ let a = _mm_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi32(1 << 1);
+ let r = _mm_maskz_and_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_and_epi32(0b00001111, a, b);
+ let e = _mm_set1_epi32(1 << 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_and_si512() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_and_epi32(a, b);
+ let e = _mm512_set_epi32(1 << 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 << 3);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_or_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_or_epi32(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3 | 1 << 4,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_or_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_mask_or_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_or_epi32(a, 0b11111111_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3 | 1 << 4,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_or_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_maskz_or_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_or_epi32(0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3 | 1 << 4,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_or_epi32() {
+ let a = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi32(1 << 1);
+ let r = _mm256_or_epi32(a, b);
+ let e = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_or_epi32() {
+ let a = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi32(1 << 1);
+ let r = _mm256_mask_or_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_or_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_or_epi32() {
+ let a = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi32(1 << 1);
+ let r = _mm256_maskz_or_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_or_epi32(0b11111111, a, b);
+ let e = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_or_epi32() {
+ let a = _mm_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi32(1 << 1);
+ let r = _mm_or_epi32(a, b);
+ let e = _mm_set1_epi32(1 << 1 | 1 << 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_or_epi32() {
+ let a = _mm_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi32(1 << 1);
+ let r = _mm_mask_or_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_or_epi32(a, 0b00001111, a, b);
+ let e = _mm_set1_epi32(1 << 1 | 1 << 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_or_epi32() {
+ let a = _mm_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi32(1 << 1);
+ let r = _mm_maskz_or_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_or_epi32(0b00001111, a, b);
+ let e = _mm_set1_epi32(1 << 1 | 1 << 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_or_si512() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_or_epi32(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3 | 1 << 4,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_xor_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_xor_epi32(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 4,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_xor_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_mask_xor_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_xor_epi32(a, 0b01111111_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 4,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_xor_epi32() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_maskz_xor_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_xor_epi32(0b00000000_11111111, a, b);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_xor_epi32() {
+ let a = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi32(1 << 1);
+ let r = _mm256_xor_epi32(a, b);
+ let e = _mm256_set1_epi32(1 << 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_xor_epi32() {
+ let a = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi32(1 << 1);
+ let r = _mm256_mask_xor_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_xor_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set1_epi32(1 << 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_xor_epi32() {
+ let a = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi32(1 << 1);
+ let r = _mm256_maskz_xor_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_xor_epi32(0b11111111, a, b);
+ let e = _mm256_set1_epi32(1 << 2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_xor_epi32() {
+ let a = _mm_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi32(1 << 1);
+ let r = _mm_xor_epi32(a, b);
+ let e = _mm_set1_epi32(1 << 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_xor_epi32() {
+ let a = _mm_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi32(1 << 1);
+ let r = _mm_mask_xor_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_xor_epi32(a, 0b00001111, a, b);
+ let e = _mm_set1_epi32(1 << 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_xor_epi32() {
+ let a = _mm_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi32(1 << 1);
+ let r = _mm_maskz_xor_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_xor_epi32(0b00001111, a, b);
+ let e = _mm_set1_epi32(1 << 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_xor_si512() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi32(
+ 1 << 1 | 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 3,
+ );
+ #[rustfmt::skip]
+ let b = _mm512_set_epi32(
+ 1 << 1, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 3 | 1 << 4,
+ );
+ let r = _mm512_xor_epi32(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 1 << 2, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 4,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_andnot_epi32() {
+ let a = _mm512_set1_epi32(0);
+ let b = _mm512_set1_epi32(1 << 3 | 1 << 4);
+ let r = _mm512_andnot_epi32(a, b);
+ let e = _mm512_set1_epi32(1 << 3 | 1 << 4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_andnot_epi32() {
+ let a = _mm512_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm512_set1_epi32(1 << 3 | 1 << 4);
+ let r = _mm512_mask_andnot_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_andnot_epi32(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set1_epi32(1 << 3 | 1 << 4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_andnot_epi32() {
+ let a = _mm512_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm512_set1_epi32(1 << 3 | 1 << 4);
+ let r = _mm512_maskz_andnot_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_andnot_epi32(0b00000000_11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi32(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 1 << 3 | 1 << 4, 1 << 3 | 1 << 4, 1 << 3 | 1 << 4, 1 << 3 | 1 << 4,
+ 1 << 3 | 1 << 4, 1 << 3 | 1 << 4, 1 << 3 | 1 << 4, 1 << 3 | 1 << 4,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_andnot_epi32() {
+ let a = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi32(1 << 3 | 1 << 4);
+ let r = _mm256_mask_andnot_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_andnot_epi32(a, 0b11111111, a, b);
+ let e = _mm256_set1_epi32(1 << 3 | 1 << 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_andnot_epi32() {
+ let a = _mm256_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi32(1 << 3 | 1 << 4);
+ let r = _mm256_maskz_andnot_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_andnot_epi32(0b11111111, a, b);
+ let e = _mm256_set1_epi32(1 << 3 | 1 << 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_andnot_epi32() {
+ let a = _mm_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi32(1 << 3 | 1 << 4);
+ let r = _mm_mask_andnot_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_andnot_epi32(a, 0b00001111, a, b);
+ let e = _mm_set1_epi32(1 << 3 | 1 << 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_andnot_epi32() {
+ let a = _mm_set1_epi32(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi32(1 << 3 | 1 << 4);
+ let r = _mm_maskz_andnot_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_andnot_epi32(0b00001111, a, b);
+ let e = _mm_set1_epi32(1 << 3 | 1 << 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_kand() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b11001100_00110011;
+ let r = _mm512_kand(a, b);
+ let e: u16 = 0b11001100_00110011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_kand_mask16() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b11001100_00110011;
+ let r = _kand_mask16(a, b);
+ let e: u16 = 0b11001100_00110011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_kor() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b00101110_00001011;
+ let r = _mm512_kor(a, b);
+ let e: u16 = 0b11101110_00111011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_kor_mask16() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b00101110_00001011;
+ let r = _kor_mask16(a, b);
+ let e: u16 = 0b11101110_00111011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_kxor() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b00101110_00001011;
+ let r = _mm512_kxor(a, b);
+ let e: u16 = 0b11100010_00111000;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_kxor_mask16() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b00101110_00001011;
+ let r = _kxor_mask16(a, b);
+ let e: u16 = 0b11100010_00111000;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_knot() {
+ let a: u16 = 0b11001100_00110011;
+ let r = _mm512_knot(a);
+ let e: u16 = 0b00110011_11001100;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_knot_mask16() {
+ let a: u16 = 0b11001100_00110011;
+ let r = _knot_mask16(a);
+ let e: u16 = 0b00110011_11001100;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_kandn() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b00101110_00001011;
+ let r = _mm512_kandn(a, b);
+ let e: u16 = 0b00100010_00001000;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_kandn_mask16() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b00101110_00001011;
+ let r = _kandn_mask16(a, b);
+ let e: u16 = 0b00100010_00001000;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_kxnor() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b00101110_00001011;
+ let r = _mm512_kxnor(a, b);
+ let e: u16 = 0b00011101_11000111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_kxnor_mask16() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b00101110_00001011;
+ let r = _kxnor_mask16(a, b);
+ let e: u16 = 0b00011101_11000111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_kmov() {
+ let a: u16 = 0b11001100_00110011;
+ let r = _mm512_kmov(a);
+ let e: u16 = 0b11001100_00110011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_int2mask() {
+ let a: i32 = 0b11001100_00110011;
+ let r = _mm512_int2mask(a);
+ let e: u16 = 0b11001100_00110011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask2int() {
+ let k1: __mmask16 = 0b11001100_00110011;
+ let r = _mm512_mask2int(k1);
+ let e: i32 = 0b11001100_00110011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_kunpackb() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b00101110_00001011;
+ let r = _mm512_kunpackb(a, b);
+ let e: u16 = 0b00101110_00110011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_kortestc() {
+ let a: u16 = 0b11001100_00110011;
+ let b: u16 = 0b00101110_00001011;
+ let r = _mm512_kortestc(a, b);
+ assert_eq!(r, 0);
+ let b: u16 = 0b11111111_11111111;
+ let r = _mm512_kortestc(a, b);
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_test_epi32_mask() {
+ let a = _mm512_set1_epi32(1 << 0);
+ let b = _mm512_set1_epi32(1 << 0 | 1 << 1);
+ let r = _mm512_test_epi32_mask(a, b);
+ let e: __mmask16 = 0b11111111_11111111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_test_epi32_mask() {
+ let a = _mm512_set1_epi32(1 << 0);
+ let b = _mm512_set1_epi32(1 << 0 | 1 << 1);
+ let r = _mm512_mask_test_epi32_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm512_mask_test_epi32_mask(0b11111111_11111111, a, b);
+ let e: __mmask16 = 0b11111111_11111111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_test_epi32_mask() {
+ let a = _mm256_set1_epi32(1 << 0);
+ let b = _mm256_set1_epi32(1 << 0 | 1 << 1);
+ let r = _mm256_test_epi32_mask(a, b);
+ let e: __mmask8 = 0b11111111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_test_epi32_mask() {
+ let a = _mm256_set1_epi32(1 << 0);
+ let b = _mm256_set1_epi32(1 << 0 | 1 << 1);
+ let r = _mm256_mask_test_epi32_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm256_mask_test_epi32_mask(0b11111111, a, b);
+ let e: __mmask8 = 0b11111111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_test_epi32_mask() {
+ let a = _mm_set1_epi32(1 << 0);
+ let b = _mm_set1_epi32(1 << 0 | 1 << 1);
+ let r = _mm_test_epi32_mask(a, b);
+ let e: __mmask8 = 0b00001111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_test_epi32_mask() {
+ let a = _mm_set1_epi32(1 << 0);
+ let b = _mm_set1_epi32(1 << 0 | 1 << 1);
+ let r = _mm_mask_test_epi32_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm_mask_test_epi32_mask(0b11111111, a, b);
+ let e: __mmask8 = 0b00001111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_testn_epi32_mask() {
+ let a = _mm512_set1_epi32(1 << 0);
+ let b = _mm512_set1_epi32(1 << 0 | 1 << 1);
+ let r = _mm512_testn_epi32_mask(a, b);
+ let e: __mmask16 = 0b00000000_00000000;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_testn_epi32_mask() {
+ let a = _mm512_set1_epi32(1 << 0);
+ let b = _mm512_set1_epi32(1 << 1);
+ let r = _mm512_mask_test_epi32_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm512_mask_testn_epi32_mask(0b11111111_11111111, a, b);
+ let e: __mmask16 = 0b11111111_11111111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_testn_epi32_mask() {
+ let a = _mm256_set1_epi32(1 << 0);
+ let b = _mm256_set1_epi32(1 << 1);
+ let r = _mm256_testn_epi32_mask(a, b);
+ let e: __mmask8 = 0b11111111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_testn_epi32_mask() {
+ let a = _mm256_set1_epi32(1 << 0);
+ let b = _mm256_set1_epi32(1 << 1);
+ let r = _mm256_mask_test_epi32_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm256_mask_testn_epi32_mask(0b11111111, a, b);
+ let e: __mmask8 = 0b11111111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_testn_epi32_mask() {
+ let a = _mm_set1_epi32(1 << 0);
+ let b = _mm_set1_epi32(1 << 1);
+ let r = _mm_testn_epi32_mask(a, b);
+ let e: __mmask8 = 0b00001111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_testn_epi32_mask() {
+ let a = _mm_set1_epi32(1 << 0);
+ let b = _mm_set1_epi32(1 << 1);
+ let r = _mm_mask_test_epi32_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm_mask_testn_epi32_mask(0b11111111, a, b);
+ let e: __mmask8 = 0b00001111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_stream_ps() {
+ #[repr(align(32))]
+ struct Memory {
+ pub data: [f32; 16],
+ }
+ let a = _mm512_set1_ps(7.0);
+ let mut mem = Memory { data: [-1.0; 16] };
+
+ _mm512_stream_ps(&mut mem.data[0] as *mut f32, a);
+ for i in 0..16 {
+ assert_eq!(mem.data[i], get_m512(a, i));
+ }
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_add_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let e: i32 = _mm512_reduce_add_epi32(a);
+ assert_eq!(16, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_add_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let e: i32 = _mm512_mask_reduce_add_epi32(0b11111111_00000000, a);
+ assert_eq!(8, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_add_ps() {
+ let a = _mm512_set1_ps(1.);
+ let e: f32 = _mm512_reduce_add_ps(a);
+ assert_eq!(16., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_add_ps() {
+ let a = _mm512_set1_ps(1.);
+ let e: f32 = _mm512_mask_reduce_add_ps(0b11111111_00000000, a);
+ assert_eq!(8., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_mul_epi32() {
+ let a = _mm512_set1_epi32(2);
+ let e: i32 = _mm512_reduce_mul_epi32(a);
+ assert_eq!(65536, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_mul_epi32() {
+ let a = _mm512_set1_epi32(2);
+ let e: i32 = _mm512_mask_reduce_mul_epi32(0b11111111_00000000, a);
+ assert_eq!(256, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_mul_ps() {
+ let a = _mm512_set1_ps(2.);
+ let e: f32 = _mm512_reduce_mul_ps(a);
+ assert_eq!(65536., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_mul_ps() {
+ let a = _mm512_set1_ps(2.);
+ let e: f32 = _mm512_mask_reduce_mul_ps(0b11111111_00000000, a);
+ assert_eq!(256., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_max_epi32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: i32 = _mm512_reduce_max_epi32(a);
+ assert_eq!(15, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_max_epi32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: i32 = _mm512_mask_reduce_max_epi32(0b11111111_00000000, a);
+ assert_eq!(7, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_max_epu32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u32 = _mm512_reduce_max_epu32(a);
+ assert_eq!(15, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_max_epu32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u32 = _mm512_mask_reduce_max_epu32(0b11111111_00000000, a);
+ assert_eq!(7, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_max_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let e: f32 = _mm512_reduce_max_ps(a);
+ assert_eq!(15., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_max_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let e: f32 = _mm512_mask_reduce_max_ps(0b11111111_00000000, a);
+ assert_eq!(7., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_min_epi32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: i32 = _mm512_reduce_min_epi32(a);
+ assert_eq!(0, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_min_epi32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: i32 = _mm512_mask_reduce_min_epi32(0b11111111_00000000, a);
+ assert_eq!(0, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_min_epu32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u32 = _mm512_reduce_min_epu32(a);
+ assert_eq!(0, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_min_epu32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u32 = _mm512_mask_reduce_min_epu32(0b11111111_00000000, a);
+ assert_eq!(0, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_min_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let e: f32 = _mm512_reduce_min_ps(a);
+ assert_eq!(0., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_min_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let e: f32 = _mm512_mask_reduce_min_ps(0b11111111_00000000, a);
+ assert_eq!(0., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_and_epi32() {
+ let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i32 = _mm512_reduce_and_epi32(a);
+ assert_eq!(0, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_and_epi32() {
+ let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i32 = _mm512_mask_reduce_and_epi32(0b11111111_00000000, a);
+ assert_eq!(1, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_or_epi32() {
+ let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i32 = _mm512_reduce_or_epi32(a);
+ assert_eq!(3, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_or_epi32() {
+ let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i32 = _mm512_mask_reduce_and_epi32(0b11111111_00000000, a);
+ assert_eq!(1, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_compress_epi32() {
+ let src = _mm512_set1_epi32(200);
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_mask_compress_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_compress_epi32(src, 0b01010101_01010101, a);
+ let e = _mm512_set_epi32(
+ 200, 200, 200, 200, 200, 200, 200, 200, 1, 3, 5, 7, 9, 11, 13, 15,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_compress_epi32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_compress_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_compress_epi32(0b01010101_01010101, a);
+ let e = _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 5, 7, 9, 11, 13, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_compress_epi32() {
+ let src = _mm256_set1_epi32(200);
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_mask_compress_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_compress_epi32(src, 0b01010101, a);
+ let e = _mm256_set_epi32(200, 200, 200, 200, 1, 3, 5, 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_compress_epi32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_maskz_compress_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_compress_epi32(0b01010101, a);
+ let e = _mm256_set_epi32(0, 0, 0, 0, 1, 3, 5, 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_compress_epi32() {
+ let src = _mm_set1_epi32(200);
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let r = _mm_mask_compress_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_compress_epi32(src, 0b00000101, a);
+ let e = _mm_set_epi32(200, 200, 1, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_compress_epi32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let r = _mm_maskz_compress_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_compress_epi32(0b00000101, a);
+ let e = _mm_set_epi32(0, 0, 1, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_compress_ps() {
+ let src = _mm512_set1_ps(200.);
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let r = _mm512_mask_compress_ps(src, 0, a);
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_compress_ps(src, 0b01010101_01010101, a);
+ let e = _mm512_set_ps(
+ 200., 200., 200., 200., 200., 200., 200., 200., 1., 3., 5., 7., 9., 11., 13., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_compress_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let r = _mm512_maskz_compress_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_compress_ps(0b01010101_01010101, a);
+ let e = _mm512_set_ps(
+ 0., 0., 0., 0., 0., 0., 0., 0., 1., 3., 5., 7., 9., 11., 13., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_compress_ps() {
+ let src = _mm256_set1_ps(200.);
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm256_mask_compress_ps(src, 0, a);
+ assert_eq_m256(r, src);
+ let r = _mm256_mask_compress_ps(src, 0b01010101, a);
+ let e = _mm256_set_ps(200., 200., 200., 200., 1., 3., 5., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_compress_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm256_maskz_compress_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_compress_ps(0b01010101, a);
+ let e = _mm256_set_ps(0., 0., 0., 0., 1., 3., 5., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_compress_ps() {
+ let src = _mm_set1_ps(200.);
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let r = _mm_mask_compress_ps(src, 0, a);
+ assert_eq_m128(r, src);
+ let r = _mm_mask_compress_ps(src, 0b00000101, a);
+ let e = _mm_set_ps(200., 200., 1., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_compress_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let r = _mm_maskz_compress_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_compress_ps(0b00000101, a);
+ let e = _mm_set_ps(0., 0., 1., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_compressstoreu_epi32() {
+ let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let mut r = [0_i32; 16];
+ _mm512_mask_compressstoreu_epi32(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i32; 16]);
+ _mm512_mask_compressstoreu_epi32(r.as_mut_ptr() as *mut _, 0b1111000011001010, a);
+ assert_eq!(&r, &[2, 4, 7, 8, 13, 14, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0]);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_compressstoreu_epi32() {
+ let a = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let mut r = [0_i32; 8];
+ _mm256_mask_compressstoreu_epi32(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i32; 8]);
+ _mm256_mask_compressstoreu_epi32(r.as_mut_ptr() as *mut _, 0b11001010, a);
+ assert_eq!(&r, &[2, 4, 7, 8, 0, 0, 0, 0]);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_compressstoreu_epi32() {
+ let a = _mm_setr_epi32(1, 2, 3, 4);
+ let mut r = [0_i32; 4];
+ _mm_mask_compressstoreu_epi32(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i32; 4]);
+ _mm_mask_compressstoreu_epi32(r.as_mut_ptr() as *mut _, 0b1011, a);
+ assert_eq!(&r, &[1, 2, 4, 0]);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_compressstoreu_epi64() {
+ let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let mut r = [0_i64; 8];
+ _mm512_mask_compressstoreu_epi64(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i64; 8]);
+ _mm512_mask_compressstoreu_epi64(r.as_mut_ptr() as *mut _, 0b11001010, a);
+ assert_eq!(&r, &[2, 4, 7, 8, 0, 0, 0, 0]);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_compressstoreu_epi64() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let mut r = [0_i64; 4];
+ _mm256_mask_compressstoreu_epi64(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i64; 4]);
+ _mm256_mask_compressstoreu_epi64(r.as_mut_ptr() as *mut _, 0b1011, a);
+ assert_eq!(&r, &[1, 2, 4, 0]);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_compressstoreu_epi64() {
+ let a = _mm_setr_epi64x(1, 2);
+ let mut r = [0_i64; 2];
+ _mm_mask_compressstoreu_epi64(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i64; 2]);
+ _mm_mask_compressstoreu_epi64(r.as_mut_ptr() as *mut _, 0b10, a);
+ assert_eq!(&r, &[2, 0]);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_compressstoreu_ps() {
+ let a = _mm512_setr_ps(
+ 1_f32, 2_f32, 3_f32, 4_f32, 5_f32, 6_f32, 7_f32, 8_f32, 9_f32, 10_f32, 11_f32, 12_f32,
+ 13_f32, 14_f32, 15_f32, 16_f32,
+ );
+ let mut r = [0_f32; 16];
+ _mm512_mask_compressstoreu_ps(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_f32; 16]);
+ _mm512_mask_compressstoreu_ps(r.as_mut_ptr() as *mut _, 0b1111000011001010, a);
+ assert_eq!(
+ &r,
+ &[
+ 2_f32, 4_f32, 7_f32, 8_f32, 13_f32, 14_f32, 15_f32, 16_f32, 0_f32, 0_f32, 0_f32,
+ 0_f32, 0_f32, 0_f32, 0_f32, 0_f32
+ ]
+ );
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_compressstoreu_ps() {
+ let a = _mm256_setr_ps(1_f32, 2_f32, 3_f32, 4_f32, 5_f32, 6_f32, 7_f32, 8_f32);
+ let mut r = [0_f32; 8];
+ _mm256_mask_compressstoreu_ps(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_f32; 8]);
+ _mm256_mask_compressstoreu_ps(r.as_mut_ptr() as *mut _, 0b11001010, a);
+ assert_eq!(
+ &r,
+ &[2_f32, 4_f32, 7_f32, 8_f32, 0_f32, 0_f32, 0_f32, 0_f32]
+ );
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_compressstoreu_ps() {
+ let a = _mm_setr_ps(1_f32, 2_f32, 3_f32, 4_f32);
+ let mut r = [0.; 4];
+ _mm_mask_compressstoreu_ps(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0.; 4]);
+ _mm_mask_compressstoreu_ps(r.as_mut_ptr() as *mut _, 0b1011, a);
+ assert_eq!(&r, &[1_f32, 2_f32, 4_f32, 0_f32]);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_compressstoreu_pd() {
+ let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let mut r = [0.; 8];
+ _mm512_mask_compressstoreu_pd(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0.; 8]);
+ _mm512_mask_compressstoreu_pd(r.as_mut_ptr() as *mut _, 0b11001010, a);
+ assert_eq!(&r, &[2., 4., 7., 8., 0., 0., 0., 0.]);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_compressstoreu_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let mut r = [0.; 4];
+ _mm256_mask_compressstoreu_pd(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0.; 4]);
+ _mm256_mask_compressstoreu_pd(r.as_mut_ptr() as *mut _, 0b1011, a);
+ assert_eq!(&r, &[1., 2., 4., 0.]);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_compressstoreu_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let mut r = [0.; 2];
+ _mm_mask_compressstoreu_pd(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0.; 2]);
+ _mm_mask_compressstoreu_pd(r.as_mut_ptr() as *mut _, 0b10, a);
+ assert_eq!(&r, &[2., 0.]);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_expand_epi32() {
+ let src = _mm512_set1_epi32(200);
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_mask_expand_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_expand_epi32(src, 0b01010101_01010101, a);
+ let e = _mm512_set_epi32(
+ 200, 8, 200, 9, 200, 10, 200, 11, 200, 12, 200, 13, 200, 14, 200, 15,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_expand_epi32() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_expand_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_expand_epi32(0b01010101_01010101, a);
+ let e = _mm512_set_epi32(0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_expand_epi32() {
+ let src = _mm256_set1_epi32(200);
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_mask_expand_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_expand_epi32(src, 0b01010101, a);
+ let e = _mm256_set_epi32(200, 4, 200, 5, 200, 6, 200, 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_expand_epi32() {
+ let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm256_maskz_expand_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_expand_epi32(0b01010101, a);
+ let e = _mm256_set_epi32(0, 4, 0, 5, 0, 6, 0, 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_expand_epi32() {
+ let src = _mm_set1_epi32(200);
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let r = _mm_mask_expand_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_expand_epi32(src, 0b00000101, a);
+ let e = _mm_set_epi32(200, 2, 200, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_expand_epi32() {
+ let a = _mm_set_epi32(0, 1, 2, 3);
+ let r = _mm_maskz_expand_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_expand_epi32(0b00000101, a);
+ let e = _mm_set_epi32(0, 2, 0, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_expand_ps() {
+ let src = _mm512_set1_ps(200.);
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let r = _mm512_mask_expand_ps(src, 0, a);
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_expand_ps(src, 0b01010101_01010101, a);
+ let e = _mm512_set_ps(
+ 200., 8., 200., 9., 200., 10., 200., 11., 200., 12., 200., 13., 200., 14., 200., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_expand_ps() {
+ let a = _mm512_set_ps(
+ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+ );
+ let r = _mm512_maskz_expand_ps(0, a);
+ assert_eq_m512(r, _mm512_setzero_ps());
+ let r = _mm512_maskz_expand_ps(0b01010101_01010101, a);
+ let e = _mm512_set_ps(
+ 0., 8., 0., 9., 0., 10., 0., 11., 0., 12., 0., 13., 0., 14., 0., 15.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_expand_ps() {
+ let src = _mm256_set1_ps(200.);
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm256_mask_expand_ps(src, 0, a);
+ assert_eq_m256(r, src);
+ let r = _mm256_mask_expand_ps(src, 0b01010101, a);
+ let e = _mm256_set_ps(200., 4., 200., 5., 200., 6., 200., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_expand_ps() {
+ let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm256_maskz_expand_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm256_maskz_expand_ps(0b01010101, a);
+ let e = _mm256_set_ps(0., 4., 0., 5., 0., 6., 0., 7.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_expand_ps() {
+ let src = _mm_set1_ps(200.);
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let r = _mm_mask_expand_ps(src, 0, a);
+ assert_eq_m128(r, src);
+ let r = _mm_mask_expand_ps(src, 0b00000101, a);
+ let e = _mm_set_ps(200., 2., 200., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_expand_ps() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let r = _mm_maskz_expand_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_expand_ps(0b00000101, a);
+ let e = _mm_set_ps(0., 2., 0., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_loadu_epi32() {
+ let a = &[4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50];
+ let p = a.as_ptr();
+ let r = _mm512_loadu_epi32(black_box(p));
+ let e = _mm512_setr_epi32(4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_loadu_epi32() {
+ let a = &[4, 3, 2, 5, 8, 9, 64, 50];
+ let p = a.as_ptr();
+ let r = _mm256_loadu_epi32(black_box(p));
+ let e = _mm256_setr_epi32(4, 3, 2, 5, 8, 9, 64, 50);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_loadu_epi32() {
+ let a = &[4, 3, 2, 5];
+ let p = a.as_ptr();
+ let r = _mm_loadu_epi32(black_box(p));
+ let e = _mm_setr_epi32(4, 3, 2, 5);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi32_storeu_epi16() {
+ let a = _mm512_set1_epi32(9);
+ let mut r = _mm256_undefined_si256();
+ _mm512_mask_cvtepi32_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
+ let e = _mm256_set1_epi16(9);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi32_storeu_epi16() {
+ let a = _mm256_set1_epi32(9);
+ let mut r = _mm_undefined_si128();
+ _mm256_mask_cvtepi32_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set1_epi16(9);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi32_storeu_epi16() {
+ let a = _mm_set1_epi32(9);
+ let mut r = _mm_set1_epi8(0);
+ _mm_mask_cvtepi32_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 9, 9, 9, 9);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtsepi32_storeu_epi16() {
+ let a = _mm512_set1_epi32(i32::MAX);
+ let mut r = _mm256_undefined_si256();
+ _mm512_mask_cvtsepi32_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
+ let e = _mm256_set1_epi16(i16::MAX);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtsepi32_storeu_epi16() {
+ let a = _mm256_set1_epi32(i32::MAX);
+ let mut r = _mm_undefined_si128();
+ _mm256_mask_cvtsepi32_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set1_epi16(i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtsepi32_storeu_epi16() {
+ let a = _mm_set1_epi32(i32::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm_mask_cvtsepi32_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ 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 = "avx512f")]
+ unsafe fn test_mm512_mask_cvtusepi32_storeu_epi16() {
+ let a = _mm512_set1_epi32(i32::MAX);
+ let mut r = _mm256_undefined_si256();
+ _mm512_mask_cvtusepi32_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
+ let e = _mm256_set1_epi16(u16::MAX as i16);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtusepi32_storeu_epi16() {
+ let a = _mm256_set1_epi32(i32::MAX);
+ let mut r = _mm_undefined_si128();
+ _mm256_mask_cvtusepi32_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set1_epi16(u16::MAX as i16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtusepi32_storeu_epi16() {
+ let a = _mm_set1_epi32(i32::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm_mask_cvtusepi32_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ 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 = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi32_storeu_epi8() {
+ let a = _mm512_set1_epi32(9);
+ let mut r = _mm_undefined_si128();
+ _mm512_mask_cvtepi32_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111_11111111, a);
+ let e = _mm_set1_epi8(9);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi32_storeu_epi8() {
+ let a = _mm256_set1_epi32(9);
+ let mut r = _mm_set1_epi8(0);
+ _mm256_mask_cvtepi32_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi32_storeu_epi8() {
+ let a = _mm_set1_epi32(9);
+ let mut r = _mm_set1_epi8(0);
+ _mm_mask_cvtepi32_storeu_epi8(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtsepi32_storeu_epi8() {
+ let a = _mm512_set1_epi32(i32::MAX);
+ let mut r = _mm_undefined_si128();
+ _mm512_mask_cvtsepi32_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 = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtsepi32_storeu_epi8() {
+ let a = _mm256_set1_epi32(i32::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm256_mask_cvtsepi32_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 = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtsepi32_storeu_epi8() {
+ let a = _mm_set1_epi32(i32::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm_mask_cvtsepi32_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,
+ 0, 0, 0, 0,
+ i8::MAX, i8::MAX, i8::MAX, i8::MAX,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtusepi32_storeu_epi8() {
+ let a = _mm512_set1_epi32(i32::MAX);
+ let mut r = _mm_undefined_si128();
+ _mm512_mask_cvtusepi32_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 = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtusepi32_storeu_epi8() {
+ let a = _mm256_set1_epi32(i32::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm256_mask_cvtusepi32_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);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtusepi32_storeu_epi8() {
+ let a = _mm_set1_epi32(i32::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm_mask_cvtusepi32_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,
+ 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 = "avx512f")]
+ unsafe fn test_mm512_storeu_epi32() {
+ let a = _mm512_set1_epi32(9);
+ let mut r = _mm512_undefined_epi32();
+ _mm512_storeu_epi32(&mut r as *mut _ as *mut i32, a);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_storeu_epi32() {
+ let a = _mm256_set1_epi32(9);
+ let mut r = _mm256_undefined_si256();
+ _mm256_storeu_epi32(&mut r as *mut _ as *mut i32, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_storeu_epi32() {
+ let a = _mm_set1_epi32(9);
+ let mut r = _mm_undefined_si128();
+ _mm_storeu_epi32(&mut r as *mut _ as *mut i32, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_loadu_si512() {
+ let a = &[4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50];
+ let p = a.as_ptr();
+ let r = _mm512_loadu_si512(black_box(p));
+ let e = _mm512_setr_epi32(4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_storeu_si512() {
+ let a = _mm512_set1_epi32(9);
+ let mut r = _mm512_undefined_epi32();
+ _mm512_storeu_si512(&mut r as *mut _ as *mut i32, a);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_load_si512() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i32; 16], // 64 bytes
+ }
+ let a = Align {
+ data: [4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50],
+ };
+ let p = (a.data).as_ptr();
+ let r = _mm512_load_si512(black_box(p));
+ let e = _mm512_setr_epi32(4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_store_si512() {
+ let a = _mm512_set1_epi32(9);
+ let mut r = _mm512_undefined_epi32();
+ _mm512_store_si512(&mut r as *mut _ as *mut i32, a);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_load_epi32() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i32; 16], // 64 bytes
+ }
+ let a = Align {
+ data: [4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50],
+ };
+ let p = (a.data).as_ptr();
+ let r = _mm512_load_epi32(black_box(p));
+ let e = _mm512_setr_epi32(4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_load_epi32() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i32; 8],
+ }
+ let a = Align {
+ data: [4, 3, 2, 5, 8, 9, 64, 50],
+ };
+ let p = (a.data).as_ptr();
+ let r = _mm256_load_epi32(black_box(p));
+ let e = _mm256_setr_epi32(4, 3, 2, 5, 8, 9, 64, 50);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_load_epi32() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i32; 4],
+ }
+ let a = Align { data: [4, 3, 2, 5] };
+ let p = (a.data).as_ptr();
+ let r = _mm_load_epi32(black_box(p));
+ let e = _mm_setr_epi32(4, 3, 2, 5);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_store_epi32() {
+ let a = _mm512_set1_epi32(9);
+ let mut r = _mm512_undefined_epi32();
+ _mm512_store_epi32(&mut r as *mut _ as *mut i32, a);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_store_epi32() {
+ let a = _mm256_set1_epi32(9);
+ let mut r = _mm256_undefined_si256();
+ _mm256_store_epi32(&mut r as *mut _ as *mut i32, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_store_epi32() {
+ let a = _mm_set1_epi32(9);
+ let mut r = _mm_undefined_si128();
+ _mm_store_epi32(&mut r as *mut _ as *mut i32, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_load_ps() {
+ #[repr(align(64))]
+ struct Align {
+ data: [f32; 16], // 64 bytes
+ }
+ let a = Align {
+ data: [
+ 4., 3., 2., 5., 8., 9., 64., 50., -4., -3., -2., -5., -8., -9., -64., -50.,
+ ],
+ };
+ let p = (a.data).as_ptr();
+ let r = _mm512_load_ps(black_box(p));
+ let e = _mm512_setr_ps(
+ 4., 3., 2., 5., 8., 9., 64., 50., -4., -3., -2., -5., -8., -9., -64., -50.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_store_ps() {
+ let a = _mm512_set1_ps(9.);
+ let mut r = _mm512_undefined_ps();
+ _mm512_store_ps(&mut r as *mut _ as *mut f32, a);
+ assert_eq_m512(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_set1_epi32() {
+ let src = _mm512_set1_epi32(2);
+ let a: i32 = 11;
+ let r = _mm512_mask_set1_epi32(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_set1_epi32(src, 0b11111111_11111111, a);
+ let e = _mm512_set1_epi32(11);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_set1_epi32() {
+ let a: i32 = 11;
+ let r = _mm512_maskz_set1_epi32(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_set1_epi32(0b11111111_11111111, a);
+ let e = _mm512_set1_epi32(11);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_set1_epi32() {
+ let src = _mm256_set1_epi32(2);
+ let a: i32 = 11;
+ let r = _mm256_mask_set1_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_set1_epi32(src, 0b11111111, a);
+ let e = _mm256_set1_epi32(11);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm256_maskz_set1_epi32() {
+ let a: i32 = 11;
+ let r = _mm256_maskz_set1_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_set1_epi32(0b11111111, a);
+ let e = _mm256_set1_epi32(11);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_set1_epi32() {
+ let src = _mm_set1_epi32(2);
+ let a: i32 = 11;
+ let r = _mm_mask_set1_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_set1_epi32(src, 0b00001111, a);
+ let e = _mm_set1_epi32(11);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_set1_epi32() {
+ let a: i32 = 11;
+ let r = _mm_maskz_set1_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_set1_epi32(0b00001111, a);
+ let e = _mm_set1_epi32(11);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_move_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_mask_move_ss(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_move_ss(src, 0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 40.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_move_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_maskz_move_ss(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_move_ss(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 40.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_move_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_move_sd(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_move_sd(src, 0b11111111, a, b);
+ let e = _mm_set_pd(1., 4.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_move_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_move_sd(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_move_sd(0b11111111, a, b);
+ let e = _mm_set_pd(1., 4.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_add_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_mask_add_ss(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_add_ss(src, 0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 60.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_add_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_maskz_add_ss(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_add_ss(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 60.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_add_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_add_sd(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_add_sd(src, 0b11111111, a, b);
+ let e = _mm_set_pd(1., 6.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_add_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_add_sd(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_add_sd(0b11111111, a, b);
+ let e = _mm_set_pd(1., 6.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_sub_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_mask_sub_ss(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_sub_ss(src, 0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., -20.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_sub_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_maskz_sub_ss(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_sub_ss(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., -20.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_sub_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_sub_sd(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_sub_sd(src, 0b11111111, a, b);
+ let e = _mm_set_pd(1., -2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_sub_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_sub_sd(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_sub_sd(0b11111111, a, b);
+ let e = _mm_set_pd(1., -2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_mul_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_mask_mul_ss(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_mul_ss(src, 0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 800.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_mul_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_maskz_mul_ss(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_mul_ss(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 800.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_mul_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_mul_sd(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_mul_sd(src, 0b11111111, a, b);
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_mul_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_mul_sd(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_mul_sd(0b11111111, a, b);
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_div_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_mask_div_ss(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_div_ss(src, 0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_div_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_maskz_div_ss(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_div_ss(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_div_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_div_sd(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_div_sd(src, 0b11111111, a, b);
+ let e = _mm_set_pd(1., 0.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_div_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_div_sd(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_div_sd(0b11111111, a, b);
+ let e = _mm_set_pd(1., 0.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_max_ss() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(4., 5., 6., 7.);
+ let r = _mm_mask_max_ss(a, 0, a, b);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_max_ss(a, 0b11111111, a, b);
+ let e = _mm_set_ps(0., 1., 2., 7.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_max_ss() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(4., 5., 6., 7.);
+ let r = _mm_maskz_max_ss(0, a, b);
+ let e = _mm_set_ps(0., 1., 2., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_max_ss(0b11111111, a, b);
+ let e = _mm_set_ps(0., 1., 2., 7.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_max_sd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_mask_max_sd(a, 0, a, b);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_max_sd(a, 0b11111111, a, b);
+ let e = _mm_set_pd(0., 3.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_max_sd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_maskz_max_sd(0, a, b);
+ let e = _mm_set_pd(0., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_max_sd(0b11111111, a, b);
+ let e = _mm_set_pd(0., 3.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_min_ss() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(4., 5., 6., 7.);
+ let r = _mm_mask_min_ss(a, 0, a, b);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_min_ss(a, 0b11111111, a, b);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_min_ss() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(4., 5., 6., 7.);
+ let r = _mm_maskz_min_ss(0, a, b);
+ let e = _mm_set_ps(0., 1., 2., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_min_ss(0b11111111, a, b);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_min_sd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_mask_min_sd(a, 0, a, b);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_min_sd(a, 0b11111111, a, b);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_min_sd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_maskz_min_sd(0, a, b);
+ let e = _mm_set_pd(0., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_min_sd(0b11111111, a, b);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_sqrt_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_mask_sqrt_ss(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_sqrt_ss(src, 0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_sqrt_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_maskz_sqrt_ss(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_sqrt_ss(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_sqrt_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_sqrt_sd(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_sqrt_sd(src, 0b11111111, a, b);
+ let e = _mm_set_pd(1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_sqrt_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_sqrt_sd(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_sqrt_sd(0b11111111, a, b);
+ let e = _mm_set_pd(1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_rsqrt14_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_rsqrt14_ss(a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_rsqrt14_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_mask_rsqrt14_ss(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_rsqrt14_ss(src, 0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_rsqrt14_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_maskz_rsqrt14_ss(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_rsqrt14_ss(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_rsqrt14_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_rsqrt14_sd(a, b);
+ let e = _mm_set_pd(1., 0.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_rsqrt14_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_rsqrt14_sd(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_rsqrt14_sd(src, 0b11111111, a, b);
+ let e = _mm_set_pd(1., 0.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_rsqrt14_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_rsqrt14_sd(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_rsqrt14_sd(0b11111111, a, b);
+ let e = _mm_set_pd(1., 0.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_rcp14_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_rcp14_ss(a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_rcp14_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_mask_rcp14_ss(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_rcp14_ss(src, 0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_rcp14_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_maskz_rcp14_ss(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_rcp14_ss(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_rcp14_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_rcp14_sd(a, b);
+ let e = _mm_set_pd(1., 0.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_rcp14_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_rcp14_sd(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_rcp14_sd(src, 0b11111111, a, b);
+ let e = _mm_set_pd(1., 0.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_rcp14_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_rcp14_sd(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_rcp14_sd(0b11111111, a, b);
+ let e = _mm_set_pd(1., 0.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_getexp_ss() {
+ let a = _mm_set1_ps(2.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_getexp_ss(a, b);
+ let e = _mm_set_ps(2., 2., 2., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_getexp_ss() {
+ let a = _mm_set1_ps(2.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_mask_getexp_ss(a, 0, a, b);
+ let e = _mm_set_ps(2., 2., 2., 2.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_getexp_ss(a, 0b11111111, a, b);
+ let e = _mm_set_ps(2., 2., 2., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_getexp_ss() {
+ let a = _mm_set1_ps(2.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_maskz_getexp_ss(0, a, b);
+ let e = _mm_set_ps(2., 2., 2., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_getexp_ss(0b11111111, a, b);
+ let e = _mm_set_ps(2., 2., 2., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_getexp_sd() {
+ let a = _mm_set1_pd(2.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_getexp_sd(a, b);
+ let e = _mm_set_pd(2., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_getexp_sd() {
+ let a = _mm_set1_pd(2.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_mask_getexp_sd(a, 0, a, b);
+ let e = _mm_set_pd(2., 2.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_getexp_sd(a, 0b11111111, a, b);
+ let e = _mm_set_pd(2., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_getexp_sd() {
+ let a = _mm_set1_pd(2.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_maskz_getexp_sd(0, a, b);
+ let e = _mm_set_pd(2., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_getexp_sd(0b11111111, a, b);
+ let e = _mm_set_pd(2., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_getmant_ss() {
+ let a = _mm_set1_ps(20.);
+ let b = _mm_set1_ps(10.);
+ let r = _mm_getmant_ss::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, b);
+ let e = _mm_set_ps(20., 20., 20., 1.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_getmant_ss() {
+ let a = _mm_set1_ps(20.);
+ let b = _mm_set1_ps(10.);
+ let r = _mm_mask_getmant_ss::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a, b);
+ let e = _mm_set_ps(20., 20., 20., 20.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_getmant_ss::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0b11111111, a, b);
+ let e = _mm_set_ps(20., 20., 20., 1.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_getmant_ss() {
+ let a = _mm_set1_ps(20.);
+ let b = _mm_set1_ps(10.);
+ let r = _mm_maskz_getmant_ss::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a, b);
+ let e = _mm_set_ps(20., 20., 20., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_getmant_ss::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0b11111111, a, b);
+ let e = _mm_set_ps(20., 20., 20., 1.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_getmant_sd() {
+ let a = _mm_set1_pd(20.);
+ let b = _mm_set1_pd(10.);
+ let r = _mm_getmant_sd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, b);
+ let e = _mm_set_pd(20., 1.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_getmant_sd() {
+ let a = _mm_set1_pd(20.);
+ let b = _mm_set1_pd(10.);
+ let r = _mm_mask_getmant_sd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a, b);
+ let e = _mm_set_pd(20., 20.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_getmant_sd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0b11111111, a, b);
+ let e = _mm_set_pd(20., 1.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_getmant_sd() {
+ let a = _mm_set1_pd(20.);
+ let b = _mm_set1_pd(10.);
+ let r = _mm_maskz_getmant_sd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a, b);
+ let e = _mm_set_pd(20., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_getmant_sd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0b11111111, a, b);
+ let e = _mm_set_pd(20., 1.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_roundscale_ss() {
+ let a = _mm_set1_ps(2.2);
+ let b = _mm_set1_ps(1.1);
+ let r = _mm_roundscale_ss::<0>(a, b);
+ let e = _mm_set_ps(2.2, 2.2, 2.2, 1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_roundscale_ss() {
+ let a = _mm_set1_ps(2.2);
+ let b = _mm_set1_ps(1.1);
+ let r = _mm_mask_roundscale_ss::<0>(a, 0, a, b);
+ let e = _mm_set_ps(2.2, 2.2, 2.2, 2.2);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_roundscale_ss::<0>(a, 0b11111111, a, b);
+ let e = _mm_set_ps(2.2, 2.2, 2.2, 1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_roundscale_ss() {
+ let a = _mm_set1_ps(2.2);
+ let b = _mm_set1_ps(1.1);
+ let r = _mm_maskz_roundscale_ss::<0>(0, a, b);
+ let e = _mm_set_ps(2.2, 2.2, 2.2, 0.0);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_roundscale_ss::<0>(0b11111111, a, b);
+ let e = _mm_set_ps(2.2, 2.2, 2.2, 1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_roundscale_sd() {
+ let a = _mm_set1_pd(2.2);
+ let b = _mm_set1_pd(1.1);
+ let r = _mm_roundscale_sd::<0>(a, b);
+ let e = _mm_set_pd(2.2, 1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_roundscale_sd() {
+ let a = _mm_set1_pd(2.2);
+ let b = _mm_set1_pd(1.1);
+ let r = _mm_mask_roundscale_sd::<0>(a, 0, a, b);
+ let e = _mm_set_pd(2.2, 2.2);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_roundscale_sd::<0>(a, 0b11111111, a, b);
+ let e = _mm_set_pd(2.2, 1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_roundscale_sd() {
+ let a = _mm_set1_pd(2.2);
+ let b = _mm_set1_pd(1.1);
+ let r = _mm_maskz_roundscale_sd::<0>(0, a, b);
+ let e = _mm_set_pd(2.2, 0.0);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_roundscale_sd::<0>(0b11111111, a, b);
+ let e = _mm_set_pd(2.2, 1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_scalef_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_scalef_ss(a, b);
+ let e = _mm_set_ps(1., 1., 1., 8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_scalef_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_mask_scalef_ss(a, 0, a, b);
+ let e = _mm_set_ps(1., 1., 1., 1.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_scalef_ss(a, 0b11111111, a, b);
+ let e = _mm_set_ps(1., 1., 1., 8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_scalef_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_maskz_scalef_ss(0, a, b);
+ let e = _mm_set_ps(1., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_scalef_ss(0b11111111, a, b);
+ let e = _mm_set_ps(1., 1., 1., 8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_scalef_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_scalef_sd(a, b);
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_scalef_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_mask_scalef_sd(a, 0, a, b);
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_scalef_sd(a, 0b11111111, a, b);
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_scalef_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_maskz_scalef_sd(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_scalef_sd(0b11111111, a, b);
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fmadd_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask_fmadd_ss(a, 0, b, c);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fmadd_ss(a, 0b11111111, b, c);
+ let e = _mm_set_ps(1., 1., 1., 5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fmadd_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_maskz_fmadd_ss(0, a, b, c);
+ let e = _mm_set_ps(1., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_fmadd_ss(0b11111111, a, b, c);
+ let e = _mm_set_ps(1., 1., 1., 5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fmadd_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask3_fmadd_ss(a, b, c, 0);
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fmadd_ss(a, b, c, 0b11111111);
+ let e = _mm_set_ps(3., 3., 3., 5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fmadd_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask_fmadd_sd(a, 0, b, c);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fmadd_sd(a, 0b11111111, b, c);
+ let e = _mm_set_pd(1., 5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fmadd_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_maskz_fmadd_sd(0, a, b, c);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_fmadd_sd(0b11111111, a, b, c);
+ let e = _mm_set_pd(1., 5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fmadd_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask3_fmadd_sd(a, b, c, 0);
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fmadd_sd(a, b, c, 0b11111111);
+ let e = _mm_set_pd(3., 5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fmsub_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask_fmsub_ss(a, 0, b, c);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fmsub_ss(a, 0b11111111, b, c);
+ let e = _mm_set_ps(1., 1., 1., -1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fmsub_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_maskz_fmsub_ss(0, a, b, c);
+ let e = _mm_set_ps(1., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_fmsub_ss(0b11111111, a, b, c);
+ let e = _mm_set_ps(1., 1., 1., -1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fmsub_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask3_fmsub_ss(a, b, c, 0);
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fmsub_ss(a, b, c, 0b11111111);
+ let e = _mm_set_ps(3., 3., 3., -1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fmsub_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask_fmsub_sd(a, 0, b, c);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fmsub_sd(a, 0b11111111, b, c);
+ let e = _mm_set_pd(1., -1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fmsub_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_maskz_fmsub_sd(0, a, b, c);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_fmsub_sd(0b11111111, a, b, c);
+ let e = _mm_set_pd(1., -1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fmsub_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask3_fmsub_sd(a, b, c, 0);
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fmsub_sd(a, b, c, 0b11111111);
+ let e = _mm_set_pd(3., -1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fnmadd_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask_fnmadd_ss(a, 0, b, c);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fnmadd_ss(a, 0b11111111, b, c);
+ let e = _mm_set_ps(1., 1., 1., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fnmadd_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_maskz_fnmadd_ss(0, a, b, c);
+ let e = _mm_set_ps(1., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_fnmadd_ss(0b11111111, a, b, c);
+ let e = _mm_set_ps(1., 1., 1., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fnmadd_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask3_fnmadd_ss(a, b, c, 0);
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fnmadd_ss(a, b, c, 0b11111111);
+ let e = _mm_set_ps(3., 3., 3., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fnmadd_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask_fnmadd_sd(a, 0, b, c);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fnmadd_sd(a, 0b11111111, b, c);
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fnmadd_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_maskz_fnmadd_sd(0, a, b, c);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_fnmadd_sd(0b11111111, a, b, c);
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fnmadd_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask3_fnmadd_sd(a, b, c, 0);
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fnmadd_sd(a, b, c, 0b11111111);
+ let e = _mm_set_pd(3., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fnmsub_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask_fnmsub_ss(a, 0, b, c);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fnmsub_ss(a, 0b11111111, b, c);
+ let e = _mm_set_ps(1., 1., 1., -5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fnmsub_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_maskz_fnmsub_ss(0, a, b, c);
+ let e = _mm_set_ps(1., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_fnmsub_ss(0b11111111, a, b, c);
+ let e = _mm_set_ps(1., 1., 1., -5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fnmsub_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask3_fnmsub_ss(a, b, c, 0);
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fnmsub_ss(a, b, c, 0b11111111);
+ let e = _mm_set_ps(3., 3., 3., -5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fnmsub_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask_fnmsub_sd(a, 0, b, c);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fnmsub_sd(a, 0b11111111, b, c);
+ let e = _mm_set_pd(1., -5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fnmsub_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_maskz_fnmsub_sd(0, a, b, c);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_fnmsub_sd(0b11111111, a, b, c);
+ let e = _mm_set_pd(1., -5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fnmsub_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask3_fnmsub_sd(a, b, c, 0);
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fnmsub_sd(a, b, c, 0b11111111);
+ let e = _mm_set_pd(3., -5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_add_round_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_add_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_ps(1., 2., 10., 60.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_add_round_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_mask_add_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_add_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ src, 0b11111111, a, b,
+ );
+ let e = _mm_set_ps(1., 2., 10., 60.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_add_round_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_maskz_add_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r =
+ _mm_maskz_add_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 60.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_add_round_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_add_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_pd(1., 6.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_add_round_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_add_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_add_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ src, 0b11111111, a, b,
+ );
+ let e = _mm_set_pd(1., 6.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_add_round_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_add_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r =
+ _mm_maskz_add_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0b11111111, a, b);
+ let e = _mm_set_pd(1., 6.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_sub_round_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_sub_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_ps(1., 2., 10., -20.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_sub_round_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_mask_sub_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_sub_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ src, 0b11111111, a, b,
+ );
+ let e = _mm_set_ps(1., 2., 10., -20.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_sub_round_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_maskz_sub_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r =
+ _mm_maskz_sub_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., -20.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_sub_round_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_sub_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_pd(1., -2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_sub_round_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_sub_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_sub_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ src, 0b11111111, a, b,
+ );
+ let e = _mm_set_pd(1., -2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_sub_round_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_sub_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r =
+ _mm_maskz_sub_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0b11111111, a, b);
+ let e = _mm_set_pd(1., -2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mul_round_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_mul_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_ps(1., 2., 10., 800.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_mul_round_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_mask_mul_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_mul_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ src, 0b11111111, a, b,
+ );
+ let e = _mm_set_ps(1., 2., 10., 800.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_mul_round_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_maskz_mul_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r =
+ _mm_maskz_mul_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 800.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mul_round_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mul_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_mul_round_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_mul_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_mul_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ src, 0b11111111, a, b,
+ );
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_mul_round_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_mul_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r =
+ _mm_maskz_mul_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0b11111111, a, b);
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_div_round_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_div_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_div_round_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_mask_div_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_div_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ src, 0b11111111, a, b,
+ );
+ let e = _mm_set_ps(1., 2., 10., 0.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_div_round_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 40.);
+ let r = _mm_maskz_div_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r =
+ _mm_maskz_div_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_div_round_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_div_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_pd(1., 0.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_div_round_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_div_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_div_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ src, 0b11111111, a, b,
+ );
+ let e = _mm_set_pd(1., 0.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_div_round_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_div_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r =
+ _mm_maskz_div_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0b11111111, a, b);
+ let e = _mm_set_pd(1., 0.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_max_round_ss() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(4., 5., 6., 7.);
+ let r = _mm_max_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm_set_ps(0., 1., 2., 7.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_max_round_ss() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(4., 5., 6., 7.);
+ let r = _mm_mask_max_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_max_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, 0b11111111, a, b);
+ let e = _mm_set_ps(0., 1., 2., 7.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_max_round_ss() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(4., 5., 6., 7.);
+ let r = _mm_maskz_max_round_ss::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ let e = _mm_set_ps(0., 1., 2., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_max_round_ss::<_MM_FROUND_CUR_DIRECTION>(0b11111111, a, b);
+ let e = _mm_set_ps(0., 1., 2., 7.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_max_round_sd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_max_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm_set_pd(0., 3.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_max_round_sd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_mask_max_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_max_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0b11111111, a, b);
+ let e = _mm_set_pd(0., 3.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_max_round_sd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_maskz_max_round_sd::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ let e = _mm_set_pd(0., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_max_round_sd::<_MM_FROUND_CUR_DIRECTION>(0b11111111, a, b);
+ let e = _mm_set_pd(0., 3.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_min_round_ss() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(4., 5., 6., 7.);
+ let r = _mm_min_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_min_round_ss() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(4., 5., 6., 7.);
+ let r = _mm_mask_min_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_min_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, 0b11111111, a, b);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_min_round_ss() {
+ let a = _mm_set_ps(0., 1., 2., 3.);
+ let b = _mm_set_ps(4., 5., 6., 7.);
+ let r = _mm_maskz_min_round_ss::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ let e = _mm_set_ps(0., 1., 2., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_min_round_ss::<_MM_FROUND_CUR_DIRECTION>(0b11111111, a, b);
+ let e = _mm_set_ps(0., 1., 2., 3.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_min_round_sd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_min_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_min_round_sd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_mask_min_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_min_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0b11111111, a, b);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_min_round_sd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_maskz_min_round_sd::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ let e = _mm_set_pd(0., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_min_round_sd::<_MM_FROUND_CUR_DIRECTION>(0b11111111, a, b);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_sqrt_round_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_sqrt_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_ps(1., 2., 10., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_sqrt_round_ss() {
+ let src = _mm_set_ps(10., 11., 100., 110.);
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_mask_sqrt_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(src, 0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 110.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_sqrt_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ src, 0b11111111, a, b,
+ );
+ let e = _mm_set_ps(1., 2., 10., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_sqrt_round_ss() {
+ let a = _mm_set_ps(1., 2., 10., 20.);
+ let b = _mm_set_ps(3., 4., 30., 4.);
+ let r = _mm_maskz_sqrt_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_ps(1., 2., 10., 0.);
+ assert_eq_m128(r, e);
+ let r =
+ _mm_maskz_sqrt_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0b11111111, a, b);
+ let e = _mm_set_ps(1., 2., 10., 2.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_sqrt_round_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_sqrt_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_pd(1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_sqrt_round_sd() {
+ let src = _mm_set_pd(10., 11.);
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_mask_sqrt_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(src, 0, a, b);
+ let e = _mm_set_pd(1., 11.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_sqrt_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ src, 0b11111111, a, b,
+ );
+ let e = _mm_set_pd(1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_sqrt_round_sd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(3., 4.);
+ let r = _mm_maskz_sqrt_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r =
+ _mm_maskz_sqrt_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0b11111111, a, b);
+ let e = _mm_set_pd(1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_getexp_round_ss() {
+ let a = _mm_set1_ps(2.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_getexp_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm_set_ps(2., 2., 2., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_getexp_round_ss() {
+ let a = _mm_set1_ps(2.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_mask_getexp_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ let e = _mm_set_ps(2., 2., 2., 2.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_getexp_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, 0b11111111, a, b);
+ let e = _mm_set_ps(2., 2., 2., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_getexp_round_ss() {
+ let a = _mm_set1_ps(2.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_maskz_getexp_round_ss::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ let e = _mm_set_ps(2., 2., 2., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_getexp_round_ss::<_MM_FROUND_CUR_DIRECTION>(0b11111111, a, b);
+ let e = _mm_set_ps(2., 2., 2., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_getexp_round_sd() {
+ let a = _mm_set1_pd(2.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_getexp_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm_set_pd(2., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_getexp_round_sd() {
+ let a = _mm_set1_pd(2.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_mask_getexp_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ let e = _mm_set_pd(2., 2.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_getexp_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0b11111111, a, b);
+ let e = _mm_set_pd(2., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_getexp_round_sd() {
+ let a = _mm_set1_pd(2.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_maskz_getexp_round_sd::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ let e = _mm_set_pd(2., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_getexp_round_sd::<_MM_FROUND_CUR_DIRECTION>(0b11111111, a, b);
+ let e = _mm_set_pd(2., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_getmant_round_ss() {
+ let a = _mm_set1_ps(20.);
+ let b = _mm_set1_ps(10.);
+ let r =
+ _mm_getmant_round_ss::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC, _MM_FROUND_CUR_DIRECTION>(
+ a, b,
+ );
+ let e = _mm_set_ps(20., 20., 20., 1.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_getmant_round_ss() {
+ let a = _mm_set1_ps(20.);
+ let b = _mm_set1_ps(10.);
+ let r = _mm_mask_getmant_round_ss::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(a, 0, a, b);
+ let e = _mm_set_ps(20., 20., 20., 20.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_getmant_round_ss::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(a, 0b11111111, a, b);
+ let e = _mm_set_ps(20., 20., 20., 1.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_getmant_round_ss() {
+ let a = _mm_set1_ps(20.);
+ let b = _mm_set1_ps(10.);
+ let r = _mm_maskz_getmant_round_ss::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(0, a, b);
+ let e = _mm_set_ps(20., 20., 20., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_getmant_round_ss::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(0b11111111, a, b);
+ let e = _mm_set_ps(20., 20., 20., 1.25);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_getmant_round_sd() {
+ let a = _mm_set1_pd(20.);
+ let b = _mm_set1_pd(10.);
+ let r =
+ _mm_getmant_round_sd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC, _MM_FROUND_CUR_DIRECTION>(
+ a, b,
+ );
+ let e = _mm_set_pd(20., 1.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_getmant_round_sd() {
+ let a = _mm_set1_pd(20.);
+ let b = _mm_set1_pd(10.);
+ let r = _mm_mask_getmant_round_sd::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(a, 0, a, b);
+ let e = _mm_set_pd(20., 20.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_getmant_round_sd::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(a, 0b11111111, a, b);
+ let e = _mm_set_pd(20., 1.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_getmant_round_sd() {
+ let a = _mm_set1_pd(20.);
+ let b = _mm_set1_pd(10.);
+ let r = _mm_maskz_getmant_round_sd::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(0, a, b);
+ let e = _mm_set_pd(20., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_getmant_round_sd::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(0b11111111, a, b);
+ let e = _mm_set_pd(20., 1.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_roundscale_round_ss() {
+ let a = _mm_set1_ps(2.2);
+ let b = _mm_set1_ps(1.1);
+ let r = _mm_roundscale_round_ss::<0, _MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm_set_ps(2.2, 2.2, 2.2, 1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_roundscale_round_ss() {
+ let a = _mm_set1_ps(2.2);
+ let b = _mm_set1_ps(1.1);
+ let r = _mm_mask_roundscale_round_ss::<0, _MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ let e = _mm_set_ps(2.2, 2.2, 2.2, 2.2);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_roundscale_round_ss::<0, _MM_FROUND_CUR_DIRECTION>(a, 0b11111111, a, b);
+ let e = _mm_set_ps(2.2, 2.2, 2.2, 1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_roundscale_round_ss() {
+ let a = _mm_set1_ps(2.2);
+ let b = _mm_set1_ps(1.1);
+ let r = _mm_maskz_roundscale_round_ss::<0, _MM_FROUND_CUR_DIRECTION>(0, a, b);
+ let e = _mm_set_ps(2.2, 2.2, 2.2, 0.0);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_roundscale_round_ss::<0, _MM_FROUND_CUR_DIRECTION>(0b11111111, a, b);
+ let e = _mm_set_ps(2.2, 2.2, 2.2, 1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_roundscale_round_sd() {
+ let a = _mm_set1_pd(2.2);
+ let b = _mm_set1_pd(1.1);
+ let r = _mm_roundscale_round_sd::<0, _MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm_set_pd(2.2, 1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_roundscale_round_sd() {
+ let a = _mm_set1_pd(2.2);
+ let b = _mm_set1_pd(1.1);
+ let r = _mm_mask_roundscale_round_sd::<0, _MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ let e = _mm_set_pd(2.2, 2.2);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_roundscale_round_sd::<0, _MM_FROUND_CUR_DIRECTION>(a, 0b11111111, a, b);
+ let e = _mm_set_pd(2.2, 1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_roundscale_round_sd() {
+ let a = _mm_set1_pd(2.2);
+ let b = _mm_set1_pd(1.1);
+ let r = _mm_maskz_roundscale_round_sd::<0, _MM_FROUND_CUR_DIRECTION>(0, a, b);
+ let e = _mm_set_pd(2.2, 0.0);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_roundscale_round_sd::<0, _MM_FROUND_CUR_DIRECTION>(0b11111111, a, b);
+ let e = _mm_set_pd(2.2, 1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_scalef_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_scalef_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_ps(1., 1., 1., 8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_scalef_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(3.);
+ let r = _mm_mask_scalef_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ let e = _mm_set_ps(1., 1., 1., 1.);
+ assert_eq_m128(r, e);
+ let r = _mm_mask_scalef_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, a, b,
+ );
+ let e = _mm_set_ps(1., 1., 1., 8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_scalef_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(3.);
+ let r =
+ _mm_maskz_scalef_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_ps(1., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_scalef_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b,
+ );
+ let e = _mm_set_ps(1., 1., 1., 8.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_scalef_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_scalef_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_scalef_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_mask_scalef_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_scalef_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, a, b,
+ );
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_scalef_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(3.);
+ let r =
+ _mm_maskz_scalef_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_scalef_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b,
+ );
+ let e = _mm_set_pd(1., 8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fmadd_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_fmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm_set_ps(1., 1., 1., 5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fmadd_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask_fmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., 5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fmadd_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_maskz_fmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_fmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., 5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fmadd_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask3_fmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b11111111,
+ );
+ let e = _mm_set_ps(3., 3., 3., 5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fmadd_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_fmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm_set_pd(1., 5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fmadd_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask_fmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, b, c,
+ );
+ let e = _mm_set_pd(1., 5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fmadd_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_maskz_fmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_fmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b, c,
+ );
+ let e = _mm_set_pd(1., 5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fmadd_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask3_fmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b11111111,
+ );
+ let e = _mm_set_pd(3., 5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fmsub_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_fmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm_set_ps(1., 1., 1., -1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fmsub_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask_fmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., -1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fmsub_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_maskz_fmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_fmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., -1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fmsub_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask3_fmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b11111111,
+ );
+ let e = _mm_set_ps(3., 3., 3., -1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fmsub_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_fmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm_set_pd(1., -1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fmsub_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask_fmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, b, c,
+ );
+ let e = _mm_set_pd(1., -1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fmsub_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_maskz_fmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_fmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b, c,
+ );
+ let e = _mm_set_pd(1., -1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fmsub_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask3_fmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b11111111,
+ );
+ let e = _mm_set_pd(3., -1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fnmadd_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_fnmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm_set_ps(1., 1., 1., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fnmadd_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask_fnmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fnmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fnmadd_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_maskz_fnmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_fnmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fnmadd_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask3_fnmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fnmadd_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b11111111,
+ );
+ let e = _mm_set_ps(3., 3., 3., 1.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fnmadd_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_fnmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fnmadd_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask_fnmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fnmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, b, c,
+ );
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fnmadd_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_maskz_fnmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_fnmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b, c,
+ );
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fnmadd_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask3_fnmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fnmadd_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b11111111,
+ );
+ let e = _mm_set_pd(3., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fnmsub_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_fnmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm_set_ps(1., 1., 1., -5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fnmsub_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask_fnmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m128(r, a);
+ let r = _mm_mask_fnmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., -5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fnmsub_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_maskz_fnmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_fnmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b, c,
+ );
+ let e = _mm_set_ps(1., 1., 1., -5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fnmsub_round_ss() {
+ let a = _mm_set1_ps(1.);
+ let b = _mm_set1_ps(2.);
+ let c = _mm_set1_ps(3.);
+ let r = _mm_mask3_fnmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m128(r, c);
+ let r = _mm_mask3_fnmsub_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b11111111,
+ );
+ let e = _mm_set_ps(3., 3., 3., -5.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fnmsub_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_fnmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm_set_pd(1., -5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fnmsub_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask_fnmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fnmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, b, c,
+ );
+ let e = _mm_set_pd(1., -5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fnmsub_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_maskz_fnmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_fnmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b, c,
+ );
+ let e = _mm_set_pd(1., -5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask3_fnmsub_round_sd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let c = _mm_set1_pd(3.);
+ let r = _mm_mask3_fnmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fnmsub_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b11111111,
+ );
+ let e = _mm_set_pd(3., -5.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fixupimm_ss() {
+ let a = _mm_set_ps(0., 0., 0., f32::NAN);
+ let b = _mm_set1_ps(f32::MAX);
+ let c = _mm_set1_epi32(i32::MAX);
+ let r = _mm_fixupimm_ss::<5>(a, b, c);
+ let e = _mm_set_ps(0., 0., 0., -0.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fixupimm_ss() {
+ let a = _mm_set_ps(0., 0., 0., f32::NAN);
+ let b = _mm_set1_ps(f32::MAX);
+ let c = _mm_set1_epi32(i32::MAX);
+ let r = _mm_mask_fixupimm_ss::<5>(a, 0b11111111, b, c);
+ let e = _mm_set_ps(0., 0., 0., -0.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fixupimm_ss() {
+ let a = _mm_set_ps(0., 0., 0., f32::NAN);
+ let b = _mm_set1_ps(f32::MAX);
+ let c = _mm_set1_epi32(i32::MAX);
+ let r = _mm_maskz_fixupimm_ss::<5>(0b00000000, a, b, c);
+ let e = _mm_set_ps(0., 0., 0., 0.0);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_fixupimm_ss::<5>(0b11111111, a, b, c);
+ let e = _mm_set_ps(0., 0., 0., -0.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fixupimm_sd() {
+ let a = _mm_set_pd(0., f64::NAN);
+ let b = _mm_set1_pd(f64::MAX);
+ let c = _mm_set1_epi64x(i32::MAX as i64);
+ let r = _mm_fixupimm_sd::<5>(a, b, c);
+ let e = _mm_set_pd(0., -0.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fixupimm_sd() {
+ let a = _mm_set_pd(0., f64::NAN);
+ let b = _mm_set1_pd(f64::MAX);
+ let c = _mm_set1_epi64x(i32::MAX as i64);
+ let r = _mm_mask_fixupimm_sd::<5>(a, 0b11111111, b, c);
+ let e = _mm_set_pd(0., -0.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fixupimm_sd() {
+ let a = _mm_set_pd(0., f64::NAN);
+ let b = _mm_set1_pd(f64::MAX);
+ let c = _mm_set1_epi64x(i32::MAX as i64);
+ let r = _mm_maskz_fixupimm_sd::<5>(0b00000000, a, b, c);
+ let e = _mm_set_pd(0., 0.0);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_fixupimm_sd::<5>(0b11111111, a, b, c);
+ let e = _mm_set_pd(0., -0.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fixupimm_round_ss() {
+ let a = _mm_set_ps(1., 0., 0., f32::NAN);
+ let b = _mm_set1_ps(f32::MAX);
+ let c = _mm_set1_epi32(i32::MAX);
+ let r = _mm_fixupimm_round_ss::<5, _MM_FROUND_CUR_DIRECTION>(a, b, c);
+ let e = _mm_set_ps(1., 0., 0., -0.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fixupimm_round_ss() {
+ let a = _mm_set_ps(0., 0., 0., f32::NAN);
+ let b = _mm_set1_ps(f32::MAX);
+ let c = _mm_set1_epi32(i32::MAX);
+ let r = _mm_mask_fixupimm_round_ss::<5, _MM_FROUND_CUR_DIRECTION>(a, 0b11111111, b, c);
+ let e = _mm_set_ps(0., 0., 0., -0.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fixupimm_round_ss() {
+ let a = _mm_set_ps(0., 0., 0., f32::NAN);
+ let b = _mm_set1_ps(f32::MAX);
+ let c = _mm_set1_epi32(i32::MAX);
+ let r = _mm_maskz_fixupimm_round_ss::<5, _MM_FROUND_CUR_DIRECTION>(0b00000000, a, b, c);
+ let e = _mm_set_ps(0., 0., 0., 0.0);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_fixupimm_round_ss::<5, _MM_FROUND_CUR_DIRECTION>(0b11111111, a, b, c);
+ let e = _mm_set_ps(0., 0., 0., -0.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_fixupimm_round_sd() {
+ let a = _mm_set_pd(0., f64::NAN);
+ let b = _mm_set1_pd(f64::MAX);
+ let c = _mm_set1_epi64x(i32::MAX as i64);
+ let r = _mm_fixupimm_round_sd::<5, _MM_FROUND_CUR_DIRECTION>(a, b, c);
+ let e = _mm_set_pd(0., -0.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_fixupimm_round_sd() {
+ let a = _mm_set_pd(0., f64::NAN);
+ let b = _mm_set1_pd(f64::MAX);
+ let c = _mm_set1_epi64x(i32::MAX as i64);
+ let r = _mm_mask_fixupimm_round_sd::<5, _MM_FROUND_CUR_DIRECTION>(a, 0b11111111, b, c);
+ let e = _mm_set_pd(0., -0.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_fixupimm_round_sd() {
+ let a = _mm_set_pd(0., f64::NAN);
+ let b = _mm_set1_pd(f64::MAX);
+ let c = _mm_set1_epi64x(i32::MAX as i64);
+ let r = _mm_maskz_fixupimm_round_sd::<5, _MM_FROUND_CUR_DIRECTION>(0b00000000, a, b, c);
+ let e = _mm_set_pd(0., 0.0);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_fixupimm_round_sd::<5, _MM_FROUND_CUR_DIRECTION>(0b11111111, a, b, c);
+ let e = _mm_set_pd(0., -0.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_cvtss_sd() {
+ let a = _mm_set_pd(6., -7.5);
+ let b = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_mask_cvtss_sd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_cvtss_sd(a, 0b11111111, a, b);
+ let e = _mm_set_pd(6., -1.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_cvtss_sd() {
+ let a = _mm_set_pd(6., -7.5);
+ let b = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_maskz_cvtss_sd(0, a, b);
+ let e = _mm_set_pd(6., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_cvtss_sd(0b11111111, a, b);
+ let e = _mm_set_pd(6., -1.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_cvtsd_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b = _mm_set_pd(6., -7.5);
+ let r = _mm_mask_cvtsd_ss(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_cvtsd_ss(a, 0b11111111, a, b);
+ let e = _mm_set_ps(0., -0.5, 1., -7.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_cvtsd_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b = _mm_set_pd(6., -7.5);
+ let r = _mm_maskz_cvtsd_ss(0, a, b);
+ let e = _mm_set_ps(0., -0.5, 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_cvtsd_ss(0b11111111, a, b);
+ let e = _mm_set_ps(0., -0.5, 1., -7.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundss_sd() {
+ let a = _mm_set_pd(6., -7.5);
+ let b = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvt_roundss_sd::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm_set_pd(6., -1.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_cvt_roundss_sd() {
+ let a = _mm_set_pd(6., -7.5);
+ let b = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_mask_cvt_roundss_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_cvt_roundss_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0b11111111, a, b);
+ let e = _mm_set_pd(6., -1.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_cvt_roundss_sd() {
+ let a = _mm_set_pd(6., -7.5);
+ let b = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_maskz_cvt_roundss_sd::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ let e = _mm_set_pd(6., 0.);
+ assert_eq_m128d(r, e);
+ let r = _mm_maskz_cvt_roundss_sd::<_MM_FROUND_CUR_DIRECTION>(0b11111111, a, b);
+ let e = _mm_set_pd(6., -1.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundsd_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b = _mm_set_pd(6., -7.5);
+ let r = _mm_cvt_roundsd_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_ps(0., -0.5, 1., -7.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_mask_cvt_roundsd_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b = _mm_set_pd(6., -7.5);
+ let r = _mm_mask_cvt_roundsd_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, 0, a, b);
+ assert_eq_m128(r, a);
+ let r = _mm_mask_cvt_roundsd_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ a, 0b11111111, a, b,
+ );
+ let e = _mm_set_ps(0., -0.5, 1., -7.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_maskz_cvt_roundsd_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b = _mm_set_pd(6., -7.5);
+ let r = _mm_maskz_cvt_roundsd_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b);
+ let e = _mm_set_ps(0., -0.5, 1., 0.);
+ assert_eq_m128(r, e);
+ let r = _mm_maskz_cvt_roundsd_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(
+ 0b11111111, a, b,
+ );
+ let e = _mm_set_ps(0., -0.5, 1., -7.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundss_si32() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvt_roundss_si32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: i32 = -1;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundss_i32() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvt_roundss_i32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: i32 = -1;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundss_u32() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvt_roundss_u32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: u32 = u32::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtss_i32() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvtss_i32(a);
+ let e: i32 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtss_u32() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvtss_u32(a);
+ let e: u32 = u32::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundsd_si32() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvt_roundsd_si32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: i32 = -1;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundsd_i32() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvt_roundsd_i32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: i32 = -1;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundsd_u32() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvt_roundsd_u32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: u32 = u32::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtsd_i32() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvtsd_i32(a);
+ let e: i32 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtsd_u32() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvtsd_u32(a);
+ let e: u32 = u32::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundi32_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b: i32 = 9;
+ let r = _mm_cvt_roundi32_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_ps(0., -0.5, 1., 9.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundsi32_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b: i32 = 9;
+ let r = _mm_cvt_roundsi32_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_ps(0., -0.5, 1., 9.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundu32_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b: u32 = 9;
+ let r = _mm_cvt_roundu32_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_ps(0., -0.5, 1., 9.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvti32_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b: i32 = 9;
+ let r = _mm_cvti32_ss(a, b);
+ let e = _mm_set_ps(0., -0.5, 1., 9.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvti32_sd() {
+ let a = _mm_set_pd(1., -1.5);
+ let b: i32 = 9;
+ let r = _mm_cvti32_sd(a, b);
+ let e = _mm_set_pd(1., 9.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundss_si32() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvtt_roundss_si32::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: i32 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundss_i32() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvtt_roundss_i32::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: i32 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundss_u32() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvtt_roundss_u32::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: u32 = u32::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvttss_i32() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvttss_i32(a);
+ let e: i32 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvttss_u32() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvttss_u32(a);
+ let e: u32 = u32::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundsd_si32() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvtt_roundsd_si32::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: i32 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundsd_i32() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvtt_roundsd_i32::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: i32 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundsd_u32() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvtt_roundsd_u32::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: u32 = u32::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvttsd_i32() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvttsd_i32(a);
+ let e: i32 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvttsd_u32() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvttsd_u32(a);
+ let e: u32 = u32::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtu32_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b: u32 = 9;
+ let r = _mm_cvtu32_ss(a, b);
+ let e = _mm_set_ps(0., -0.5, 1., 9.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtu32_sd() {
+ let a = _mm_set_pd(1., -1.5);
+ let b: u32 = 9;
+ let r = _mm_cvtu32_sd(a, b);
+ let e = _mm_set_pd(1., 9.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_comi_round_ss() {
+ let a = _mm_set1_ps(2.2);
+ let b = _mm_set1_ps(1.1);
+ let r = _mm_comi_round_ss::<0, _MM_FROUND_CUR_DIRECTION>(a, b);
+ let e: i32 = 0;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_comi_round_sd() {
+ let a = _mm_set1_pd(2.2);
+ let b = _mm_set1_pd(1.1);
+ let r = _mm_comi_round_sd::<0, _MM_FROUND_CUR_DIRECTION>(a, b);
+ let e: i32 = 0;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtsi512_si32() {
+ let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm512_cvtsi512_si32(a);
+ let e: i32 = 1;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_shuffle_pd() {
+ let a = _mm512_setr_pd(1., 4., 5., 8., 1., 4., 5., 8.);
+ let b = _mm512_setr_pd(2., 3., 6., 7., 2., 3., 6., 7.);
+ let r = _mm512_shuffle_pd::<0b11_11_11_11>(a, b);
+ let e = _mm512_setr_pd(4., 3., 8., 7., 4., 3., 8., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_shuffle_pd() {
+ let a = _mm512_setr_pd(1., 4., 5., 8., 1., 4., 5., 8.);
+ let b = _mm512_setr_pd(2., 3., 6., 7., 2., 3., 6., 7.);
+ let r = _mm512_mask_shuffle_pd::<0b11_11_11_11>(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_shuffle_pd::<0b11_11_11_11>(a, 0b11111111, a, b);
+ let e = _mm512_setr_pd(4., 3., 8., 7., 4., 3., 8., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_shuffle_pd() {
+ let a = _mm512_setr_pd(1., 4., 5., 8., 1., 4., 5., 8.);
+ let b = _mm512_setr_pd(2., 3., 6., 7., 2., 3., 6., 7.);
+ let r = _mm512_maskz_shuffle_pd::<0b11_11_11_11>(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_shuffle_pd::<0b11_11_11_11>(0b00001111, a, b);
+ let e = _mm512_setr_pd(4., 3., 8., 7., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_expandloadu_epi32() {
+ let src = _mm512_set1_epi32(42);
+ let a = &[1_i32, 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 = _mm512_mask_expandloadu_epi32(src, m, black_box(p));
+ let e = _mm512_set_epi32(8, 7, 6, 42, 5, 42, 42, 42, 4, 3, 42, 42, 2, 42, 1, 42);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_expandloadu_epi32() {
+ let a = &[1_i32, 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 = _mm512_maskz_expandloadu_epi32(m, black_box(p));
+ let e = _mm512_set_epi32(8, 7, 6, 0, 5, 0, 0, 0, 4, 3, 0, 0, 2, 0, 1, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_expandloadu_epi32() {
+ let src = _mm256_set1_epi32(42);
+ let a = &[1_i32, 2, 3, 4, 5, 6, 7, 8];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm256_mask_expandloadu_epi32(src, m, black_box(p));
+ let e = _mm256_set_epi32(4, 3, 2, 42, 1, 42, 42, 42);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_expandloadu_epi32() {
+ let a = &[1_i32, 2, 3, 4, 5, 6, 7, 8];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm256_maskz_expandloadu_epi32(m, black_box(p));
+ let e = _mm256_set_epi32(4, 3, 2, 0, 1, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_expandloadu_epi32() {
+ let src = _mm_set1_epi32(42);
+ let a = &[1_i32, 2, 3, 4];
+ let p = a.as_ptr();
+ let m = 0b11111000;
+ let r = _mm_mask_expandloadu_epi32(src, m, black_box(p));
+ let e = _mm_set_epi32(1, 42, 42, 42);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_expandloadu_epi32() {
+ let a = &[1_i32, 2, 3, 4];
+ let p = a.as_ptr();
+ let m = 0b11111000;
+ let r = _mm_maskz_expandloadu_epi32(m, black_box(p));
+ let e = _mm_set_epi32(1, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_expandloadu_epi64() {
+ let src = _mm512_set1_epi64(42);
+ let a = &[1_i64, 2, 3, 4, 5, 6, 7, 8];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm512_mask_expandloadu_epi64(src, m, black_box(p));
+ let e = _mm512_set_epi64(4, 3, 2, 42, 1, 42, 42, 42);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_expandloadu_epi64() {
+ let a = &[1_i64, 2, 3, 4, 5, 6, 7, 8];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm512_maskz_expandloadu_epi64(m, black_box(p));
+ let e = _mm512_set_epi64(4, 3, 2, 0, 1, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_expandloadu_epi64() {
+ let src = _mm256_set1_epi64x(42);
+ let a = &[1_i64, 2, 3, 4];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm256_mask_expandloadu_epi64(src, m, black_box(p));
+ let e = _mm256_set_epi64x(1, 42, 42, 42);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_expandloadu_epi64() {
+ let a = &[1_i64, 2, 3, 4];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm256_maskz_expandloadu_epi64(m, black_box(p));
+ let e = _mm256_set_epi64x(1, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_expandloadu_epi64() {
+ let src = _mm_set1_epi64x(42);
+ let a = &[1_i64, 2];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm_mask_expandloadu_epi64(src, m, black_box(p));
+ let e = _mm_set_epi64x(42, 42);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_expandloadu_epi64() {
+ let a = &[1_i64, 2];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm_maskz_expandloadu_epi64(m, black_box(p));
+ let e = _mm_set_epi64x(0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_expandloadu_ps() {
+ let src = _mm512_set1_ps(42.);
+ let a = &[
+ 1.0f32, 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 = _mm512_mask_expandloadu_ps(src, m, black_box(p));
+ let e = _mm512_set_ps(
+ 8., 7., 6., 42., 5., 42., 42., 42., 4., 3., 42., 42., 2., 42., 1., 42.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_expandloadu_ps() {
+ let a = &[
+ 1.0f32, 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 = _mm512_maskz_expandloadu_ps(m, black_box(p));
+ let e = _mm512_set_ps(
+ 8., 7., 6., 0., 5., 0., 0., 0., 4., 3., 0., 0., 2., 0., 1., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_expandloadu_ps() {
+ let src = _mm256_set1_ps(42.);
+ let a = &[1.0f32, 2., 3., 4., 5., 6., 7., 8.];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm256_mask_expandloadu_ps(src, m, black_box(p));
+ let e = _mm256_set_ps(4., 3., 2., 42., 1., 42., 42., 42.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_expandloadu_ps() {
+ let a = &[1.0f32, 2., 3., 4., 5., 6., 7., 8.];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm256_maskz_expandloadu_ps(m, black_box(p));
+ let e = _mm256_set_ps(4., 3., 2., 0., 1., 0., 0., 0.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_expandloadu_ps() {
+ let src = _mm_set1_ps(42.);
+ let a = &[1.0f32, 2., 3., 4.];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm_mask_expandloadu_ps(src, m, black_box(p));
+ let e = _mm_set_ps(1., 42., 42., 42.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_expandloadu_ps() {
+ let a = &[1.0f32, 2., 3., 4.];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm_maskz_expandloadu_ps(m, black_box(p));
+ let e = _mm_set_ps(1., 0., 0., 0.);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_expandloadu_pd() {
+ let src = _mm512_set1_pd(42.);
+ let a = &[1.0f64, 2., 3., 4., 5., 6., 7., 8.];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm512_mask_expandloadu_pd(src, m, black_box(p));
+ let e = _mm512_set_pd(4., 3., 2., 42., 1., 42., 42., 42.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_expandloadu_pd() {
+ let a = &[1.0f64, 2., 3., 4., 5., 6., 7., 8.];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm512_maskz_expandloadu_pd(m, black_box(p));
+ let e = _mm512_set_pd(4., 3., 2., 0., 1., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_expandloadu_pd() {
+ let src = _mm256_set1_pd(42.);
+ let a = &[1.0f64, 2., 3., 4.];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm256_mask_expandloadu_pd(src, m, black_box(p));
+ let e = _mm256_set_pd(1., 42., 42., 42.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_expandloadu_pd() {
+ let a = &[1.0f64, 2., 3., 4.];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm256_maskz_expandloadu_pd(m, black_box(p));
+ let e = _mm256_set_pd(1., 0., 0., 0.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_expandloadu_pd() {
+ let src = _mm_set1_pd(42.);
+ let a = &[1.0f64, 2.];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm_mask_expandloadu_pd(src, m, black_box(p));
+ let e = _mm_set_pd(42., 42.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_expandloadu_pd() {
+ let a = &[1.0f64, 2.];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm_maskz_expandloadu_pd(m, black_box(p));
+ let e = _mm_set_pd(0., 0.);
+ assert_eq_m128d(r, e);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512gfni.rs b/library/stdarch/crates/core_arch/src/x86/avx512gfni.rs
new file mode 100644
index 000000000..d8ac5c29c
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512gfni.rs
@@ -0,0 +1,1492 @@
+//! Galois Field New Instructions (GFNI)
+//!
+//! The intrinsics here correspond to those in the `immintrin.h` C header.
+//!
+//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
+//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref].
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+
+use crate::core_arch::simd::i8x16;
+use crate::core_arch::simd::i8x32;
+use crate::core_arch::simd::i8x64;
+use crate::core_arch::simd_llvm::simd_select_bitmask;
+use crate::core_arch::x86::__m128i;
+use crate::core_arch::x86::__m256i;
+use crate::core_arch::x86::__m512i;
+use crate::core_arch::x86::__mmask16;
+use crate::core_arch::x86::__mmask32;
+use crate::core_arch::x86::__mmask64;
+use crate::core_arch::x86::_mm256_setzero_si256;
+use crate::core_arch::x86::_mm512_setzero_si512;
+use crate::core_arch::x86::_mm_setzero_si128;
+use crate::core_arch::x86::m128iExt;
+use crate::core_arch::x86::m256iExt;
+use crate::core_arch::x86::m512iExt;
+use crate::mem::transmute;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.vgf2p8affineinvqb.512"]
+ fn vgf2p8affineinvqb_512(x: i8x64, a: i8x64, imm8: u8) -> i8x64;
+ #[link_name = "llvm.x86.vgf2p8affineinvqb.256"]
+ fn vgf2p8affineinvqb_256(x: i8x32, a: i8x32, imm8: u8) -> i8x32;
+ #[link_name = "llvm.x86.vgf2p8affineinvqb.128"]
+ fn vgf2p8affineinvqb_128(x: i8x16, a: i8x16, imm8: u8) -> i8x16;
+ #[link_name = "llvm.x86.vgf2p8affineqb.512"]
+ fn vgf2p8affineqb_512(x: i8x64, a: i8x64, imm8: u8) -> i8x64;
+ #[link_name = "llvm.x86.vgf2p8affineqb.256"]
+ fn vgf2p8affineqb_256(x: i8x32, a: i8x32, imm8: u8) -> i8x32;
+ #[link_name = "llvm.x86.vgf2p8affineqb.128"]
+ fn vgf2p8affineqb_128(x: i8x16, a: i8x16, imm8: u8) -> i8x16;
+ #[link_name = "llvm.x86.vgf2p8mulb.512"]
+ fn vgf2p8mulb_512(a: i8x64, b: i8x64) -> i8x64;
+ #[link_name = "llvm.x86.vgf2p8mulb.256"]
+ fn vgf2p8mulb_256(a: i8x32, b: i8x32) -> i8x32;
+ #[link_name = "llvm.x86.vgf2p8mulb.128"]
+ fn vgf2p8mulb_128(a: i8x16, b: i8x16) -> i8x16;
+}
+
+// LLVM requires AVX512BW for a lot of these instructions, see
+// https://github.com/llvm/llvm-project/blob/release/9.x/clang/include/clang/Basic/BuiltinsX86.def#L457
+// however our tests also require the target feature list to match Intel's
+// which *doesn't* require AVX512BW but only AVX512F, so we added the redundant AVX512F
+// requirement (for now)
+// also see
+// https://github.com/llvm/llvm-project/blob/release/9.x/clang/lib/Headers/gfniintrin.h
+// for forcing GFNI, BW and optionally VL extension
+
+/// Performs a multiplication in GF(2^8) on the packed bytes.
+/// The field is in polynomial representation with the reduction polynomial
+/// x^8 + x^4 + x^3 + x + 1.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_gf2p8mul_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512f")]
+#[cfg_attr(test, assert_instr(vgf2p8mulb))]
+pub unsafe fn _mm512_gf2p8mul_epi8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vgf2p8mulb_512(a.as_i8x64(), b.as_i8x64()))
+}
+
+/// Performs a multiplication in GF(2^8) on the packed bytes.
+/// The field is in polynomial representation with the reduction polynomial
+/// x^8 + x^4 + x^3 + x + 1.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_gf2p8mul_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512f")]
+#[cfg_attr(test, assert_instr(vgf2p8mulb))]
+pub unsafe fn _mm512_mask_gf2p8mul_epi8(
+ src: __m512i,
+ k: __mmask64,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ transmute(simd_select_bitmask(
+ k,
+ vgf2p8mulb_512(a.as_i8x64(), b.as_i8x64()),
+ src.as_i8x64(),
+ ))
+}
+
+/// Performs a multiplication in GF(2^8) on the packed bytes.
+/// The field is in polynomial representation with the reduction polynomial
+/// x^8 + x^4 + x^3 + x + 1.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_gf2p8mul_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512f")]
+#[cfg_attr(test, assert_instr(vgf2p8mulb))]
+pub unsafe fn _mm512_maskz_gf2p8mul_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
+ let zero = _mm512_setzero_si512().as_i8x64();
+ transmute(simd_select_bitmask(
+ k,
+ vgf2p8mulb_512(a.as_i8x64(), b.as_i8x64()),
+ zero,
+ ))
+}
+
+/// Performs a multiplication in GF(2^8) on the packed bytes.
+/// The field is in polynomial representation with the reduction polynomial
+/// x^8 + x^4 + x^3 + x + 1.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_gf2p8mul_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8mulb))]
+pub unsafe fn _mm256_gf2p8mul_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(vgf2p8mulb_256(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// Performs a multiplication in GF(2^8) on the packed bytes.
+/// The field is in polynomial representation with the reduction polynomial
+/// x^8 + x^4 + x^3 + x + 1.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_gf2p8mul_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8mulb))]
+pub unsafe fn _mm256_mask_gf2p8mul_epi8(
+ src: __m256i,
+ k: __mmask32,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ transmute(simd_select_bitmask(
+ k,
+ vgf2p8mulb_256(a.as_i8x32(), b.as_i8x32()),
+ src.as_i8x32(),
+ ))
+}
+
+/// Performs a multiplication in GF(2^8) on the packed bytes.
+/// The field is in polynomial representation with the reduction polynomial
+/// x^8 + x^4 + x^3 + x + 1.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_gf2p8mul_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8mulb))]
+pub unsafe fn _mm256_maskz_gf2p8mul_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
+ let zero = _mm256_setzero_si256().as_i8x32();
+ transmute(simd_select_bitmask(
+ k,
+ vgf2p8mulb_256(a.as_i8x32(), b.as_i8x32()),
+ zero,
+ ))
+}
+
+/// Performs a multiplication in GF(2^8) on the packed bytes.
+/// The field is in polynomial representation with the reduction polynomial
+/// x^8 + x^4 + x^3 + x + 1.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_gf2p8mul_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8mulb))]
+pub unsafe fn _mm_gf2p8mul_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(vgf2p8mulb_128(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Performs a multiplication in GF(2^8) on the packed bytes.
+/// The field is in polynomial representation with the reduction polynomial
+/// x^8 + x^4 + x^3 + x + 1.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_gf2p8mul_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8mulb))]
+pub unsafe fn _mm_mask_gf2p8mul_epi8(
+ src: __m128i,
+ k: __mmask16,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ transmute(simd_select_bitmask(
+ k,
+ vgf2p8mulb_128(a.as_i8x16(), b.as_i8x16()),
+ src.as_i8x16(),
+ ))
+}
+
+/// Performs a multiplication in GF(2^8) on the packed bytes.
+/// The field is in polynomial representation with the reduction polynomial
+/// x^8 + x^4 + x^3 + x + 1.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_gf2p8mul_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8mulb))]
+pub unsafe fn _mm_maskz_gf2p8mul_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
+ let zero = _mm_setzero_si128().as_i8x16();
+ transmute(simd_select_bitmask(
+ k,
+ vgf2p8mulb_128(a.as_i8x16(), b.as_i8x16()),
+ zero,
+ ))
+}
+
+/// Performs an affine transformation on the packed bytes in x.
+/// That is computes a*x+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_gf2p8affine_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512f")]
+#[cfg_attr(test, assert_instr(vgf2p8affineqb, B = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_gf2p8affine_epi64_epi8<const B: i32>(x: __m512i, a: __m512i) -> __m512i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x64();
+ let a = a.as_i8x64();
+ let r = vgf2p8affineqb_512(x, a, b);
+ transmute(r)
+}
+
+/// Performs an affine transformation on the packed bytes in x.
+/// That is computes a*x+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_gf2p8affine_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512f")]
+#[cfg_attr(test, assert_instr(vgf2p8affineqb, B = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_gf2p8affine_epi64_epi8<const B: i32>(
+ k: __mmask64,
+ x: __m512i,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let zero = _mm512_setzero_si512().as_i8x64();
+ let x = x.as_i8x64();
+ let a = a.as_i8x64();
+ let r = vgf2p8affineqb_512(x, a, b);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Performs an affine transformation on the packed bytes in x.
+/// That is computes a*x+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_gf2p8affine_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512f")]
+#[cfg_attr(test, assert_instr(vgf2p8affineqb, B = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_gf2p8affine_epi64_epi8<const B: i32>(
+ src: __m512i,
+ k: __mmask64,
+ x: __m512i,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x64();
+ let a = a.as_i8x64();
+ let r = vgf2p8affineqb_512(x, a, b);
+ transmute(simd_select_bitmask(k, r, src.as_i8x64()))
+}
+
+/// Performs an affine transformation on the packed bytes in x.
+/// That is computes a*x+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_gf2p8affine_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineqb, B = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_gf2p8affine_epi64_epi8<const B: i32>(x: __m256i, a: __m256i) -> __m256i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x32();
+ let a = a.as_i8x32();
+ let r = vgf2p8affineqb_256(x, a, b);
+ transmute(r)
+}
+
+/// Performs an affine transformation on the packed bytes in x.
+/// That is computes a*x+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_gf2p8affine_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineqb, B = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_gf2p8affine_epi64_epi8<const B: i32>(
+ k: __mmask32,
+ x: __m256i,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let zero = _mm256_setzero_si256().as_i8x32();
+ let x = x.as_i8x32();
+ let a = a.as_i8x32();
+ let r = vgf2p8affineqb_256(x, a, b);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Performs an affine transformation on the packed bytes in x.
+/// That is computes a*x+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_gf2p8affine_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineqb, B = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_gf2p8affine_epi64_epi8<const B: i32>(
+ src: __m256i,
+ k: __mmask32,
+ x: __m256i,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x32();
+ let a = a.as_i8x32();
+ let r = vgf2p8affineqb_256(x, a, b);
+ transmute(simd_select_bitmask(k, r, src.as_i8x32()))
+}
+
+/// Performs an affine transformation on the packed bytes in x.
+/// That is computes a*x+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_gf2p8affine_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineqb, B = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_gf2p8affine_epi64_epi8<const B: i32>(x: __m128i, a: __m128i) -> __m128i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x16();
+ let a = a.as_i8x16();
+ let r = vgf2p8affineqb_128(x, a, b);
+ transmute(r)
+}
+
+/// Performs an affine transformation on the packed bytes in x.
+/// That is computes a*x+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_gf2p8affine_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineqb, B = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_gf2p8affine_epi64_epi8<const B: i32>(
+ k: __mmask16,
+ x: __m128i,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let zero = _mm_setzero_si128().as_i8x16();
+ let x = x.as_i8x16();
+ let a = a.as_i8x16();
+ let r = vgf2p8affineqb_128(x, a, b);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Performs an affine transformation on the packed bytes in x.
+/// That is computes a*x+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_gf2p8affine_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineqb, B = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_gf2p8affine_epi64_epi8<const B: i32>(
+ src: __m128i,
+ k: __mmask16,
+ x: __m128i,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x16();
+ let a = a.as_i8x16();
+ let r = vgf2p8affineqb_128(x, a, b);
+ transmute(simd_select_bitmask(k, r, src.as_i8x16()))
+}
+
+/// Performs an affine transformation on the inverted packed bytes in x.
+/// That is computes a*inv(x)+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// The inverse of a byte is defined with respect to the reduction polynomial x^8+x^4+x^3+x+1.
+/// The inverse of 0 is 0.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_gf2p8affineinv_epi64_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512f")]
+#[cfg_attr(test, assert_instr(vgf2p8affineinvqb, B = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_gf2p8affineinv_epi64_epi8<const B: i32>(x: __m512i, a: __m512i) -> __m512i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x64();
+ let a = a.as_i8x64();
+ let r = vgf2p8affineinvqb_512(x, a, b);
+ transmute(r)
+}
+
+/// Performs an affine transformation on the inverted packed bytes in x.
+/// That is computes a*inv(x)+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// The inverse of a byte is defined with respect to the reduction polynomial x^8+x^4+x^3+x+1.
+/// The inverse of 0 is 0.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_gf2p8affineinv_epi64_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512f")]
+#[cfg_attr(test, assert_instr(vgf2p8affineinvqb, B = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_gf2p8affineinv_epi64_epi8<const B: i32>(
+ k: __mmask64,
+ x: __m512i,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let zero = _mm512_setzero_si512().as_i8x64();
+ let x = x.as_i8x64();
+ let a = a.as_i8x64();
+ let r = vgf2p8affineinvqb_512(x, a, b);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Performs an affine transformation on the inverted packed bytes in x.
+/// That is computes a*inv(x)+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// The inverse of a byte is defined with respect to the reduction polynomial x^8+x^4+x^3+x+1.
+/// The inverse of 0 is 0.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_gf2p8affineinv_epi64_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512f")]
+#[cfg_attr(test, assert_instr(vgf2p8affineinvqb, B = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_gf2p8affineinv_epi64_epi8<const B: i32>(
+ src: __m512i,
+ k: __mmask64,
+ x: __m512i,
+ a: __m512i,
+) -> __m512i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x64();
+ let a = a.as_i8x64();
+ let r = vgf2p8affineinvqb_512(x, a, b);
+ transmute(simd_select_bitmask(k, r, src.as_i8x64()))
+}
+
+/// Performs an affine transformation on the inverted packed bytes in x.
+/// That is computes a*inv(x)+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// The inverse of a byte is defined with respect to the reduction polynomial x^8+x^4+x^3+x+1.
+/// The inverse of 0 is 0.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_gf2p8affineinv_epi64_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineinvqb, B = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_gf2p8affineinv_epi64_epi8<const B: i32>(x: __m256i, a: __m256i) -> __m256i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x32();
+ let a = a.as_i8x32();
+ let r = vgf2p8affineinvqb_256(x, a, b);
+ transmute(r)
+}
+
+/// Performs an affine transformation on the inverted packed bytes in x.
+/// That is computes a*inv(x)+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// The inverse of a byte is defined with respect to the reduction polynomial x^8+x^4+x^3+x+1.
+/// The inverse of 0 is 0.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_gf2p8affineinv_epi64_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineinvqb, B = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_gf2p8affineinv_epi64_epi8<const B: i32>(
+ k: __mmask32,
+ x: __m256i,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let zero = _mm256_setzero_si256().as_i8x32();
+ let x = x.as_i8x32();
+ let a = a.as_i8x32();
+ let r = vgf2p8affineinvqb_256(x, a, b);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Performs an affine transformation on the inverted packed bytes in x.
+/// That is computes a*inv(x)+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// The inverse of a byte is defined with respect to the reduction polynomial x^8+x^4+x^3+x+1.
+/// The inverse of 0 is 0.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_gf2p8affineinv_epi64_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineinvqb, B = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_gf2p8affineinv_epi64_epi8<const B: i32>(
+ src: __m256i,
+ k: __mmask32,
+ x: __m256i,
+ a: __m256i,
+) -> __m256i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x32();
+ let a = a.as_i8x32();
+ let r = vgf2p8affineinvqb_256(x, a, b);
+ transmute(simd_select_bitmask(k, r, src.as_i8x32()))
+}
+
+/// Performs an affine transformation on the inverted packed bytes in x.
+/// That is computes a*inv(x)+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// The inverse of a byte is defined with respect to the reduction polynomial x^8+x^4+x^3+x+1.
+/// The inverse of 0 is 0.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_gf2p8affineinv_epi64_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineinvqb, B = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_gf2p8affineinv_epi64_epi8<const B: i32>(x: __m128i, a: __m128i) -> __m128i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x16();
+ let a = a.as_i8x16();
+ let r = vgf2p8affineinvqb_128(x, a, b);
+ transmute(r)
+}
+
+/// Performs an affine transformation on the inverted packed bytes in x.
+/// That is computes a*inv(x)+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// The inverse of a byte is defined with respect to the reduction polynomial x^8+x^4+x^3+x+1.
+/// The inverse of 0 is 0.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_gf2p8affineinv_epi64_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineinvqb, B = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_gf2p8affineinv_epi64_epi8<const B: i32>(
+ k: __mmask16,
+ x: __m128i,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let zero = _mm_setzero_si128().as_i8x16();
+ let x = x.as_i8x16();
+ let a = a.as_i8x16();
+ let r = vgf2p8affineinvqb_128(x, a, b);
+ transmute(simd_select_bitmask(k, r, zero))
+}
+
+/// Performs an affine transformation on the inverted packed bytes in x.
+/// That is computes a*inv(x)+b over the Galois Field 2^8 for each packed byte with a being a 8x8 bit matrix
+/// and b being a constant 8-bit immediate value.
+/// The inverse of a byte is defined with respect to the reduction polynomial x^8+x^4+x^3+x+1.
+/// The inverse of 0 is 0.
+/// Each pack of 8 bytes in x is paired with the 64-bit word at the same position in a.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_gf2p8affineinv_epi64_epi8)
+#[inline]
+#[target_feature(enable = "avx512gfni,avx512bw,avx512vl")]
+#[cfg_attr(test, assert_instr(vgf2p8affineinvqb, B = 0))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_gf2p8affineinv_epi64_epi8<const B: i32>(
+ src: __m128i,
+ k: __mmask16,
+ x: __m128i,
+ a: __m128i,
+) -> __m128i {
+ static_assert_imm8!(B);
+ let b = B as u8;
+ let x = x.as_i8x16();
+ let a = a.as_i8x16();
+ let r = vgf2p8affineinvqb_128(x, a, b);
+ transmute(simd_select_bitmask(k, r, src.as_i8x16()))
+}
+
+#[cfg(test)]
+mod tests {
+ // The constants in the tests below are just bit patterns. They should not
+ // be interpreted as integers; signedness does not make sense for them, but
+ // __mXXXi happens to be defined in terms of signed integers.
+ #![allow(overflowing_literals)]
+
+ use core::hint::black_box;
+ use core::intrinsics::size_of;
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ fn mulbyte(left: u8, right: u8) -> u8 {
+ // this implementation follows the description in
+ // https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_gf2p8mul_epi8
+ const REDUCTION_POLYNOMIAL: u16 = 0x11b;
+ let left: u16 = left.into();
+ let right: u16 = right.into();
+ let mut carryless_product: u16 = 0;
+
+ // Carryless multiplication
+ for i in 0..8 {
+ if ((left >> i) & 0x01) != 0 {
+ carryless_product ^= right << i;
+ }
+ }
+
+ // reduction, adding in "0" where appropriate to clear out high bits
+ // note that REDUCTION_POLYNOMIAL is zero in this context
+ for i in (8..=14).rev() {
+ if ((carryless_product >> i) & 0x01) != 0 {
+ carryless_product ^= REDUCTION_POLYNOMIAL << (i - 8);
+ }
+ }
+
+ carryless_product as u8
+ }
+
+ const NUM_TEST_WORDS_512: usize = 4;
+ const NUM_TEST_WORDS_256: usize = NUM_TEST_WORDS_512 * 2;
+ const NUM_TEST_WORDS_128: usize = NUM_TEST_WORDS_256 * 2;
+ const NUM_TEST_ENTRIES: usize = NUM_TEST_WORDS_512 * 64;
+ const NUM_TEST_WORDS_64: usize = NUM_TEST_WORDS_128 * 2;
+ const NUM_BYTES: usize = 256;
+ const NUM_BYTES_WORDS_128: usize = NUM_BYTES / 16;
+ const NUM_BYTES_WORDS_256: usize = NUM_BYTES_WORDS_128 / 2;
+ const NUM_BYTES_WORDS_512: usize = NUM_BYTES_WORDS_256 / 2;
+
+ fn parity(input: u8) -> u8 {
+ let mut accumulator = 0;
+ for i in 0..8 {
+ accumulator ^= (input >> i) & 0x01;
+ }
+ accumulator
+ }
+
+ fn mat_vec_multiply_affine(matrix: u64, x: u8, b: u8) -> u8 {
+ // this implementation follows the description in
+ // https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_gf2p8affine_epi64_epi8
+ let mut accumulator = 0;
+
+ for bit in 0..8 {
+ accumulator |= parity(x & matrix.to_le_bytes()[bit]) << (7 - bit);
+ }
+
+ accumulator ^ b
+ }
+
+ fn generate_affine_mul_test_data(
+ immediate: u8,
+ ) -> (
+ [u64; NUM_TEST_WORDS_64],
+ [u8; NUM_TEST_ENTRIES],
+ [u8; NUM_TEST_ENTRIES],
+ ) {
+ let mut left: [u64; NUM_TEST_WORDS_64] = [0; NUM_TEST_WORDS_64];
+ let mut right: [u8; NUM_TEST_ENTRIES] = [0; NUM_TEST_ENTRIES];
+ let mut result: [u8; NUM_TEST_ENTRIES] = [0; NUM_TEST_ENTRIES];
+
+ for i in 0..NUM_TEST_WORDS_64 {
+ left[i] = (i as u64) * 103 * 101;
+ for j in 0..8 {
+ let j64 = j as u64;
+ right[i * 8 + j] = ((left[i] + j64) % 256) as u8;
+ result[i * 8 + j] = mat_vec_multiply_affine(left[i], right[i * 8 + j], immediate);
+ }
+ }
+
+ (left, right, result)
+ }
+
+ fn generate_inv_tests_data() -> ([u8; NUM_BYTES], [u8; NUM_BYTES]) {
+ let mut input: [u8; NUM_BYTES] = [0; NUM_BYTES];
+ let mut result: [u8; NUM_BYTES] = [0; NUM_BYTES];
+
+ for i in 0..NUM_BYTES {
+ input[i] = (i % 256) as u8;
+ result[i] = if i == 0 { 0 } else { 1 };
+ }
+
+ (input, result)
+ }
+
+ const AES_S_BOX: [u8; NUM_BYTES] = [
+ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab,
+ 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4,
+ 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71,
+ 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2,
+ 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6,
+ 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb,
+ 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45,
+ 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5,
+ 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44,
+ 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a,
+ 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49,
+ 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d,
+ 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25,
+ 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e,
+ 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1,
+ 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
+ 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb,
+ 0x16,
+ ];
+
+ fn generate_byte_mul_test_data() -> (
+ [u8; NUM_TEST_ENTRIES],
+ [u8; NUM_TEST_ENTRIES],
+ [u8; NUM_TEST_ENTRIES],
+ ) {
+ let mut left: [u8; NUM_TEST_ENTRIES] = [0; NUM_TEST_ENTRIES];
+ let mut right: [u8; NUM_TEST_ENTRIES] = [0; NUM_TEST_ENTRIES];
+ let mut result: [u8; NUM_TEST_ENTRIES] = [0; NUM_TEST_ENTRIES];
+
+ for i in 0..NUM_TEST_ENTRIES {
+ left[i] = (i % 256) as u8;
+ right[i] = left[i].wrapping_mul(101);
+ result[i] = mulbyte(left[i], right[i]);
+ }
+
+ (left, right, result)
+ }
+
+ #[target_feature(enable = "sse2")]
+ unsafe fn load_m128i_word<T>(data: &[T], word_index: usize) -> __m128i {
+ let byte_offset = word_index * 16 / size_of::<T>();
+ let pointer = data.as_ptr().offset(byte_offset as isize) as *const __m128i;
+ _mm_loadu_si128(black_box(pointer))
+ }
+
+ #[target_feature(enable = "avx")]
+ unsafe fn load_m256i_word<T>(data: &[T], word_index: usize) -> __m256i {
+ let byte_offset = word_index * 32 / size_of::<T>();
+ let pointer = data.as_ptr().offset(byte_offset as isize) as *const __m256i;
+ _mm256_loadu_si256(black_box(pointer))
+ }
+
+ #[target_feature(enable = "avx512f")]
+ unsafe fn load_m512i_word<T>(data: &[T], word_index: usize) -> __m512i {
+ let byte_offset = word_index * 64 / size_of::<T>();
+ let pointer = data.as_ptr().offset(byte_offset as isize) as *const i32;
+ _mm512_loadu_si512(black_box(pointer))
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw")]
+ unsafe fn test_mm512_gf2p8mul_epi8() {
+ let (left, right, expected) = generate_byte_mul_test_data();
+
+ for i in 0..NUM_TEST_WORDS_512 {
+ let left = load_m512i_word(&left, i);
+ let right = load_m512i_word(&right, i);
+ let expected = load_m512i_word(&expected, i);
+ let result = _mm512_gf2p8mul_epi8(left, right);
+ assert_eq_m512i(result, expected);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw")]
+ unsafe fn test_mm512_maskz_gf2p8mul_epi8() {
+ let (left, right, _expected) = generate_byte_mul_test_data();
+
+ for i in 0..NUM_TEST_WORDS_512 {
+ let left = load_m512i_word(&left, i);
+ let right = load_m512i_word(&right, i);
+ let result_zero = _mm512_maskz_gf2p8mul_epi8(0, left, right);
+ assert_eq_m512i(result_zero, _mm512_setzero_si512());
+ let mask_bytes: __mmask64 = 0x0F_0F_0F_0F_FF_FF_00_00;
+ let mask_words: __mmask16 = 0b01_01_01_01_11_11_00_00;
+ let expected_result = _mm512_gf2p8mul_epi8(left, right);
+ let result_masked = _mm512_maskz_gf2p8mul_epi8(mask_bytes, left, right);
+ let expected_masked =
+ _mm512_mask_blend_epi32(mask_words, _mm512_setzero_si512(), expected_result);
+ assert_eq_m512i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw")]
+ unsafe fn test_mm512_mask_gf2p8mul_epi8() {
+ let (left, right, _expected) = generate_byte_mul_test_data();
+
+ for i in 0..NUM_TEST_WORDS_512 {
+ let left = load_m512i_word(&left, i);
+ let right = load_m512i_word(&right, i);
+ let result_left = _mm512_mask_gf2p8mul_epi8(left, 0, left, right);
+ assert_eq_m512i(result_left, left);
+ let mask_bytes: __mmask64 = 0x0F_0F_0F_0F_FF_FF_00_00;
+ let mask_words: __mmask16 = 0b01_01_01_01_11_11_00_00;
+ let expected_result = _mm512_gf2p8mul_epi8(left, right);
+ let result_masked = _mm512_mask_gf2p8mul_epi8(left, mask_bytes, left, right);
+ let expected_masked = _mm512_mask_blend_epi32(mask_words, left, expected_result);
+ assert_eq_m512i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm256_gf2p8mul_epi8() {
+ let (left, right, expected) = generate_byte_mul_test_data();
+
+ for i in 0..NUM_TEST_WORDS_256 {
+ let left = load_m256i_word(&left, i);
+ let right = load_m256i_word(&right, i);
+ let expected = load_m256i_word(&expected, i);
+ let result = _mm256_gf2p8mul_epi8(left, right);
+ assert_eq_m256i(result, expected);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm256_maskz_gf2p8mul_epi8() {
+ let (left, right, _expected) = generate_byte_mul_test_data();
+
+ for i in 0..NUM_TEST_WORDS_256 {
+ let left = load_m256i_word(&left, i);
+ let right = load_m256i_word(&right, i);
+ let result_zero = _mm256_maskz_gf2p8mul_epi8(0, left, right);
+ assert_eq_m256i(result_zero, _mm256_setzero_si256());
+ let mask_bytes: __mmask32 = 0x0F_F0_FF_00;
+ const MASK_WORDS: i32 = 0b01_10_11_00;
+ let expected_result = _mm256_gf2p8mul_epi8(left, right);
+ let result_masked = _mm256_maskz_gf2p8mul_epi8(mask_bytes, left, right);
+ let expected_masked =
+ _mm256_blend_epi32::<MASK_WORDS>(_mm256_setzero_si256(), expected_result);
+ assert_eq_m256i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm256_mask_gf2p8mul_epi8() {
+ let (left, right, _expected) = generate_byte_mul_test_data();
+
+ for i in 0..NUM_TEST_WORDS_256 {
+ let left = load_m256i_word(&left, i);
+ let right = load_m256i_word(&right, i);
+ let result_left = _mm256_mask_gf2p8mul_epi8(left, 0, left, right);
+ assert_eq_m256i(result_left, left);
+ let mask_bytes: __mmask32 = 0x0F_F0_FF_00;
+ const MASK_WORDS: i32 = 0b01_10_11_00;
+ let expected_result = _mm256_gf2p8mul_epi8(left, right);
+ let result_masked = _mm256_mask_gf2p8mul_epi8(left, mask_bytes, left, right);
+ let expected_masked = _mm256_blend_epi32::<MASK_WORDS>(left, expected_result);
+ assert_eq_m256i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm_gf2p8mul_epi8() {
+ let (left, right, expected) = generate_byte_mul_test_data();
+
+ for i in 0..NUM_TEST_WORDS_128 {
+ let left = load_m128i_word(&left, i);
+ let right = load_m128i_word(&right, i);
+ let expected = load_m128i_word(&expected, i);
+ let result = _mm_gf2p8mul_epi8(left, right);
+ assert_eq_m128i(result, expected);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm_maskz_gf2p8mul_epi8() {
+ let (left, right, _expected) = generate_byte_mul_test_data();
+
+ for i in 0..NUM_TEST_WORDS_128 {
+ let left = load_m128i_word(&left, i);
+ let right = load_m128i_word(&right, i);
+ let result_zero = _mm_maskz_gf2p8mul_epi8(0, left, right);
+ assert_eq_m128i(result_zero, _mm_setzero_si128());
+ let mask_bytes: __mmask16 = 0x0F_F0;
+ const MASK_WORDS: i32 = 0b01_10;
+ let expected_result = _mm_gf2p8mul_epi8(left, right);
+ let result_masked = _mm_maskz_gf2p8mul_epi8(mask_bytes, left, right);
+ let expected_masked =
+ _mm_blend_epi32::<MASK_WORDS>(_mm_setzero_si128(), expected_result);
+ assert_eq_m128i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm_mask_gf2p8mul_epi8() {
+ let (left, right, _expected) = generate_byte_mul_test_data();
+
+ for i in 0..NUM_TEST_WORDS_128 {
+ let left = load_m128i_word(&left, i);
+ let right = load_m128i_word(&right, i);
+ let result_left = _mm_mask_gf2p8mul_epi8(left, 0, left, right);
+ assert_eq_m128i(result_left, left);
+ let mask_bytes: __mmask16 = 0x0F_F0;
+ const MASK_WORDS: i32 = 0b01_10;
+ let expected_result = _mm_gf2p8mul_epi8(left, right);
+ let result_masked = _mm_mask_gf2p8mul_epi8(left, mask_bytes, left, right);
+ let expected_masked = _mm_blend_epi32::<MASK_WORDS>(left, expected_result);
+ assert_eq_m128i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw")]
+ unsafe fn test_mm512_gf2p8affine_epi64_epi8() {
+ let identity: i64 = 0x01_02_04_08_10_20_40_80;
+ const IDENTITY_BYTE: i32 = 0;
+ let constant: i64 = 0;
+ const CONSTANT_BYTE: i32 = 0x63;
+ let identity = _mm512_set1_epi64(identity);
+ let constant = _mm512_set1_epi64(constant);
+ let constant_reference = _mm512_set1_epi8(CONSTANT_BYTE as i8);
+
+ let (bytes, more_bytes, _) = generate_byte_mul_test_data();
+ let (matrices, vectors, references) = generate_affine_mul_test_data(IDENTITY_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_512 {
+ let data = load_m512i_word(&bytes, i);
+ let result = _mm512_gf2p8affine_epi64_epi8::<IDENTITY_BYTE>(data, identity);
+ assert_eq_m512i(result, data);
+ let result = _mm512_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(data, constant);
+ assert_eq_m512i(result, constant_reference);
+ let data = load_m512i_word(&more_bytes, i);
+ let result = _mm512_gf2p8affine_epi64_epi8::<IDENTITY_BYTE>(data, identity);
+ assert_eq_m512i(result, data);
+ let result = _mm512_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(data, constant);
+ assert_eq_m512i(result, constant_reference);
+
+ let matrix = load_m512i_word(&matrices, i);
+ let vector = load_m512i_word(&vectors, i);
+ let reference = load_m512i_word(&references, i);
+
+ let result = _mm512_gf2p8affine_epi64_epi8::<IDENTITY_BYTE>(vector, matrix);
+ assert_eq_m512i(result, reference);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw")]
+ unsafe fn test_mm512_maskz_gf2p8affine_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_512 {
+ let matrix = load_m512i_word(&matrices, i);
+ let vector = load_m512i_word(&vectors, i);
+ let result_zero =
+ _mm512_maskz_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(0, vector, matrix);
+ assert_eq_m512i(result_zero, _mm512_setzero_si512());
+ let mask_bytes: __mmask64 = 0x0F_0F_0F_0F_FF_FF_00_00;
+ let mask_words: __mmask16 = 0b01_01_01_01_11_11_00_00;
+ let expected_result = _mm512_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(vector, matrix);
+ let result_masked =
+ _mm512_maskz_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(mask_bytes, vector, matrix);
+ let expected_masked =
+ _mm512_mask_blend_epi32(mask_words, _mm512_setzero_si512(), expected_result);
+ assert_eq_m512i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw")]
+ unsafe fn test_mm512_mask_gf2p8affine_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_512 {
+ let left = load_m512i_word(&vectors, i);
+ let right = load_m512i_word(&matrices, i);
+ let result_left =
+ _mm512_mask_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(left, 0, left, right);
+ assert_eq_m512i(result_left, left);
+ let mask_bytes: __mmask64 = 0x0F_0F_0F_0F_FF_FF_00_00;
+ let mask_words: __mmask16 = 0b01_01_01_01_11_11_00_00;
+ let expected_result = _mm512_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(left, right);
+ let result_masked =
+ _mm512_mask_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(left, mask_bytes, left, right);
+ let expected_masked = _mm512_mask_blend_epi32(mask_words, left, expected_result);
+ assert_eq_m512i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm256_gf2p8affine_epi64_epi8() {
+ let identity: i64 = 0x01_02_04_08_10_20_40_80;
+ const IDENTITY_BYTE: i32 = 0;
+ let constant: i64 = 0;
+ const CONSTANT_BYTE: i32 = 0x63;
+ let identity = _mm256_set1_epi64x(identity);
+ let constant = _mm256_set1_epi64x(constant);
+ let constant_reference = _mm256_set1_epi8(CONSTANT_BYTE as i8);
+
+ let (bytes, more_bytes, _) = generate_byte_mul_test_data();
+ let (matrices, vectors, references) = generate_affine_mul_test_data(IDENTITY_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_256 {
+ let data = load_m256i_word(&bytes, i);
+ let result = _mm256_gf2p8affine_epi64_epi8::<IDENTITY_BYTE>(data, identity);
+ assert_eq_m256i(result, data);
+ let result = _mm256_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(data, constant);
+ assert_eq_m256i(result, constant_reference);
+ let data = load_m256i_word(&more_bytes, i);
+ let result = _mm256_gf2p8affine_epi64_epi8::<IDENTITY_BYTE>(data, identity);
+ assert_eq_m256i(result, data);
+ let result = _mm256_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(data, constant);
+ assert_eq_m256i(result, constant_reference);
+
+ let matrix = load_m256i_word(&matrices, i);
+ let vector = load_m256i_word(&vectors, i);
+ let reference = load_m256i_word(&references, i);
+
+ let result = _mm256_gf2p8affine_epi64_epi8::<IDENTITY_BYTE>(vector, matrix);
+ assert_eq_m256i(result, reference);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm256_maskz_gf2p8affine_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_256 {
+ let matrix = load_m256i_word(&matrices, i);
+ let vector = load_m256i_word(&vectors, i);
+ let result_zero =
+ _mm256_maskz_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(0, vector, matrix);
+ assert_eq_m256i(result_zero, _mm256_setzero_si256());
+ let mask_bytes: __mmask32 = 0xFF_0F_F0_00;
+ const MASK_WORDS: i32 = 0b11_01_10_00;
+ let expected_result = _mm256_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(vector, matrix);
+ let result_masked =
+ _mm256_maskz_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(mask_bytes, vector, matrix);
+ let expected_masked =
+ _mm256_blend_epi32::<MASK_WORDS>(_mm256_setzero_si256(), expected_result);
+ assert_eq_m256i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm256_mask_gf2p8affine_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_256 {
+ let left = load_m256i_word(&vectors, i);
+ let right = load_m256i_word(&matrices, i);
+ let result_left =
+ _mm256_mask_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(left, 0, left, right);
+ assert_eq_m256i(result_left, left);
+ let mask_bytes: __mmask32 = 0xFF_0F_F0_00;
+ const MASK_WORDS: i32 = 0b11_01_10_00;
+ let expected_result = _mm256_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(left, right);
+ let result_masked =
+ _mm256_mask_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(left, mask_bytes, left, right);
+ let expected_masked = _mm256_blend_epi32::<MASK_WORDS>(left, expected_result);
+ assert_eq_m256i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm_gf2p8affine_epi64_epi8() {
+ let identity: i64 = 0x01_02_04_08_10_20_40_80;
+ const IDENTITY_BYTE: i32 = 0;
+ let constant: i64 = 0;
+ const CONSTANT_BYTE: i32 = 0x63;
+ let identity = _mm_set1_epi64x(identity);
+ let constant = _mm_set1_epi64x(constant);
+ let constant_reference = _mm_set1_epi8(CONSTANT_BYTE as i8);
+
+ let (bytes, more_bytes, _) = generate_byte_mul_test_data();
+ let (matrices, vectors, references) = generate_affine_mul_test_data(IDENTITY_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_128 {
+ let data = load_m128i_word(&bytes, i);
+ let result = _mm_gf2p8affine_epi64_epi8::<IDENTITY_BYTE>(data, identity);
+ assert_eq_m128i(result, data);
+ let result = _mm_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(data, constant);
+ assert_eq_m128i(result, constant_reference);
+ let data = load_m128i_word(&more_bytes, i);
+ let result = _mm_gf2p8affine_epi64_epi8::<IDENTITY_BYTE>(data, identity);
+ assert_eq_m128i(result, data);
+ let result = _mm_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(data, constant);
+ assert_eq_m128i(result, constant_reference);
+
+ let matrix = load_m128i_word(&matrices, i);
+ let vector = load_m128i_word(&vectors, i);
+ let reference = load_m128i_word(&references, i);
+
+ let result = _mm_gf2p8affine_epi64_epi8::<IDENTITY_BYTE>(vector, matrix);
+ assert_eq_m128i(result, reference);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm_maskz_gf2p8affine_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_128 {
+ let matrix = load_m128i_word(&matrices, i);
+ let vector = load_m128i_word(&vectors, i);
+ let result_zero = _mm_maskz_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(0, vector, matrix);
+ assert_eq_m128i(result_zero, _mm_setzero_si128());
+ let mask_bytes: __mmask16 = 0x0F_F0;
+ const MASK_WORDS: i32 = 0b01_10;
+ let expected_result = _mm_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(vector, matrix);
+ let result_masked =
+ _mm_maskz_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(mask_bytes, vector, matrix);
+ let expected_masked =
+ _mm_blend_epi32::<MASK_WORDS>(_mm_setzero_si128(), expected_result);
+ assert_eq_m128i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm_mask_gf2p8affine_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_128 {
+ let left = load_m128i_word(&vectors, i);
+ let right = load_m128i_word(&matrices, i);
+ let result_left =
+ _mm_mask_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(left, 0, left, right);
+ assert_eq_m128i(result_left, left);
+ let mask_bytes: __mmask16 = 0x0F_F0;
+ const MASK_WORDS: i32 = 0b01_10;
+ let expected_result = _mm_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(left, right);
+ let result_masked =
+ _mm_mask_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(left, mask_bytes, left, right);
+ let expected_masked = _mm_blend_epi32::<MASK_WORDS>(left, expected_result);
+ assert_eq_m128i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw")]
+ unsafe fn test_mm512_gf2p8affineinv_epi64_epi8() {
+ let identity: i64 = 0x01_02_04_08_10_20_40_80;
+ const IDENTITY_BYTE: i32 = 0;
+ const CONSTANT_BYTE: i32 = 0x63;
+ let identity = _mm512_set1_epi64(identity);
+
+ // validate inversion
+ let (inputs, results) = generate_inv_tests_data();
+
+ for i in 0..NUM_BYTES_WORDS_512 {
+ let input = load_m512i_word(&inputs, i);
+ let reference = load_m512i_word(&results, i);
+ let result = _mm512_gf2p8affineinv_epi64_epi8::<IDENTITY_BYTE>(input, identity);
+ let remultiplied = _mm512_gf2p8mul_epi8(result, input);
+ assert_eq_m512i(remultiplied, reference);
+ }
+
+ // validate subsequent affine operation
+ let (matrices, vectors, _affine_expected) =
+ generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_512 {
+ let vector = load_m512i_word(&vectors, i);
+ let matrix = load_m512i_word(&matrices, i);
+
+ let inv_vec = _mm512_gf2p8affineinv_epi64_epi8::<IDENTITY_BYTE>(vector, identity);
+ let reference = _mm512_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(inv_vec, matrix);
+ let result = _mm512_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(vector, matrix);
+ assert_eq_m512i(result, reference);
+ }
+
+ // validate everything by virtue of checking against the AES SBox
+ const AES_S_BOX_MATRIX: i64 = 0xF1_E3_C7_8F_1F_3E_7C_F8;
+ let sbox_matrix = _mm512_set1_epi64(AES_S_BOX_MATRIX);
+
+ for i in 0..NUM_BYTES_WORDS_512 {
+ let reference = load_m512i_word(&AES_S_BOX, i);
+ let input = load_m512i_word(&inputs, i);
+ let result = _mm512_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(input, sbox_matrix);
+ assert_eq_m512i(result, reference);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw")]
+ unsafe fn test_mm512_maskz_gf2p8affineinv_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_512 {
+ let matrix = load_m512i_word(&matrices, i);
+ let vector = load_m512i_word(&vectors, i);
+ let result_zero =
+ _mm512_maskz_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(0, vector, matrix);
+ assert_eq_m512i(result_zero, _mm512_setzero_si512());
+ let mask_bytes: __mmask64 = 0x0F_0F_0F_0F_FF_FF_00_00;
+ let mask_words: __mmask16 = 0b01_01_01_01_11_11_00_00;
+ let expected_result = _mm512_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(vector, matrix);
+ let result_masked =
+ _mm512_maskz_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(mask_bytes, vector, matrix);
+ let expected_masked =
+ _mm512_mask_blend_epi32(mask_words, _mm512_setzero_si512(), expected_result);
+ assert_eq_m512i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw")]
+ unsafe fn test_mm512_mask_gf2p8affineinv_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_512 {
+ let left = load_m512i_word(&vectors, i);
+ let right = load_m512i_word(&matrices, i);
+ let result_left =
+ _mm512_mask_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(left, 0, left, right);
+ assert_eq_m512i(result_left, left);
+ let mask_bytes: __mmask64 = 0x0F_0F_0F_0F_FF_FF_00_00;
+ let mask_words: __mmask16 = 0b01_01_01_01_11_11_00_00;
+ let expected_result = _mm512_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(left, right);
+ let result_masked = _mm512_mask_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(
+ left, mask_bytes, left, right,
+ );
+ let expected_masked = _mm512_mask_blend_epi32(mask_words, left, expected_result);
+ assert_eq_m512i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm256_gf2p8affineinv_epi64_epi8() {
+ let identity: i64 = 0x01_02_04_08_10_20_40_80;
+ const IDENTITY_BYTE: i32 = 0;
+ const CONSTANT_BYTE: i32 = 0x63;
+ let identity = _mm256_set1_epi64x(identity);
+
+ // validate inversion
+ let (inputs, results) = generate_inv_tests_data();
+
+ for i in 0..NUM_BYTES_WORDS_256 {
+ let input = load_m256i_word(&inputs, i);
+ let reference = load_m256i_word(&results, i);
+ let result = _mm256_gf2p8affineinv_epi64_epi8::<IDENTITY_BYTE>(input, identity);
+ let remultiplied = _mm256_gf2p8mul_epi8(result, input);
+ assert_eq_m256i(remultiplied, reference);
+ }
+
+ // validate subsequent affine operation
+ let (matrices, vectors, _affine_expected) =
+ generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_256 {
+ let vector = load_m256i_word(&vectors, i);
+ let matrix = load_m256i_word(&matrices, i);
+
+ let inv_vec = _mm256_gf2p8affineinv_epi64_epi8::<IDENTITY_BYTE>(vector, identity);
+ let reference = _mm256_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(inv_vec, matrix);
+ let result = _mm256_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(vector, matrix);
+ assert_eq_m256i(result, reference);
+ }
+
+ // validate everything by virtue of checking against the AES SBox
+ const AES_S_BOX_MATRIX: i64 = 0xF1_E3_C7_8F_1F_3E_7C_F8;
+ let sbox_matrix = _mm256_set1_epi64x(AES_S_BOX_MATRIX);
+
+ for i in 0..NUM_BYTES_WORDS_256 {
+ let reference = load_m256i_word(&AES_S_BOX, i);
+ let input = load_m256i_word(&inputs, i);
+ let result = _mm256_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(input, sbox_matrix);
+ assert_eq_m256i(result, reference);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm256_maskz_gf2p8affineinv_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_256 {
+ let matrix = load_m256i_word(&matrices, i);
+ let vector = load_m256i_word(&vectors, i);
+ let result_zero =
+ _mm256_maskz_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(0, vector, matrix);
+ assert_eq_m256i(result_zero, _mm256_setzero_si256());
+ let mask_bytes: __mmask32 = 0xFF_0F_F0_00;
+ const MASK_WORDS: i32 = 0b11_01_10_00;
+ let expected_result = _mm256_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(vector, matrix);
+ let result_masked =
+ _mm256_maskz_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(mask_bytes, vector, matrix);
+ let expected_masked =
+ _mm256_blend_epi32::<MASK_WORDS>(_mm256_setzero_si256(), expected_result);
+ assert_eq_m256i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm256_mask_gf2p8affineinv_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_256 {
+ let left = load_m256i_word(&vectors, i);
+ let right = load_m256i_word(&matrices, i);
+ let result_left =
+ _mm256_mask_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(left, 0, left, right);
+ assert_eq_m256i(result_left, left);
+ let mask_bytes: __mmask32 = 0xFF_0F_F0_00;
+ const MASK_WORDS: i32 = 0b11_01_10_00;
+ let expected_result = _mm256_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(left, right);
+ let result_masked = _mm256_mask_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(
+ left, mask_bytes, left, right,
+ );
+ let expected_masked = _mm256_blend_epi32::<MASK_WORDS>(left, expected_result);
+ assert_eq_m256i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm_gf2p8affineinv_epi64_epi8() {
+ let identity: i64 = 0x01_02_04_08_10_20_40_80;
+ const IDENTITY_BYTE: i32 = 0;
+ const CONSTANT_BYTE: i32 = 0x63;
+ let identity = _mm_set1_epi64x(identity);
+
+ // validate inversion
+ let (inputs, results) = generate_inv_tests_data();
+
+ for i in 0..NUM_BYTES_WORDS_128 {
+ let input = load_m128i_word(&inputs, i);
+ let reference = load_m128i_word(&results, i);
+ let result = _mm_gf2p8affineinv_epi64_epi8::<IDENTITY_BYTE>(input, identity);
+ let remultiplied = _mm_gf2p8mul_epi8(result, input);
+ assert_eq_m128i(remultiplied, reference);
+ }
+
+ // validate subsequent affine operation
+ let (matrices, vectors, _affine_expected) =
+ generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_128 {
+ let vector = load_m128i_word(&vectors, i);
+ let matrix = load_m128i_word(&matrices, i);
+
+ let inv_vec = _mm_gf2p8affineinv_epi64_epi8::<IDENTITY_BYTE>(vector, identity);
+ let reference = _mm_gf2p8affine_epi64_epi8::<CONSTANT_BYTE>(inv_vec, matrix);
+ let result = _mm_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(vector, matrix);
+ assert_eq_m128i(result, reference);
+ }
+
+ // validate everything by virtue of checking against the AES SBox
+ const AES_S_BOX_MATRIX: i64 = 0xF1_E3_C7_8F_1F_3E_7C_F8;
+ let sbox_matrix = _mm_set1_epi64x(AES_S_BOX_MATRIX);
+
+ for i in 0..NUM_BYTES_WORDS_128 {
+ let reference = load_m128i_word(&AES_S_BOX, i);
+ let input = load_m128i_word(&inputs, i);
+ let result = _mm_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(input, sbox_matrix);
+ assert_eq_m128i(result, reference);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm_maskz_gf2p8affineinv_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_128 {
+ let matrix = load_m128i_word(&matrices, i);
+ let vector = load_m128i_word(&vectors, i);
+ let result_zero =
+ _mm_maskz_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(0, vector, matrix);
+ assert_eq_m128i(result_zero, _mm_setzero_si128());
+ let mask_bytes: __mmask16 = 0x0F_F0;
+ const MASK_WORDS: i32 = 0b01_10;
+ let expected_result = _mm_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(vector, matrix);
+ let result_masked =
+ _mm_maskz_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(mask_bytes, vector, matrix);
+ let expected_masked =
+ _mm_blend_epi32::<MASK_WORDS>(_mm_setzero_si128(), expected_result);
+ assert_eq_m128i(result_masked, expected_masked);
+ }
+ }
+
+ #[simd_test(enable = "avx512gfni,avx512bw,avx512vl")]
+ unsafe fn test_mm_mask_gf2p8affineinv_epi64_epi8() {
+ const CONSTANT_BYTE: i32 = 0x63;
+ let (matrices, vectors, _expected) = generate_affine_mul_test_data(CONSTANT_BYTE as u8);
+
+ for i in 0..NUM_TEST_WORDS_128 {
+ let left = load_m128i_word(&vectors, i);
+ let right = load_m128i_word(&matrices, i);
+ let result_left =
+ _mm_mask_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(left, 0, left, right);
+ assert_eq_m128i(result_left, left);
+ let mask_bytes: __mmask16 = 0x0F_F0;
+ const MASK_WORDS: i32 = 0b01_10;
+ let expected_result = _mm_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(left, right);
+ let result_masked =
+ _mm_mask_gf2p8affineinv_epi64_epi8::<CONSTANT_BYTE>(left, mask_bytes, left, right);
+ let expected_masked = _mm_blend_epi32::<MASK_WORDS>(left, expected_result);
+ assert_eq_m128i(result_masked, expected_masked);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512ifma.rs b/library/stdarch/crates/core_arch/src/x86/avx512ifma.rs
new file mode 100644
index 000000000..26aa0320f
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512ifma.rs
@@ -0,0 +1,196 @@
+use crate::core_arch::x86::*;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Multiply packed unsigned 52-bit integers in each 64-bit element of
+/// `b` and `c` to form a 104-bit intermediate result. Add the high 52-bit
+/// unsigned integer from the intermediate result with the
+/// corresponding unsigned 64-bit integer in `a`, and store the
+/// results in `dst`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#avx512techs=AVX512IFMA52&expand=3488)
+#[inline]
+#[target_feature(enable = "avx512ifma")]
+#[cfg_attr(test, assert_instr(vpmadd52huq))]
+pub unsafe fn _mm512_madd52hi_epu64(a: __m512i, b: __m512i, c: __m512i) -> __m512i {
+ vpmadd52huq_512(a, b, c)
+}
+
+/// Multiply packed unsigned 52-bit integers in each 64-bit element of
+/// `b` and `c` to form a 104-bit intermediate result. Add the low 52-bit
+/// unsigned integer from the intermediate result with the
+/// corresponding unsigned 64-bit integer in `a`, and store the
+/// results in `dst`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=3497&avx512techs=AVX512IFMA52)
+#[inline]
+#[target_feature(enable = "avx512ifma")]
+#[cfg_attr(test, assert_instr(vpmadd52luq))]
+pub unsafe fn _mm512_madd52lo_epu64(a: __m512i, b: __m512i, c: __m512i) -> __m512i {
+ vpmadd52luq_512(a, b, c)
+}
+
+/// Multiply packed unsigned 52-bit integers in each 64-bit element of
+/// `b` and `c` to form a 104-bit intermediate result. Add the high 52-bit
+/// unsigned integer from the intermediate result with the
+/// corresponding unsigned 64-bit integer in `a`, and store the
+/// results in `dst`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=vpmadd52&avx512techs=AVX512IFMA52,AVX512VL&expand=3485)
+#[inline]
+#[target_feature(enable = "avx512ifma,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmadd52huq))]
+pub unsafe fn _mm256_madd52hi_epu64(a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ vpmadd52huq_256(a, b, c)
+}
+
+/// Multiply packed unsigned 52-bit integers in each 64-bit element of
+/// `b` and `c` to form a 104-bit intermediate result. Add the low 52-bit
+/// unsigned integer from the intermediate result with the
+/// corresponding unsigned 64-bit integer in `a`, and store the
+/// results in `dst`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=vpmadd52&avx512techs=AVX512IFMA52,AVX512VL&expand=3494)
+#[inline]
+#[target_feature(enable = "avx512ifma,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmadd52luq))]
+pub unsafe fn _mm256_madd52lo_epu64(a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ vpmadd52luq_256(a, b, c)
+}
+
+/// Multiply packed unsigned 52-bit integers in each 64-bit element of
+/// `b` and `c` to form a 104-bit intermediate result. Add the high 52-bit
+/// unsigned integer from the intermediate result with the
+/// corresponding unsigned 64-bit integer in `a`, and store the
+/// results in `dst`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=3488,3482&text=vpmadd52&avx512techs=AVX512IFMA52,AVX512VL)
+#[inline]
+#[target_feature(enable = "avx512ifma,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmadd52huq))]
+pub unsafe fn _mm_madd52hi_epu64(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ vpmadd52huq_128(a, b, c)
+}
+
+/// Multiply packed unsigned 52-bit integers in each 64-bit element of
+/// `b` and `c` to form a 104-bit intermediate result. Add the low 52-bit
+/// unsigned integer from the intermediate result with the
+/// corresponding unsigned 64-bit integer in `a`, and store the
+/// results in `dst`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=3488,3491&text=vpmadd52&avx512techs=AVX512IFMA52,AVX512VL)
+#[inline]
+#[target_feature(enable = "avx512ifma,avx512vl")]
+#[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);
+
+ // (10 << 40) + ((((11 << 40) + 4) * ((12 << 40) + 3)) >> 52)
+ 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);
+
+ // (10 << 40) + ((((11 << 40) + 4) * ((12 << 40) + 3)) % (1 << 52))
+ 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);
+
+ // (10 << 40) + ((((11 << 40) + 4) * ((12 << 40) + 3)) >> 52)
+ 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);
+
+ // (10 << 40) + ((((11 << 40) + 4) * ((12 << 40) + 3)) % (1 << 52))
+ 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);
+
+ // (10 << 40) + ((((11 << 40) + 4) * ((12 << 40) + 3)) >> 52)
+ 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);
+
+ // (10 << 40) + ((((11 << 40) + 4) * ((12 << 40) + 3)) >> 52)
+ let expected = _mm_set1_epi64x(11030549757952);
+
+ assert_eq_m128i(a, expected);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512vaes.rs b/library/stdarch/crates/core_arch/src/x86/avx512vaes.rs
new file mode 100644
index 000000000..676de312b
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512vaes.rs
@@ -0,0 +1,332 @@
+//! Vectorized AES Instructions (VAES)
+//!
+//! The intrinsics here correspond to those in the `immintrin.h` C header.
+//!
+//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
+//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref].
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+
+use crate::core_arch::x86::__m256i;
+use crate::core_arch::x86::__m512i;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.aesni.aesenc.256"]
+ fn aesenc_256(a: __m256i, round_key: __m256i) -> __m256i;
+ #[link_name = "llvm.x86.aesni.aesenclast.256"]
+ fn aesenclast_256(a: __m256i, round_key: __m256i) -> __m256i;
+ #[link_name = "llvm.x86.aesni.aesdec.256"]
+ fn aesdec_256(a: __m256i, round_key: __m256i) -> __m256i;
+ #[link_name = "llvm.x86.aesni.aesdeclast.256"]
+ fn aesdeclast_256(a: __m256i, round_key: __m256i) -> __m256i;
+ #[link_name = "llvm.x86.aesni.aesenc.512"]
+ fn aesenc_512(a: __m512i, round_key: __m512i) -> __m512i;
+ #[link_name = "llvm.x86.aesni.aesenclast.512"]
+ fn aesenclast_512(a: __m512i, round_key: __m512i) -> __m512i;
+ #[link_name = "llvm.x86.aesni.aesdec.512"]
+ fn aesdec_512(a: __m512i, round_key: __m512i) -> __m512i;
+ #[link_name = "llvm.x86.aesni.aesdeclast.512"]
+ fn aesdeclast_512(a: __m512i, round_key: __m512i) -> __m512i;
+}
+
+/// Performs one round of an AES encryption flow on each 128-bit word (state) in `a` using
+/// the corresponding 128-bit word (key) in `round_key`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_aesenc_epi128)
+#[inline]
+#[target_feature(enable = "avx512vaes,avx512vl")]
+#[cfg_attr(test, assert_instr(vaesenc))]
+pub unsafe fn _mm256_aesenc_epi128(a: __m256i, round_key: __m256i) -> __m256i {
+ aesenc_256(a, round_key)
+}
+
+/// Performs the last round of an AES encryption flow on each 128-bit word (state) in `a` using
+/// the corresponding 128-bit word (key) in `round_key`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_aesenclast_epi128)
+#[inline]
+#[target_feature(enable = "avx512vaes,avx512vl")]
+#[cfg_attr(test, assert_instr(vaesenclast))]
+pub unsafe fn _mm256_aesenclast_epi128(a: __m256i, round_key: __m256i) -> __m256i {
+ aesenclast_256(a, round_key)
+}
+
+/// Performs one round of an AES decryption flow on each 128-bit word (state) in `a` using
+/// the corresponding 128-bit word (key) in `round_key`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_aesdec_epi128)
+#[inline]
+#[target_feature(enable = "avx512vaes,avx512vl")]
+#[cfg_attr(test, assert_instr(vaesdec))]
+pub unsafe fn _mm256_aesdec_epi128(a: __m256i, round_key: __m256i) -> __m256i {
+ aesdec_256(a, round_key)
+}
+
+/// Performs the last round of an AES decryption flow on each 128-bit word (state) in `a` using
+/// the corresponding 128-bit word (key) in `round_key`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_aesdeclast_epi128)
+#[inline]
+#[target_feature(enable = "avx512vaes,avx512vl")]
+#[cfg_attr(test, assert_instr(vaesdeclast))]
+pub unsafe fn _mm256_aesdeclast_epi128(a: __m256i, round_key: __m256i) -> __m256i {
+ aesdeclast_256(a, round_key)
+}
+
+/// Performs one round of an AES encryption flow on each 128-bit word (state) in `a` using
+/// the corresponding 128-bit word (key) in `round_key`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_aesenc_epi128)
+#[inline]
+#[target_feature(enable = "avx512vaes,avx512f")]
+#[cfg_attr(test, assert_instr(vaesenc))]
+pub unsafe fn _mm512_aesenc_epi128(a: __m512i, round_key: __m512i) -> __m512i {
+ aesenc_512(a, round_key)
+}
+
+/// Performs the last round of an AES encryption flow on each 128-bit word (state) in `a` using
+/// the corresponding 128-bit word (key) in `round_key`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_aesenclast_epi128)
+#[inline]
+#[target_feature(enable = "avx512vaes,avx512f")]
+#[cfg_attr(test, assert_instr(vaesenclast))]
+pub unsafe fn _mm512_aesenclast_epi128(a: __m512i, round_key: __m512i) -> __m512i {
+ aesenclast_512(a, round_key)
+}
+
+/// Performs one round of an AES decryption flow on each 128-bit word (state) in `a` using
+/// the corresponding 128-bit word (key) in `round_key`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_aesdec_epi128)
+#[inline]
+#[target_feature(enable = "avx512vaes,avx512f")]
+#[cfg_attr(test, assert_instr(vaesdec))]
+pub unsafe fn _mm512_aesdec_epi128(a: __m512i, round_key: __m512i) -> __m512i {
+ aesdec_512(a, round_key)
+}
+
+/// Performs the last round of an AES decryption flow on each 128-bit word (state) in `a` using
+/// the corresponding 128-bit word (key) in `round_key`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_aesdeclast_epi128)
+#[inline]
+#[target_feature(enable = "avx512vaes,avx512f")]
+#[cfg_attr(test, assert_instr(vaesdeclast))]
+pub unsafe fn _mm512_aesdeclast_epi128(a: __m512i, round_key: __m512i) -> __m512i {
+ aesdeclast_512(a, round_key)
+}
+
+#[cfg(test)]
+mod tests {
+ // The constants in the tests below are just bit patterns. They should not
+ // be interpreted as integers; signedness does not make sense for them, but
+ // __mXXXi happens to be defined in terms of signed integers.
+ #![allow(overflowing_literals)]
+
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ // the first parts of these tests are straight ports from the AES-NI tests
+ // the second parts directly compare the two, for inputs that are different across lanes
+ // and "more random" than the standard test vectors
+ // ideally we'd be using quickcheck here instead
+
+ #[target_feature(enable = "avx2")]
+ unsafe fn helper_for_256_avx512vaes(
+ linear: unsafe fn(__m128i, __m128i) -> __m128i,
+ vectorized: unsafe fn(__m256i, __m256i) -> __m256i,
+ ) {
+ let a = _mm256_set_epi64x(
+ 0xDCB4DB3657BF0B7D,
+ 0x18DB0601068EDD9F,
+ 0xB76B908233200DC5,
+ 0xE478235FA8E22D5E,
+ );
+ let k = _mm256_set_epi64x(
+ 0x672F6F105A94CEA7,
+ 0x8298B8FFCA5F829C,
+ 0xA3927047B3FB61D8,
+ 0x978093862CDE7187,
+ );
+ let mut a_decomp = [_mm_setzero_si128(); 2];
+ a_decomp[0] = _mm256_extracti128_si256::<0>(a);
+ a_decomp[1] = _mm256_extracti128_si256::<1>(a);
+ let mut k_decomp = [_mm_setzero_si128(); 2];
+ k_decomp[0] = _mm256_extracti128_si256::<0>(k);
+ k_decomp[1] = _mm256_extracti128_si256::<1>(k);
+ let r = vectorized(a, k);
+ let mut e_decomp = [_mm_setzero_si128(); 2];
+ for i in 0..2 {
+ e_decomp[i] = linear(a_decomp[i], k_decomp[i]);
+ }
+ assert_eq_m128i(_mm256_extracti128_si256::<0>(r), e_decomp[0]);
+ assert_eq_m128i(_mm256_extracti128_si256::<1>(r), e_decomp[1]);
+ }
+
+ #[target_feature(enable = "sse2")]
+ unsafe fn setup_state_key<T>(broadcast: unsafe fn(__m128i) -> T) -> (T, T) {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc664949.aspx.
+ let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff);
+ let k = _mm_set_epi64x(0x1133557799bbddff, 0x0022446688aaccee);
+ (broadcast(a), broadcast(k))
+ }
+
+ #[target_feature(enable = "avx2")]
+ unsafe fn setup_state_key_256() -> (__m256i, __m256i) {
+ setup_state_key(_mm256_broadcastsi128_si256)
+ }
+
+ #[target_feature(enable = "avx512f")]
+ unsafe fn setup_state_key_512() -> (__m512i, __m512i) {
+ setup_state_key(_mm512_broadcast_i32x4)
+ }
+
+ #[simd_test(enable = "avx512vaes,avx512vl")]
+ unsafe fn test_mm256_aesdec_epi128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc664949.aspx.
+ let (a, k) = setup_state_key_256();
+ let e = _mm_set_epi64x(0x044e4f5176fec48f, 0xb57ecfa381da39ee);
+ let e = _mm256_broadcastsi128_si256(e);
+ let r = _mm256_aesdec_epi128(a, k);
+ assert_eq_m256i(r, e);
+
+ helper_for_256_avx512vaes(_mm_aesdec_si128, _mm256_aesdec_epi128);
+ }
+
+ #[simd_test(enable = "avx512vaes,avx512vl")]
+ unsafe fn test_mm256_aesdeclast_epi128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc714178.aspx.
+ let (a, k) = setup_state_key_256();
+ let e = _mm_set_epi64x(0x36cad57d9072bf9e, 0xf210dd981fa4a493);
+ let e = _mm256_broadcastsi128_si256(e);
+ let r = _mm256_aesdeclast_epi128(a, k);
+ assert_eq_m256i(r, e);
+
+ helper_for_256_avx512vaes(_mm_aesdeclast_si128, _mm256_aesdeclast_epi128);
+ }
+
+ #[simd_test(enable = "avx512vaes,avx512vl")]
+ unsafe fn test_mm256_aesenc_epi128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc664810.aspx.
+ // they are repeated appropriately
+ let (a, k) = setup_state_key_256();
+ let e = _mm_set_epi64x(0x16ab0e57dfc442ed, 0x28e4ee1884504333);
+ let e = _mm256_broadcastsi128_si256(e);
+ let r = _mm256_aesenc_epi128(a, k);
+ assert_eq_m256i(r, e);
+
+ helper_for_256_avx512vaes(_mm_aesenc_si128, _mm256_aesenc_epi128);
+ }
+
+ #[simd_test(enable = "avx512vaes,avx512vl")]
+ unsafe fn test_mm256_aesenclast_epi128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc714136.aspx.
+ let (a, k) = setup_state_key_256();
+ let e = _mm_set_epi64x(0xb6dd7df25d7ab320, 0x4b04f98cf4c860f8);
+ let e = _mm256_broadcastsi128_si256(e);
+ let r = _mm256_aesenclast_epi128(a, k);
+ assert_eq_m256i(r, e);
+
+ helper_for_256_avx512vaes(_mm_aesenclast_si128, _mm256_aesenclast_epi128);
+ }
+
+ #[target_feature(enable = "avx512f")]
+ unsafe fn helper_for_512_avx512vaes(
+ linear: unsafe fn(__m128i, __m128i) -> __m128i,
+ vectorized: unsafe fn(__m512i, __m512i) -> __m512i,
+ ) {
+ let a = _mm512_set_epi64(
+ 0xDCB4DB3657BF0B7D,
+ 0x18DB0601068EDD9F,
+ 0xB76B908233200DC5,
+ 0xE478235FA8E22D5E,
+ 0xAB05CFFA2621154C,
+ 0x1171B47A186174C9,
+ 0x8C6B6C0E7595CEC9,
+ 0xBE3E7D4934E961BD,
+ );
+ let k = _mm512_set_epi64(
+ 0x672F6F105A94CEA7,
+ 0x8298B8FFCA5F829C,
+ 0xA3927047B3FB61D8,
+ 0x978093862CDE7187,
+ 0xB1927AB22F31D0EC,
+ 0xA9A5DA619BE4D7AF,
+ 0xCA2590F56884FDC6,
+ 0x19BE9F660038BDB5,
+ );
+ let mut a_decomp = [_mm_setzero_si128(); 4];
+ a_decomp[0] = _mm512_extracti32x4_epi32::<0>(a);
+ a_decomp[1] = _mm512_extracti32x4_epi32::<1>(a);
+ a_decomp[2] = _mm512_extracti32x4_epi32::<2>(a);
+ a_decomp[3] = _mm512_extracti32x4_epi32::<3>(a);
+ let mut k_decomp = [_mm_setzero_si128(); 4];
+ k_decomp[0] = _mm512_extracti32x4_epi32::<0>(k);
+ k_decomp[1] = _mm512_extracti32x4_epi32::<1>(k);
+ k_decomp[2] = _mm512_extracti32x4_epi32::<2>(k);
+ k_decomp[3] = _mm512_extracti32x4_epi32::<3>(k);
+ let r = vectorized(a, k);
+ let mut e_decomp = [_mm_setzero_si128(); 4];
+ for i in 0..4 {
+ e_decomp[i] = linear(a_decomp[i], k_decomp[i]);
+ }
+ assert_eq_m128i(_mm512_extracti32x4_epi32::<0>(r), e_decomp[0]);
+ assert_eq_m128i(_mm512_extracti32x4_epi32::<1>(r), e_decomp[1]);
+ assert_eq_m128i(_mm512_extracti32x4_epi32::<2>(r), e_decomp[2]);
+ assert_eq_m128i(_mm512_extracti32x4_epi32::<3>(r), e_decomp[3]);
+ }
+
+ #[simd_test(enable = "avx512vaes,avx512f")]
+ unsafe fn test_mm512_aesdec_epi128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc664949.aspx.
+ let (a, k) = setup_state_key_512();
+ let e = _mm_set_epi64x(0x044e4f5176fec48f, 0xb57ecfa381da39ee);
+ let e = _mm512_broadcast_i32x4(e);
+ let r = _mm512_aesdec_epi128(a, k);
+ assert_eq_m512i(r, e);
+
+ helper_for_512_avx512vaes(_mm_aesdec_si128, _mm512_aesdec_epi128);
+ }
+
+ #[simd_test(enable = "avx512vaes,avx512f")]
+ unsafe fn test_mm512_aesdeclast_epi128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc714178.aspx.
+ let (a, k) = setup_state_key_512();
+ let e = _mm_set_epi64x(0x36cad57d9072bf9e, 0xf210dd981fa4a493);
+ let e = _mm512_broadcast_i32x4(e);
+ let r = _mm512_aesdeclast_epi128(a, k);
+ assert_eq_m512i(r, e);
+
+ helper_for_512_avx512vaes(_mm_aesdeclast_si128, _mm512_aesdeclast_epi128);
+ }
+
+ #[simd_test(enable = "avx512vaes,avx512f")]
+ unsafe fn test_mm512_aesenc_epi128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc664810.aspx.
+ let (a, k) = setup_state_key_512();
+ let e = _mm_set_epi64x(0x16ab0e57dfc442ed, 0x28e4ee1884504333);
+ let e = _mm512_broadcast_i32x4(e);
+ let r = _mm512_aesenc_epi128(a, k);
+ assert_eq_m512i(r, e);
+
+ helper_for_512_avx512vaes(_mm_aesenc_si128, _mm512_aesenc_epi128);
+ }
+
+ #[simd_test(enable = "avx512vaes,avx512f")]
+ unsafe fn test_mm512_aesenclast_epi128() {
+ // Constants taken from https://msdn.microsoft.com/en-us/library/cc714136.aspx.
+ let (a, k) = setup_state_key_512();
+ let e = _mm_set_epi64x(0xb6dd7df25d7ab320, 0x4b04f98cf4c860f8);
+ let e = _mm512_broadcast_i32x4(e);
+ let r = _mm512_aesenclast_epi128(a, k);
+ assert_eq_m512i(r, e);
+
+ helper_for_512_avx512vaes(_mm_aesenclast_si128, _mm512_aesenclast_epi128);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512vbmi.rs b/library/stdarch/crates/core_arch/src/x86/avx512vbmi.rs
new file mode 100644
index 000000000..f0ff75162
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512vbmi.rs
@@ -0,0 +1,916 @@
+use crate::core_arch::{simd::*, simd_llvm::*, x86::*};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutex2var_epi8&expand=4262)
+#[inline]
+#[target_feature(enable = "avx512vbmi")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2b
+pub unsafe fn _mm512_permutex2var_epi8(a: __m512i, idx: __m512i, b: __m512i) -> __m512i {
+ transmute(vpermi2b(a.as_i8x64(), idx.as_i8x64(), b.as_i8x64()))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutex2var_epi8&expand=4259)
+#[inline]
+#[target_feature(enable = "avx512vbmi")]
+#[cfg_attr(test, assert_instr(vpermt2b))]
+pub unsafe fn _mm512_mask_permutex2var_epi8(
+ a: __m512i,
+ k: __mmask64,
+ idx: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutex2var_epi8(a, idx, b).as_i8x64();
+ transmute(simd_select_bitmask(k, permute, a.as_i8x64()))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutex2var_epi8&expand=4261)
+#[inline]
+#[target_feature(enable = "avx512vbmi")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2b
+pub unsafe fn _mm512_maskz_permutex2var_epi8(
+ k: __mmask64,
+ a: __m512i,
+ idx: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutex2var_epi8(a, idx, b).as_i8x64();
+ let zero = _mm512_setzero_si512().as_i8x64();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask2_permutex2var_epi8&expand=4260)
+#[inline]
+#[target_feature(enable = "avx512vbmi")]
+#[cfg_attr(test, assert_instr(vpermi2b))]
+pub unsafe fn _mm512_mask2_permutex2var_epi8(
+ a: __m512i,
+ idx: __m512i,
+ k: __mmask64,
+ b: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutex2var_epi8(a, idx, b).as_i8x64();
+ transmute(simd_select_bitmask(k, permute, idx.as_i8x64()))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutex2var_epi8&expand=4258)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2b
+pub unsafe fn _mm256_permutex2var_epi8(a: __m256i, idx: __m256i, b: __m256i) -> __m256i {
+ transmute(vpermi2b256(a.as_i8x32(), idx.as_i8x32(), b.as_i8x32()))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutex2var_epi8&expand=4255)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermt2b))]
+pub unsafe fn _mm256_mask_permutex2var_epi8(
+ a: __m256i,
+ k: __mmask32,
+ idx: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutex2var_epi8(a, idx, b).as_i8x32();
+ transmute(simd_select_bitmask(k, permute, a.as_i8x32()))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutex2var_epi8&expand=4257)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2b
+pub unsafe fn _mm256_maskz_permutex2var_epi8(
+ k: __mmask32,
+ a: __m256i,
+ idx: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutex2var_epi8(a, idx, b).as_i8x32();
+ let zero = _mm256_setzero_si256().as_i8x32();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask2_permutex2var_epi8&expand=4256)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermi2b))]
+pub unsafe fn _mm256_mask2_permutex2var_epi8(
+ a: __m256i,
+ idx: __m256i,
+ k: __mmask32,
+ b: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutex2var_epi8(a, idx, b).as_i8x32();
+ transmute(simd_select_bitmask(k, permute, idx.as_i8x32()))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutex2var_epi8&expand=4254)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2b
+pub unsafe fn _mm_permutex2var_epi8(a: __m128i, idx: __m128i, b: __m128i) -> __m128i {
+ transmute(vpermi2b128(a.as_i8x16(), idx.as_i8x16(), b.as_i8x16()))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permutex2var_epi8&expand=4251)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermt2b))]
+pub unsafe fn _mm_mask_permutex2var_epi8(
+ a: __m128i,
+ k: __mmask16,
+ idx: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let permute = _mm_permutex2var_epi8(a, idx, b).as_i8x16();
+ transmute(simd_select_bitmask(k, permute, a.as_i8x16()))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permutex2var_epi8&expand=4253)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vperm))] //should be vpermi2b
+pub unsafe fn _mm_maskz_permutex2var_epi8(
+ k: __mmask16,
+ a: __m128i,
+ idx: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let permute = _mm_permutex2var_epi8(a, idx, b).as_i8x16();
+ let zero = _mm_setzero_si128().as_i8x16();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 8-bit integers in a and b across lanes using the corresponding selector and index in idx, and store the results in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask2_permutex2var_epi8&expand=4252)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermi2b))]
+pub unsafe fn _mm_mask2_permutex2var_epi8(
+ a: __m128i,
+ idx: __m128i,
+ k: __mmask16,
+ b: __m128i,
+) -> __m128i {
+ let permute = _mm_permutex2var_epi8(a, idx, b).as_i8x16();
+ transmute(simd_select_bitmask(k, permute, idx.as_i8x16()))
+}
+
+/// Shuffle 8-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutexvar_epi8&expand=4316)
+#[inline]
+#[target_feature(enable = "avx512vbmi")]
+#[cfg_attr(test, assert_instr(vpermb))]
+pub unsafe fn _mm512_permutexvar_epi8(idx: __m512i, a: __m512i) -> __m512i {
+ transmute(vpermb(a.as_i8x64(), idx.as_i8x64()))
+}
+
+/// Shuffle 8-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_permutexvar_epi8&expand=4314)
+#[inline]
+#[target_feature(enable = "avx512vbmi")]
+#[cfg_attr(test, assert_instr(vpermb))]
+pub unsafe fn _mm512_mask_permutexvar_epi8(
+ src: __m512i,
+ k: __mmask64,
+ idx: __m512i,
+ a: __m512i,
+) -> __m512i {
+ let permute = _mm512_permutexvar_epi8(idx, a).as_i8x64();
+ transmute(simd_select_bitmask(k, permute, src.as_i8x64()))
+}
+
+/// Shuffle 8-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_permutexvar_epi8&expand=4315)
+#[inline]
+#[target_feature(enable = "avx512vbmi")]
+#[cfg_attr(test, assert_instr(vpermb))]
+pub unsafe fn _mm512_maskz_permutexvar_epi8(k: __mmask64, idx: __m512i, a: __m512i) -> __m512i {
+ let permute = _mm512_permutexvar_epi8(idx, a).as_i8x64();
+ let zero = _mm512_setzero_si512().as_i8x64();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 8-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutexvar_epi8&expand=4313)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermb))]
+pub unsafe fn _mm256_permutexvar_epi8(idx: __m256i, a: __m256i) -> __m256i {
+ transmute(vpermb256(a.as_i8x32(), idx.as_i8x32()))
+}
+
+/// Shuffle 8-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_permutexvar_epi8&expand=4311)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermb))]
+pub unsafe fn _mm256_mask_permutexvar_epi8(
+ src: __m256i,
+ k: __mmask32,
+ idx: __m256i,
+ a: __m256i,
+) -> __m256i {
+ let permute = _mm256_permutexvar_epi8(idx, a).as_i8x32();
+ transmute(simd_select_bitmask(k, permute, src.as_i8x32()))
+}
+
+/// Shuffle 8-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_permutexvar_epi8&expand=4312)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermb))]
+pub unsafe fn _mm256_maskz_permutexvar_epi8(k: __mmask32, idx: __m256i, a: __m256i) -> __m256i {
+ let permute = _mm256_permutexvar_epi8(idx, a).as_i8x32();
+ let zero = _mm256_setzero_si256().as_i8x32();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// Shuffle 8-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutexvar_epi8&expand=4310)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermb))]
+pub unsafe fn _mm_permutexvar_epi8(idx: __m128i, a: __m128i) -> __m128i {
+ transmute(vpermb128(a.as_i8x16(), idx.as_i8x16()))
+}
+
+/// Shuffle 8-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_permutexvar_epi8&expand=4308)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermb))]
+pub unsafe fn _mm_mask_permutexvar_epi8(
+ src: __m128i,
+ k: __mmask16,
+ idx: __m128i,
+ a: __m128i,
+) -> __m128i {
+ let permute = _mm_permutexvar_epi8(idx, a).as_i8x16();
+ transmute(simd_select_bitmask(k, permute, src.as_i8x16()))
+}
+
+/// Shuffle 8-bit integers in a across lanes using the corresponding index in idx, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_permutexvar_epi8&expand=4309)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpermb))]
+pub unsafe fn _mm_maskz_permutexvar_epi8(k: __mmask16, idx: __m128i, a: __m128i) -> __m128i {
+ let permute = _mm_permutexvar_epi8(idx, a).as_i8x16();
+ let zero = _mm_setzero_si128().as_i8x16();
+ transmute(simd_select_bitmask(k, permute, zero))
+}
+
+/// For each 64-bit element in b, select 8 unaligned bytes using a byte-granular shift control within the corresponding 64-bit element of a, and store the 8 assembled bytes to the corresponding 64-bit element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_multishift_epi64_epi8&expand=4026)
+#[inline]
+#[target_feature(enable = "avx512vbmi")]
+#[cfg_attr(test, assert_instr(vpmultishiftqb))]
+pub unsafe fn _mm512_multishift_epi64_epi8(a: __m512i, b: __m512i) -> __m512i {
+ transmute(vpmultishiftqb(a.as_i8x64(), b.as_i8x64()))
+}
+
+/// For each 64-bit element in b, select 8 unaligned bytes using a byte-granular shift control within the corresponding 64-bit element of a, and store the 8 assembled bytes to the corresponding 64-bit element of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_multishift_epi64_epi8&expand=4024)
+#[inline]
+#[target_feature(enable = "avx512vbmi")]
+#[cfg_attr(test, assert_instr(vpmultishiftqb))]
+pub unsafe fn _mm512_mask_multishift_epi64_epi8(
+ src: __m512i,
+ k: __mmask64,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ let multishift = _mm512_multishift_epi64_epi8(a, b).as_i8x64();
+ transmute(simd_select_bitmask(k, multishift, src.as_i8x64()))
+}
+
+/// For each 64-bit element in b, select 8 unaligned bytes using a byte-granular shift control within the corresponding 64-bit element of a, and store the 8 assembled bytes to the corresponding 64-bit element of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_multishift_epi64_epi8&expand=4025)
+#[inline]
+#[target_feature(enable = "avx512vbmi")]
+#[cfg_attr(test, assert_instr(vpmultishiftqb))]
+pub unsafe fn _mm512_maskz_multishift_epi64_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i {
+ let multishift = _mm512_multishift_epi64_epi8(a, b).as_i8x64();
+ let zero = _mm512_setzero_si512().as_i8x64();
+ transmute(simd_select_bitmask(k, multishift, zero))
+}
+
+/// For each 64-bit element in b, select 8 unaligned bytes using a byte-granular shift control within the corresponding 64-bit element of a, and store the 8 assembled bytes to the corresponding 64-bit element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_multishift_epi64_epi8&expand=4023)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmultishiftqb))]
+pub unsafe fn _mm256_multishift_epi64_epi8(a: __m256i, b: __m256i) -> __m256i {
+ transmute(vpmultishiftqb256(a.as_i8x32(), b.as_i8x32()))
+}
+
+/// For each 64-bit element in b, select 8 unaligned bytes using a byte-granular shift control within the corresponding 64-bit element of a, and store the 8 assembled bytes to the corresponding 64-bit element of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_multishift_epi64_epi8&expand=4021)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmultishiftqb))]
+pub unsafe fn _mm256_mask_multishift_epi64_epi8(
+ src: __m256i,
+ k: __mmask32,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ let multishift = _mm256_multishift_epi64_epi8(a, b).as_i8x32();
+ transmute(simd_select_bitmask(k, multishift, src.as_i8x32()))
+}
+
+/// For each 64-bit element in b, select 8 unaligned bytes using a byte-granular shift control within the corresponding 64-bit element of a, and store the 8 assembled bytes to the corresponding 64-bit element of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_multishift_epi64_epi8&expand=4022)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmultishiftqb))]
+pub unsafe fn _mm256_maskz_multishift_epi64_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i {
+ let multishift = _mm256_multishift_epi64_epi8(a, b).as_i8x32();
+ let zero = _mm256_setzero_si256().as_i8x32();
+ transmute(simd_select_bitmask(k, multishift, zero))
+}
+
+/// For each 64-bit element in b, select 8 unaligned bytes using a byte-granular shift control within the corresponding 64-bit element of a, and store the 8 assembled bytes to the corresponding 64-bit element of dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/IntrinsicsGuide/#text=_mm_multishift_epi64_epi8&expand=4020)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmultishiftqb))]
+pub unsafe fn _mm_multishift_epi64_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(vpmultishiftqb128(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// For each 64-bit element in b, select 8 unaligned bytes using a byte-granular shift control within the corresponding 64-bit element of a, and store the 8 assembled bytes to the corresponding 64-bit element of dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_multishift_epi64_epi8&expand=4018)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmultishiftqb))]
+pub unsafe fn _mm_mask_multishift_epi64_epi8(
+ src: __m128i,
+ k: __mmask16,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ let multishift = _mm_multishift_epi64_epi8(a, b).as_i8x16();
+ transmute(simd_select_bitmask(k, multishift, src.as_i8x16()))
+}
+
+/// For each 64-bit element in b, select 8 unaligned bytes using a byte-granular shift control within the corresponding 64-bit element of a, and store the 8 assembled bytes to the corresponding 64-bit element of dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_multishift_epi64_epi8&expand=4019)
+#[inline]
+#[target_feature(enable = "avx512vbmi,avx512vl")]
+#[cfg_attr(test, assert_instr(vpmultishiftqb))]
+pub unsafe fn _mm_maskz_multishift_epi64_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i {
+ let multishift = _mm_multishift_epi64_epi8(a, b).as_i8x16();
+ let zero = _mm_setzero_si128().as_i8x16();
+ transmute(simd_select_bitmask(k, multishift, zero))
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.avx512.vpermi2var.qi.512"]
+ fn vpermi2b(a: i8x64, idx: i8x64, b: i8x64) -> i8x64;
+ #[link_name = "llvm.x86.avx512.vpermi2var.qi.256"]
+ fn vpermi2b256(a: i8x32, idx: i8x32, b: i8x32) -> i8x32;
+ #[link_name = "llvm.x86.avx512.vpermi2var.qi.128"]
+ fn vpermi2b128(a: i8x16, idx: i8x16, b: i8x16) -> i8x16;
+
+ #[link_name = "llvm.x86.avx512.permvar.qi.512"]
+ fn vpermb(a: i8x64, idx: i8x64) -> i8x64;
+ #[link_name = "llvm.x86.avx512.permvar.qi.256"]
+ fn vpermb256(a: i8x32, idx: i8x32) -> i8x32;
+ #[link_name = "llvm.x86.avx512.permvar.qi.128"]
+ fn vpermb128(a: i8x16, idx: i8x16) -> i8x16;
+
+ #[link_name = "llvm.x86.avx512.pmultishift.qb.512"]
+ fn vpmultishiftqb(a: i8x64, b: i8x64) -> i8x64;
+ #[link_name = "llvm.x86.avx512.pmultishift.qb.256"]
+ fn vpmultishiftqb256(a: i8x32, b: i8x32) -> i8x32;
+ #[link_name = "llvm.x86.avx512.pmultishift.qb.128"]
+ fn vpmultishiftqb128(a: i8x16, b: i8x16) -> i8x16;
+}
+
+#[cfg(test)]
+mod tests {
+
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "avx512vbmi")]
+ unsafe fn test_mm512_permutex2var_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);
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi8(1, 1<<6, 2, 1<<6, 3, 1<<6, 4, 1<<6, 5, 1<<6, 6, 1<<6, 7, 1<<6, 8, 1<<6,
+ 9, 1<<6, 10, 1<<6, 11, 1<<6, 12, 1<<6, 13, 1<<6, 14, 1<<6, 15, 1<<6, 16, 1<<6,
+ 17, 1<<6, 18, 1<<6, 19, 1<<6, 20, 1<<6, 21, 1<<6, 22, 1<<6, 23, 1<<6, 24, 1<<6,
+ 25, 1<<6, 26, 1<<6, 27, 1<<6, 28, 1<<6, 29, 1<<6, 30, 1<<6, 31, 1<<6, 32, 1<<6);
+ let b = _mm512_set1_epi8(100);
+ let r = _mm512_permutex2var_epi8(a, idx, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi8(
+ 62, 100, 61, 100, 60, 100, 59, 100, 58, 100, 57, 100, 56, 100, 55, 100,
+ 54, 100, 53, 100, 52, 100, 51, 100, 50, 100, 49, 100, 48, 100, 47, 100,
+ 46, 100, 45, 100, 44, 100, 43, 100, 42, 100, 41, 100, 40, 100, 39, 100,
+ 38, 100, 37, 100, 36, 100, 35, 100, 34, 100, 33, 100, 32, 100, 31, 100,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi")]
+ unsafe fn test_mm512_mask_permutex2var_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);
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi8(1, 1<<6, 2, 1<<6, 3, 1<<6, 4, 1<<6, 5, 1<<6, 6, 1<<6, 7, 1<<6, 8, 1<<6,
+ 9, 1<<6, 10, 1<<6, 11, 1<<6, 12, 1<<6, 13, 1<<6, 14, 1<<6, 15, 1<<6, 16, 1<<6,
+ 17, 1<<6, 18, 1<<6, 19, 1<<6, 20, 1<<6, 21, 1<<6, 22, 1<<6, 23, 1<<6, 24, 1<<6,
+ 25, 1<<6, 26, 1<<6, 27, 1<<6, 28, 1<<6, 29, 1<<6, 30, 1<<6, 31, 1<<6, 32, 1<<6);
+ let b = _mm512_set1_epi8(100);
+ let r = _mm512_mask_permutex2var_epi8(a, 0, idx, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_permutex2var_epi8(
+ a,
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ idx,
+ b,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_set_epi8(
+ 62, 100, 61, 100, 60, 100, 59, 100, 58, 100, 57, 100, 56, 100, 55, 100,
+ 54, 100, 53, 100, 52, 100, 51, 100, 50, 100, 49, 100, 48, 100, 47, 100,
+ 46, 100, 45, 100, 44, 100, 43, 100, 42, 100, 41, 100, 40, 100, 39, 100,
+ 38, 100, 37, 100, 36, 100, 35, 100, 34, 100, 33, 100, 32, 100, 31, 100,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi")]
+ unsafe fn test_mm512_maskz_permutex2var_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);
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi8(1, 1<<6, 2, 1<<6, 3, 1<<6, 4, 1<<6, 5, 1<<6, 6, 1<<6, 7, 1<<6, 8, 1<<6,
+ 9, 1<<6, 10, 1<<6, 11, 1<<6, 12, 1<<6, 13, 1<<6, 14, 1<<6, 15, 1<<6, 16, 1<<6,
+ 17, 1<<6, 18, 1<<6, 19, 1<<6, 20, 1<<6, 21, 1<<6, 22, 1<<6, 23, 1<<6, 24, 1<<6,
+ 25, 1<<6, 26, 1<<6, 27, 1<<6, 28, 1<<6, 29, 1<<6, 30, 1<<6, 31, 1<<6, 32, 1<<6);
+ let b = _mm512_set1_epi8(100);
+ let r = _mm512_maskz_permutex2var_epi8(0, a, idx, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_permutex2var_epi8(
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ a,
+ idx,
+ b,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_set_epi8(
+ 62, 100, 61, 100, 60, 100, 59, 100, 58, 100, 57, 100, 56, 100, 55, 100,
+ 54, 100, 53, 100, 52, 100, 51, 100, 50, 100, 49, 100, 48, 100, 47, 100,
+ 46, 100, 45, 100, 44, 100, 43, 100, 42, 100, 41, 100, 40, 100, 39, 100,
+ 38, 100, 37, 100, 36, 100, 35, 100, 34, 100, 33, 100, 32, 100, 31, 100,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi")]
+ unsafe fn test_mm512_mask2_permutex2var_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);
+ #[rustfmt::skip]
+ let idx = _mm512_set_epi8(1, 1<<6, 2, 1<<6, 3, 1<<6, 4, 1<<6, 5, 1<<6, 6, 1<<6, 7, 1<<6, 8, 1<<6,
+ 9, 1<<6, 10, 1<<6, 11, 1<<6, 12, 1<<6, 13, 1<<6, 14, 1<<6, 15, 1<<6, 16, 1<<6,
+ 17, 1<<6, 18, 1<<6, 19, 1<<6, 20, 1<<6, 21, 1<<6, 22, 1<<6, 23, 1<<6, 24, 1<<6,
+ 25, 1<<6, 26, 1<<6, 27, 1<<6, 28, 1<<6, 29, 1<<6, 30, 1<<6, 31, 1<<6, 32, 1<<6);
+ let b = _mm512_set1_epi8(100);
+ let r = _mm512_mask2_permutex2var_epi8(a, idx, 0, b);
+ assert_eq_m512i(r, idx);
+ let r = _mm512_mask2_permutex2var_epi8(
+ a,
+ idx,
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ b,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_set_epi8(
+ 62, 100, 61, 100, 60, 100, 59, 100, 58, 100, 57, 100, 56, 100, 55, 100,
+ 54, 100, 53, 100, 52, 100, 51, 100, 50, 100, 49, 100, 48, 100, 47, 100,
+ 46, 100, 45, 100, 44, 100, 43, 100, 42, 100, 41, 100, 40, 100, 39, 100,
+ 38, 100, 37, 100, 36, 100, 35, 100, 34, 100, 33, 100, 32, 100, 31, 100,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm256_permutex2var_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);
+ #[rustfmt::skip]
+ let idx = _mm256_set_epi8(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 = _mm256_set1_epi8(100);
+ let r = _mm256_permutex2var_epi8(a, idx, b);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi8(
+ 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_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm256_mask_permutex2var_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);
+ #[rustfmt::skip]
+ let idx = _mm256_set_epi8(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 = _mm256_set1_epi8(100);
+ let r = _mm256_mask_permutex2var_epi8(a, 0, idx, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_permutex2var_epi8(a, 0b11111111_11111111_11111111_11111111, idx, b);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi8(
+ 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_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm256_maskz_permutex2var_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);
+ #[rustfmt::skip]
+ let idx = _mm256_set_epi8(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 = _mm256_set1_epi8(100);
+ let r = _mm256_maskz_permutex2var_epi8(0, a, idx, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_permutex2var_epi8(0b11111111_11111111_11111111_11111111, a, idx, b);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi8(
+ 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_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm256_mask2_permutex2var_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);
+ #[rustfmt::skip]
+ let idx = _mm256_set_epi8(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 = _mm256_set1_epi8(100);
+ let r = _mm256_mask2_permutex2var_epi8(a, idx, 0, b);
+ assert_eq_m256i(r, idx);
+ let r = _mm256_mask2_permutex2var_epi8(a, idx, 0b11111111_11111111_11111111_11111111, b);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi8(
+ 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_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm_permutex2var_epi8() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let idx = _mm_set_epi8(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 = _mm_set1_epi8(100);
+ let r = _mm_permutex2var_epi8(a, idx, b);
+ let e = _mm_set_epi8(
+ 14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm_mask_permutex2var_epi8() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let idx = _mm_set_epi8(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 = _mm_set1_epi8(100);
+ let r = _mm_mask_permutex2var_epi8(a, 0, idx, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_permutex2var_epi8(a, 0b11111111_11111111, idx, b);
+ let e = _mm_set_epi8(
+ 14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm_maskz_permutex2var_epi8() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let idx = _mm_set_epi8(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 = _mm_set1_epi8(100);
+ let r = _mm_maskz_permutex2var_epi8(0, a, idx, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_permutex2var_epi8(0b11111111_11111111, a, idx, b);
+ let e = _mm_set_epi8(
+ 14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm_mask2_permutex2var_epi8() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let idx = _mm_set_epi8(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 = _mm_set1_epi8(100);
+ let r = _mm_mask2_permutex2var_epi8(a, idx, 0, b);
+ assert_eq_m128i(r, idx);
+ let r = _mm_mask2_permutex2var_epi8(a, idx, 0b11111111_11111111, b);
+ let e = _mm_set_epi8(
+ 14, 100, 13, 100, 12, 100, 11, 100, 10, 100, 9, 100, 8, 100, 7, 100,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi")]
+ unsafe fn test_mm512_permutexvar_epi8() {
+ let idx = _mm512_set1_epi8(1);
+ #[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 r = _mm512_permutexvar_epi8(idx, a);
+ let e = _mm512_set1_epi8(62);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi")]
+ unsafe fn test_mm512_mask_permutexvar_epi8() {
+ let idx = _mm512_set1_epi8(1);
+ #[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 r = _mm512_mask_permutexvar_epi8(a, 0, idx, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_permutexvar_epi8(
+ a,
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ idx,
+ a,
+ );
+ let e = _mm512_set1_epi8(62);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi")]
+ unsafe fn test_mm512_maskz_permutexvar_epi8() {
+ let idx = _mm512_set1_epi8(1);
+ #[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 r = _mm512_maskz_permutexvar_epi8(0, idx, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_permutexvar_epi8(
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ idx,
+ a,
+ );
+ let e = _mm512_set1_epi8(62);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm256_permutexvar_epi8() {
+ let idx = _mm256_set1_epi8(1);
+ #[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 r = _mm256_permutexvar_epi8(idx, a);
+ let e = _mm256_set1_epi8(30);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm256_mask_permutexvar_epi8() {
+ let idx = _mm256_set1_epi8(1);
+ #[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 r = _mm256_mask_permutexvar_epi8(a, 0, idx, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_permutexvar_epi8(a, 0b11111111_11111111_11111111_11111111, idx, a);
+ let e = _mm256_set1_epi8(30);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm256_maskz_permutexvar_epi8() {
+ let idx = _mm256_set1_epi8(1);
+ #[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 r = _mm256_maskz_permutexvar_epi8(0, idx, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_permutexvar_epi8(0b11111111_11111111_11111111_11111111, idx, a);
+ let e = _mm256_set1_epi8(30);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm_permutexvar_epi8() {
+ let idx = _mm_set1_epi8(1);
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_permutexvar_epi8(idx, a);
+ let e = _mm_set1_epi8(14);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm_mask_permutexvar_epi8() {
+ let idx = _mm_set1_epi8(1);
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_mask_permutexvar_epi8(a, 0, idx, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_permutexvar_epi8(a, 0b11111111_11111111, idx, a);
+ let e = _mm_set1_epi8(14);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm_maskz_permutexvar_epi8() {
+ let idx = _mm_set1_epi8(1);
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_maskz_permutexvar_epi8(0, idx, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_permutexvar_epi8(0b11111111_11111111, idx, a);
+ let e = _mm_set1_epi8(14);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi")]
+ unsafe fn test_mm512_multishift_epi64_epi8() {
+ let a = _mm512_set1_epi8(1);
+ let b = _mm512_set1_epi8(1);
+ let r = _mm512_multishift_epi64_epi8(a, b);
+ let e = _mm512_set1_epi8(1 << 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi")]
+ unsafe fn test_mm512_mask_multishift_epi64_epi8() {
+ let a = _mm512_set1_epi8(1);
+ let b = _mm512_set1_epi8(1);
+ let r = _mm512_mask_multishift_epi64_epi8(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_multishift_epi64_epi8(
+ a,
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ a,
+ b,
+ );
+ let e = _mm512_set1_epi8(1 << 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi")]
+ unsafe fn test_mm512_maskz_multishift_epi64_epi8() {
+ let a = _mm512_set1_epi8(1);
+ let b = _mm512_set1_epi8(1);
+ let r = _mm512_maskz_multishift_epi64_epi8(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_multishift_epi64_epi8(
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111,
+ a,
+ b,
+ );
+ let e = _mm512_set1_epi8(1 << 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm256_multishift_epi64_epi8() {
+ let a = _mm256_set1_epi8(1);
+ let b = _mm256_set1_epi8(1);
+ let r = _mm256_multishift_epi64_epi8(a, b);
+ let e = _mm256_set1_epi8(1 << 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm256_mask_multishift_epi64_epi8() {
+ let a = _mm256_set1_epi8(1);
+ let b = _mm256_set1_epi8(1);
+ let r = _mm256_mask_multishift_epi64_epi8(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_multishift_epi64_epi8(a, 0b11111111_11111111_11111111_11111111, a, b);
+ let e = _mm256_set1_epi8(1 << 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm256_maskz_multishift_epi64_epi8() {
+ let a = _mm256_set1_epi8(1);
+ let b = _mm256_set1_epi8(1);
+ let r = _mm256_maskz_multishift_epi64_epi8(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_multishift_epi64_epi8(0b11111111_11111111_11111111_11111111, a, b);
+ let e = _mm256_set1_epi8(1 << 7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm_multishift_epi64_epi8() {
+ let a = _mm_set1_epi8(1);
+ let b = _mm_set1_epi8(1);
+ let r = _mm_multishift_epi64_epi8(a, b);
+ let e = _mm_set1_epi8(1 << 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm_mask_multishift_epi64_epi8() {
+ let a = _mm_set1_epi8(1);
+ let b = _mm_set1_epi8(1);
+ let r = _mm_mask_multishift_epi64_epi8(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_multishift_epi64_epi8(a, 0b11111111_11111111, a, b);
+ let e = _mm_set1_epi8(1 << 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi,avx512vl")]
+ unsafe fn test_mm_maskz_multishift_epi64_epi8() {
+ let a = _mm_set1_epi8(1);
+ let b = _mm_set1_epi8(1);
+ let r = _mm_maskz_multishift_epi64_epi8(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_multishift_epi64_epi8(0b11111111_11111111, a, b);
+ let e = _mm_set1_epi8(1 << 7);
+ assert_eq_m128i(r, e);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512vbmi2.rs b/library/stdarch/crates/core_arch/src/x86/avx512vbmi2.rs
new file mode 100644
index 000000000..1c81840ba
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512vbmi2.rs
@@ -0,0 +1,4121 @@
+use crate::{
+ arch::asm,
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Load contiguous active 16-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expandloadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vbmi2")]
+pub unsafe fn _mm512_mask_expandloadu_epi16(
+ src: __m512i,
+ k: __mmask32,
+ mem_addr: *const i16,
+) -> __m512i {
+ let mut dst: __m512i = src;
+ asm!(
+ vpl!("vpexpandw {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 16-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expandloadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vbmi2")]
+pub unsafe fn _mm512_maskz_expandloadu_epi16(k: __mmask32, mem_addr: *const i16) -> __m512i {
+ let mut dst: __m512i;
+ asm!(
+ vpl!("vpexpandw {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 16-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expandloadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vbmi2,avx512vl,avx")]
+pub unsafe fn _mm256_mask_expandloadu_epi16(
+ src: __m256i,
+ k: __mmask16,
+ mem_addr: *const i16,
+) -> __m256i {
+ let mut dst: __m256i = src;
+ asm!(
+ vpl!("vpexpandw {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 16-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expandloadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vbmi2,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_expandloadu_epi16(k: __mmask16, mem_addr: *const i16) -> __m256i {
+ let mut dst: __m256i;
+ asm!(
+ vpl!("vpexpandw {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 16-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expandloadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vbmi2,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_expandloadu_epi16(
+ src: __m128i,
+ k: __mmask8,
+ mem_addr: *const i16,
+) -> __m128i {
+ let mut dst: __m128i = src;
+ asm!(
+ vpl!("vpexpandw {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 16-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expandloadu_epi16)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vbmi2,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_expandloadu_epi16(k: __mmask8, mem_addr: *const i16) -> __m128i {
+ let mut dst: __m128i;
+ asm!(
+ vpl!("vpexpandw {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 8-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expandloadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vbmi2")]
+pub unsafe fn _mm512_mask_expandloadu_epi8(
+ src: __m512i,
+ k: __mmask64,
+ mem_addr: *const i8,
+) -> __m512i {
+ let mut dst: __m512i = src;
+ asm!(
+ vpl!("vpexpandb {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 8-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expandloadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vbmi2")]
+pub unsafe fn _mm512_maskz_expandloadu_epi8(k: __mmask64, mem_addr: *const i8) -> __m512i {
+ let mut dst: __m512i;
+ asm!(
+ vpl!("vpexpandb {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(zmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 8-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expandloadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vbmi2,avx512vl,avx")]
+pub unsafe fn _mm256_mask_expandloadu_epi8(
+ src: __m256i,
+ k: __mmask32,
+ mem_addr: *const i8,
+) -> __m256i {
+ let mut dst: __m256i = src;
+ asm!(
+ vpl!("vpexpandb {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 8-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expandloadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512bw,avx512vbmi2,avx512vl,avx")]
+pub unsafe fn _mm256_maskz_expandloadu_epi8(k: __mmask32, mem_addr: *const i8) -> __m256i {
+ let mut dst: __m256i;
+ asm!(
+ vpl!("vpexpandb {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(ymm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 8-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expandloadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vbmi2,avx512vl,avx,sse")]
+pub unsafe fn _mm_mask_expandloadu_epi8(
+ src: __m128i,
+ k: __mmask16,
+ mem_addr: *const i8,
+) -> __m128i {
+ let mut dst: __m128i = src;
+ asm!(
+ vpl!("vpexpandb {dst}{{{k}}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = inout(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Load contiguous active 8-bit integers from unaligned memory at mem_addr (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expandloadu_epi8)
+#[inline]
+#[target_feature(enable = "avx512f,avx512vbmi2,avx512vl,avx,sse")]
+pub unsafe fn _mm_maskz_expandloadu_epi8(k: __mmask16, mem_addr: *const i8) -> __m128i {
+ let mut dst: __m128i;
+ asm!(
+ vpl!("vpexpandb {dst}{{{k}}} {{z}}"),
+ p = in(reg) mem_addr,
+ k = in(kreg) k,
+ dst = out(xmm_reg) dst,
+ options(pure, readonly, nostack)
+ );
+ dst
+}
+
+/// Contiguously store the active 16-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compressstoreu_epi16)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpcompressw))]
+pub unsafe fn _mm512_mask_compressstoreu_epi16(base_addr: *mut u8, k: __mmask32, a: __m512i) {
+ vcompressstorew(base_addr as *mut _, a.as_i16x32(), k)
+}
+
+/// Contiguously store the active 16-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compressstoreu_epi16)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressw))]
+pub unsafe fn _mm256_mask_compressstoreu_epi16(base_addr: *mut u8, k: __mmask16, a: __m256i) {
+ vcompressstorew256(base_addr as *mut _, a.as_i16x16(), k)
+}
+
+/// Contiguously store the active 16-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compressstoreu_epi16)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressw))]
+pub unsafe fn _mm_mask_compressstoreu_epi16(base_addr: *mut u8, k: __mmask8, a: __m128i) {
+ vcompressstorew128(base_addr as *mut _, a.as_i16x8(), k)
+}
+
+/// Contiguously store the active 8-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compressstoreu_epi8)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpcompressb))]
+pub unsafe fn _mm512_mask_compressstoreu_epi8(base_addr: *mut u8, k: __mmask64, a: __m512i) {
+ vcompressstoreb(base_addr as *mut _, a.as_i8x64(), k)
+}
+
+/// Contiguously store the active 8-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compressstoreu_epi8)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressb))]
+pub unsafe fn _mm256_mask_compressstoreu_epi8(base_addr: *mut u8, k: __mmask32, a: __m256i) {
+ vcompressstoreb256(base_addr as *mut _, a.as_i8x32(), k)
+}
+
+/// Contiguously store the active 8-bit integers in a (those with their respective bit set in writemask k) to unaligned memory at base_addr.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compressstoreu_epi8)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressb))]
+pub unsafe fn _mm_mask_compressstoreu_epi8(base_addr: *mut u8, k: __mmask16, a: __m128i) {
+ vcompressstoreb128(base_addr as *mut _, a.as_i8x16(), k)
+}
+
+/// Contiguously store the active 16-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compress_epi16&expand=1192)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpcompressw))]
+pub unsafe fn _mm512_mask_compress_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i {
+ transmute(vpcompressw(a.as_i16x32(), src.as_i16x32(), k))
+}
+
+/// Contiguously store the active 16-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_compress_epi16&expand=1193)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpcompressw))]
+pub unsafe fn _mm512_maskz_compress_epi16(k: __mmask32, a: __m512i) -> __m512i {
+ transmute(vpcompressw(
+ a.as_i16x32(),
+ _mm512_setzero_si512().as_i16x32(),
+ k,
+ ))
+}
+
+/// Contiguously store the active 16-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compress_epi16&expand=1190)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressw))]
+pub unsafe fn _mm256_mask_compress_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i {
+ transmute(vpcompressw256(a.as_i16x16(), src.as_i16x16(), k))
+}
+
+/// Contiguously store the active 16-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_compress_epi16&expand=1191)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressw))]
+pub unsafe fn _mm256_maskz_compress_epi16(k: __mmask16, a: __m256i) -> __m256i {
+ transmute(vpcompressw256(
+ a.as_i16x16(),
+ _mm256_setzero_si256().as_i16x16(),
+ k,
+ ))
+}
+
+/// Contiguously store the active 16-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compress_epi16&expand=1188)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressw))]
+pub unsafe fn _mm_mask_compress_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpcompressw128(a.as_i16x8(), src.as_i16x8(), k))
+}
+
+/// Contiguously store the active 16-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_compress_epi16&expand=1189)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressw))]
+pub unsafe fn _mm_maskz_compress_epi16(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpcompressw128(
+ a.as_i16x8(),
+ _mm_setzero_si128().as_i16x8(),
+ k,
+ ))
+}
+
+/// Contiguously store the active 8-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_compress_epi8&expand=1210)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpcompressb))]
+pub unsafe fn _mm512_mask_compress_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i {
+ transmute(vpcompressb(a.as_i8x64(), src.as_i8x64(), k))
+}
+
+/// Contiguously store the active 8-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_compress_epi8&expand=1211)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpcompressb))]
+pub unsafe fn _mm512_maskz_compress_epi8(k: __mmask64, a: __m512i) -> __m512i {
+ transmute(vpcompressb(
+ a.as_i8x64(),
+ _mm512_setzero_si512().as_i8x64(),
+ k,
+ ))
+}
+
+/// Contiguously store the active 8-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_compress_epi8&expand=1208)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressb))]
+pub unsafe fn _mm256_mask_compress_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i {
+ transmute(vpcompressb256(a.as_i8x32(), src.as_i8x32(), k))
+}
+
+/// Contiguously store the active 8-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_compress_epi8&expand=1209)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressb))]
+pub unsafe fn _mm256_maskz_compress_epi8(k: __mmask32, a: __m256i) -> __m256i {
+ transmute(vpcompressb256(
+ a.as_i8x32(),
+ _mm256_setzero_si256().as_i8x32(),
+ k,
+ ))
+}
+
+/// Contiguously store the active 8-bit integers in a (those with their respective bit set in writemask k) to dst, and pass through the remaining elements from src.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_compress_epi8&expand=1206)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressb))]
+pub unsafe fn _mm_mask_compress_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
+ transmute(vpcompressb128(a.as_i8x16(), src.as_i8x16(), k))
+}
+
+/// Contiguously store the active 8-bit integers in a (those with their respective bit set in zeromask k) to dst, and set the remaining elements to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_compress_epi8&expand=1207)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpcompressb))]
+pub unsafe fn _mm_maskz_compress_epi8(k: __mmask16, a: __m128i) -> __m128i {
+ transmute(vpcompressb128(
+ a.as_i8x16(),
+ _mm_setzero_si128().as_i8x16(),
+ k,
+ ))
+}
+
+/// Load contiguous active 16-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expand_epi16&expand=2310)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpexpandw))]
+pub unsafe fn _mm512_mask_expand_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i {
+ transmute(vpexpandw(a.as_i16x32(), src.as_i16x32(), k))
+}
+
+/// Load contiguous active 16-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expand_epi16&expand=2311)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpexpandw))]
+pub unsafe fn _mm512_maskz_expand_epi16(k: __mmask32, a: __m512i) -> __m512i {
+ transmute(vpexpandw(
+ a.as_i16x32(),
+ _mm512_setzero_si512().as_i16x32(),
+ k,
+ ))
+}
+
+/// Load contiguous active 16-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expand_epi16&expand=2308)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandw))]
+pub unsafe fn _mm256_mask_expand_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i {
+ transmute(vpexpandw256(a.as_i16x16(), src.as_i16x16(), k))
+}
+
+/// Load contiguous active 16-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expand_epi16&expand=2309)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandw))]
+pub unsafe fn _mm256_maskz_expand_epi16(k: __mmask16, a: __m256i) -> __m256i {
+ transmute(vpexpandw256(
+ a.as_i16x16(),
+ _mm256_setzero_si256().as_i16x16(),
+ k,
+ ))
+}
+
+/// Load contiguous active 16-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expand_epi16&expand=2306)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandw))]
+pub unsafe fn _mm_mask_expand_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpexpandw128(a.as_i16x8(), src.as_i16x8(), k))
+}
+
+/// Load contiguous active 16-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expand_epi16&expand=2307)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandw))]
+pub unsafe fn _mm_maskz_expand_epi16(k: __mmask8, a: __m128i) -> __m128i {
+ transmute(vpexpandw128(
+ a.as_i16x8(),
+ _mm_setzero_si128().as_i16x8(),
+ k,
+ ))
+}
+
+/// Load contiguous active 8-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_expand_epi8&expand=2328)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpexpandb))]
+pub unsafe fn _mm512_mask_expand_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i {
+ transmute(vpexpandb(a.as_i8x64(), src.as_i8x64(), k))
+}
+
+/// Load contiguous active 8-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_expand_epi8&expand=2329)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpexpandb))]
+pub unsafe fn _mm512_maskz_expand_epi8(k: __mmask64, a: __m512i) -> __m512i {
+ transmute(vpexpandb(
+ a.as_i8x64(),
+ _mm512_setzero_si512().as_i8x64(),
+ k,
+ ))
+}
+
+/// Load contiguous active 8-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_expand_epi8&expand=2326)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandb))]
+pub unsafe fn _mm256_mask_expand_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i {
+ transmute(vpexpandb256(a.as_i8x32(), src.as_i8x32(), k))
+}
+
+/// Load contiguous active 8-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_expand_epi8&expand=2327)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandb))]
+pub unsafe fn _mm256_maskz_expand_epi8(k: __mmask32, a: __m256i) -> __m256i {
+ transmute(vpexpandb256(
+ a.as_i8x32(),
+ _mm256_setzero_si256().as_i8x32(),
+ k,
+ ))
+}
+
+/// Load contiguous active 8-bit integers from a (those with their respective bit set in mask k), and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_expand_epi8&expand=2324)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandb))]
+pub unsafe fn _mm_mask_expand_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i {
+ transmute(vpexpandb128(a.as_i8x16(), src.as_i8x16(), k))
+}
+
+/// Load contiguous active 8-bit integers from a (those with their respective bit set in mask k), and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_expand_epi8&expand=2325)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpexpandb))]
+pub unsafe fn _mm_maskz_expand_epi8(k: __mmask16, a: __m128i) -> __m128i {
+ transmute(vpexpandb128(
+ a.as_i8x16(),
+ _mm_setzero_si128().as_i8x16(),
+ k,
+ ))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 64-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shldv_epi64&expand=5087)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldvq))]
+pub unsafe fn _mm512_shldv_epi64(a: __m512i, b: __m512i, c: __m512i) -> __m512i {
+ transmute(vpshldvq(a.as_i64x8(), b.as_i64x8(), c.as_i64x8()))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 64-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shldv_epi64&expand=5085)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldvq))]
+pub unsafe fn _mm512_mask_shldv_epi64(a: __m512i, k: __mmask8, b: __m512i, c: __m512i) -> __m512i {
+ let shf = _mm512_shldv_epi64(a, b, c).as_i64x8();
+ transmute(simd_select_bitmask(k, shf, a.as_i64x8()))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shldv_epi64&expand=5086)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldvq))]
+pub unsafe fn _mm512_maskz_shldv_epi64(k: __mmask8, a: __m512i, b: __m512i, c: __m512i) -> __m512i {
+ let shf = _mm512_shldv_epi64(a, b, c).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 64-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shldv_epi64&expand=5084)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvq))]
+pub unsafe fn _mm256_shldv_epi64(a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ transmute(vpshldvq256(a.as_i64x4(), b.as_i64x4(), c.as_i64x4()))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 64-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shldv_epi64&expand=5082)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvq))]
+pub unsafe fn _mm256_mask_shldv_epi64(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i {
+ let shf = _mm256_shldv_epi64(a, b, c).as_i64x4();
+ transmute(simd_select_bitmask(k, shf, a.as_i64x4()))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shldv_epi64&expand=5083)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvq))]
+pub unsafe fn _mm256_maskz_shldv_epi64(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ let shf = _mm256_shldv_epi64(a, b, c).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 64-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shldv_epi64&expand=5081)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvq))]
+pub unsafe fn _mm_shldv_epi64(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ transmute(vpshldvq128(a.as_i64x2(), b.as_i64x2(), c.as_i64x2()))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 64-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shldv_epi64&expand=5079)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvq))]
+pub unsafe fn _mm_mask_shldv_epi64(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shldv_epi64(a, b, c).as_i64x2();
+ transmute(simd_select_bitmask(k, shf, a.as_i64x2()))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shldv_epi64&expand=5080)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvq))]
+pub unsafe fn _mm_maskz_shldv_epi64(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shldv_epi64(a, b, c).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shldv_epi32&expand=5078)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldvd))]
+pub unsafe fn _mm512_shldv_epi32(a: __m512i, b: __m512i, c: __m512i) -> __m512i {
+ transmute(vpshldvd(a.as_i32x16(), b.as_i32x16(), c.as_i32x16()))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 32-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shldv_epi32&expand=5076)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldvd))]
+pub unsafe fn _mm512_mask_shldv_epi32(a: __m512i, k: __mmask16, b: __m512i, c: __m512i) -> __m512i {
+ let shf = _mm512_shldv_epi32(a, b, c).as_i32x16();
+ transmute(simd_select_bitmask(k, shf, a.as_i32x16()))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shldv_epi32&expand=5077)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldvd))]
+pub unsafe fn _mm512_maskz_shldv_epi32(
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+ c: __m512i,
+) -> __m512i {
+ let shf = _mm512_shldv_epi32(a, b, c).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shldv_epi32&expand=5075)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvd))]
+pub unsafe fn _mm256_shldv_epi32(a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ transmute(vpshldvd256(a.as_i32x8(), b.as_i32x8(), c.as_i32x8()))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 32-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shldv_epi32&expand=5073)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvd))]
+pub unsafe fn _mm256_mask_shldv_epi32(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i {
+ let shf = _mm256_shldv_epi32(a, b, c).as_i32x8();
+ transmute(simd_select_bitmask(k, shf, a.as_i32x8()))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shldv_epi32&expand=5074)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvd))]
+pub unsafe fn _mm256_maskz_shldv_epi32(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ let shf = _mm256_shldv_epi32(a, b, c).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shldv_epi32&expand=5072)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvd))]
+pub unsafe fn _mm_shldv_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ transmute(vpshldvd128(a.as_i32x4(), b.as_i32x4(), c.as_i32x4()))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 32-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shldv_epi32&expand=5070)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvd))]
+pub unsafe fn _mm_mask_shldv_epi32(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shldv_epi32(a, b, c).as_i32x4();
+ transmute(simd_select_bitmask(k, shf, a.as_i32x4()))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shldv_epi32&expand=5071)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvd))]
+pub unsafe fn _mm_maskz_shldv_epi32(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shldv_epi32(a, b, c).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 16-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shldv_epi16&expand=5069)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldvw))]
+pub unsafe fn _mm512_shldv_epi16(a: __m512i, b: __m512i, c: __m512i) -> __m512i {
+ transmute(vpshldvw(a.as_i16x32(), b.as_i16x32(), c.as_i16x32()))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 16-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shldv_epi16&expand=5067)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldvw))]
+pub unsafe fn _mm512_mask_shldv_epi16(a: __m512i, k: __mmask32, b: __m512i, c: __m512i) -> __m512i {
+ let shf = _mm512_shldv_epi16(a, b, c).as_i16x32();
+ transmute(simd_select_bitmask(k, shf, a.as_i16x32()))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shldv_epi16&expand=5068)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldvw))]
+pub unsafe fn _mm512_maskz_shldv_epi16(
+ k: __mmask32,
+ a: __m512i,
+ b: __m512i,
+ c: __m512i,
+) -> __m512i {
+ let shf = _mm512_shldv_epi16(a, b, c).as_i16x32();
+ let zero = _mm512_setzero_si512().as_i16x32();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 16-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shldv_epi16&expand=5066)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvw))]
+pub unsafe fn _mm256_shldv_epi16(a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ transmute(vpshldvw256(a.as_i16x16(), b.as_i16x16(), c.as_i16x16()))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 16-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shldv_epi16&expand=5064)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvw))]
+pub unsafe fn _mm256_mask_shldv_epi16(a: __m256i, k: __mmask16, b: __m256i, c: __m256i) -> __m256i {
+ let shf = _mm256_shldv_epi16(a, b, c).as_i16x16();
+ transmute(simd_select_bitmask(k, shf, a.as_i16x16()))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shldv_epi16&expand=5065)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvw))]
+pub unsafe fn _mm256_maskz_shldv_epi16(
+ k: __mmask16,
+ a: __m256i,
+ b: __m256i,
+ c: __m256i,
+) -> __m256i {
+ let shf = _mm256_shldv_epi16(a, b, c).as_i16x16();
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 16-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shldv_epi16&expand=5063)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvw))]
+pub unsafe fn _mm_shldv_epi16(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ transmute(vpshldvw128(a.as_i16x8(), b.as_i16x8(), c.as_i16x8()))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 16-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shldv_epi16&expand=5061)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvw))]
+pub unsafe fn _mm_mask_shldv_epi16(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shldv_epi16(a, b, c).as_i16x8();
+ transmute(simd_select_bitmask(k, shf, a.as_i16x8()))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by the amount specified in the corresponding element of c, and store the upper 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shldv_epi16&expand=5062)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldvw))]
+pub unsafe fn _mm_maskz_shldv_epi16(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shldv_epi16(a, b, c).as_i16x8();
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 64-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shrdv_epi64&expand=5141)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshrdvq))]
+pub unsafe fn _mm512_shrdv_epi64(a: __m512i, b: __m512i, c: __m512i) -> __m512i {
+ transmute(vpshrdvq(a.as_i64x8(), b.as_i64x8(), c.as_i64x8()))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 64-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shrdv_epi64&expand=5139)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshrdvq))]
+pub unsafe fn _mm512_mask_shrdv_epi64(a: __m512i, k: __mmask8, b: __m512i, c: __m512i) -> __m512i {
+ let shf = _mm512_shrdv_epi64(a, b, c).as_i64x8();
+ transmute(simd_select_bitmask(k, shf, a.as_i64x8()))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shrdv_epi64&expand=5140)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshrdvq))]
+pub unsafe fn _mm512_maskz_shrdv_epi64(k: __mmask8, a: __m512i, b: __m512i, c: __m512i) -> __m512i {
+ let shf = _mm512_shrdv_epi64(a, b, c).as_i64x8();
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 64-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shrdv_epi64&expand=5138)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvq))]
+pub unsafe fn _mm256_shrdv_epi64(a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ transmute(vpshrdvq256(a.as_i64x4(), b.as_i64x4(), c.as_i64x4()))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 64-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shrdv_epi64&expand=5136)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvq))]
+pub unsafe fn _mm256_mask_shrdv_epi64(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i {
+ let shf = _mm256_shrdv_epi64(a, b, c).as_i64x4();
+ transmute(simd_select_bitmask(k, shf, a.as_i64x4()))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shrdv_epi64&expand=5137)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvq))]
+pub unsafe fn _mm256_maskz_shrdv_epi64(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ let shf = _mm256_shrdv_epi64(a, b, c).as_i64x4();
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 64-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shrdv_epi64&expand=5135)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvq))]
+pub unsafe fn _mm_shrdv_epi64(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ transmute(vpshrdvq128(a.as_i64x2(), b.as_i64x2(), c.as_i64x2()))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 64-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shrdv_epi64&expand=5133)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvq))]
+pub unsafe fn _mm_mask_shrdv_epi64(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shrdv_epi64(a, b, c).as_i64x2();
+ transmute(simd_select_bitmask(k, shf, a.as_i64x2()))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shrdv_epi64&expand=5134)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvq))]
+pub unsafe fn _mm_maskz_shrdv_epi64(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shrdv_epi64(a, b, c).as_i64x2();
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shrdv_epi32&expand=5132)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshrdvd))]
+pub unsafe fn _mm512_shrdv_epi32(a: __m512i, b: __m512i, c: __m512i) -> __m512i {
+ transmute(vpshrdvd(a.as_i32x16(), b.as_i32x16(), c.as_i32x16()))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 32-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shrdv_epi32&expand=5130)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshrdvd))]
+pub unsafe fn _mm512_mask_shrdv_epi32(a: __m512i, k: __mmask16, b: __m512i, c: __m512i) -> __m512i {
+ let shf = _mm512_shrdv_epi32(a, b, c).as_i32x16();
+ transmute(simd_select_bitmask(k, shf, a.as_i32x16()))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shrdv_epi32&expand=5131)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshrdvd))]
+pub unsafe fn _mm512_maskz_shrdv_epi32(
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+ c: __m512i,
+) -> __m512i {
+ let shf = _mm512_shrdv_epi32(a, b, c).as_i32x16();
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shrdv_epi32&expand=5129)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvd))]
+pub unsafe fn _mm256_shrdv_epi32(a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ transmute(vpshrdvd256(a.as_i32x8(), b.as_i32x8(), c.as_i32x8()))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 32-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shrdv_epi32&expand=5127)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvd))]
+pub unsafe fn _mm256_mask_shrdv_epi32(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i {
+ let shf = _mm256_shrdv_epi32(a, b, c).as_i32x8();
+ transmute(simd_select_bitmask(k, shf, a.as_i32x8()))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shrdv_epi32&expand=5128)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvd))]
+pub unsafe fn _mm256_maskz_shrdv_epi32(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ let shf = _mm256_shrdv_epi32(a, b, c).as_i32x8();
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shrdv_epi32&expand=5126)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvd))]
+pub unsafe fn _mm_shrdv_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ transmute(vpshrdvd128(a.as_i32x4(), b.as_i32x4(), c.as_i32x4()))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 32-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shrdv_epi32&expand=5124)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvd))]
+pub unsafe fn _mm_mask_shrdv_epi32(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shrdv_epi32(a, b, c).as_i32x4();
+ transmute(simd_select_bitmask(k, shf, a.as_i32x4()))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shrdv_epi32&expand=5125)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvd))]
+pub unsafe fn _mm_maskz_shrdv_epi32(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shrdv_epi32(a, b, c).as_i32x4();
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 16-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shrdv_epi16&expand=5123)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshrdvw))]
+pub unsafe fn _mm512_shrdv_epi16(a: __m512i, b: __m512i, c: __m512i) -> __m512i {
+ transmute(vpshrdvw(a.as_i16x32(), b.as_i16x32(), c.as_i16x32()))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 16-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shrdv_epi16&expand=5121)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshrdvw))]
+pub unsafe fn _mm512_mask_shrdv_epi16(a: __m512i, k: __mmask32, b: __m512i, c: __m512i) -> __m512i {
+ let shf = _mm512_shrdv_epi16(a, b, c).as_i16x32();
+ transmute(simd_select_bitmask(k, shf, a.as_i16x32()))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shrdv_epi16&expand=5122)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshrdvw))]
+pub unsafe fn _mm512_maskz_shrdv_epi16(
+ k: __mmask32,
+ a: __m512i,
+ b: __m512i,
+ c: __m512i,
+) -> __m512i {
+ let shf = _mm512_shrdv_epi16(a, b, c).as_i16x32();
+ let zero = _mm512_setzero_si512().as_i16x32();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 16-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shrdv_epi16&expand=5120)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvw))]
+pub unsafe fn _mm256_shrdv_epi16(a: __m256i, b: __m256i, c: __m256i) -> __m256i {
+ transmute(vpshrdvw256(a.as_i16x16(), b.as_i16x16(), c.as_i16x16()))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 16-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shrdv_epi16&expand=5118)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvw))]
+pub unsafe fn _mm256_mask_shrdv_epi16(a: __m256i, k: __mmask16, b: __m256i, c: __m256i) -> __m256i {
+ let shf = _mm256_shrdv_epi16(a, b, c).as_i16x16();
+ transmute(simd_select_bitmask(k, shf, a.as_i16x16()))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shrdv_epi16&expand=5119)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvw))]
+pub unsafe fn _mm256_maskz_shrdv_epi16(
+ k: __mmask16,
+ a: __m256i,
+ b: __m256i,
+ c: __m256i,
+) -> __m256i {
+ let shf = _mm256_shrdv_epi16(a, b, c).as_i16x16();
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 16-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shrdv_epi16&expand=5117)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvw))]
+pub unsafe fn _mm_shrdv_epi16(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ transmute(vpshrdvw128(a.as_i16x8(), b.as_i16x8(), c.as_i16x8()))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 16-bits in dst using writemask k (elements are copied from a when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shrdv_epi16&expand=5115)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvw))]
+pub unsafe fn _mm_mask_shrdv_epi16(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shrdv_epi16(a, b, c).as_i16x8();
+ transmute(simd_select_bitmask(k, shf, a.as_i16x8()))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shrdv_epi16&expand=5116)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshrdvw))]
+pub unsafe fn _mm_maskz_shrdv_epi16(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i {
+ let shf = _mm_shrdv_epi16(a, b, c).as_i16x8();
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by imm8 bits, and store the upper 64-bits in dst).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shldi_epi64&expand=5060)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shldi_epi64<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ transmute(vpshldvq(
+ a.as_i64x8(),
+ b.as_i64x8(),
+ _mm512_set1_epi64(imm8).as_i64x8(),
+ ))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by imm8 bits, and store the upper 64-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shldi_epi64&expand=5058)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shldi_epi64<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x8 = vpshldvq(
+ a.as_i64x8(),
+ b.as_i64x8(),
+ _mm512_set1_epi64(imm8).as_i64x8(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by imm8 bits, and store the upper 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shldi_epi64&expand=5059)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shldi_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x8 = vpshldvq(
+ a.as_i64x8(),
+ b.as_i64x8(),
+ _mm512_set1_epi64(imm8).as_i64x8(),
+ );
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by imm8 bits, and store the upper 64-bits in dst).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shldi_epi64&expand=5057)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_shldi_epi64<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ transmute(vpshldvq256(
+ a.as_i64x4(),
+ b.as_i64x4(),
+ _mm256_set1_epi64x(imm8).as_i64x4(),
+ ))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by imm8 bits, and store the upper 64-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shldi_epi64&expand=5055)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shldi_epi64<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x4 = vpshldvq256(
+ a.as_i64x4(),
+ b.as_i64x4(),
+ _mm256_set1_epi64x(imm8).as_i64x4(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i64x4()))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by imm8 bits, and store the upper 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shldi_epi64&expand=5056)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shldi_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x4 = vpshldvq256(
+ a.as_i64x4(),
+ b.as_i64x4(),
+ _mm256_set1_epi64x(imm8).as_i64x4(),
+ );
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by imm8 bits, and store the upper 64-bits in dst).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shldi_epi64&expand=5054)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_shldi_epi64<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ transmute(vpshldvq128(
+ a.as_i64x2(),
+ b.as_i64x2(),
+ _mm_set1_epi64x(imm8).as_i64x2(),
+ ))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by imm8 bits, and store the upper 64-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shldi_epi64&expand=5052)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_shldi_epi64<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x2 = vpshldvq128(a.as_i64x2(), b.as_i64x2(), _mm_set1_epi64x(imm8).as_i64x2());
+ transmute(simd_select_bitmask(k, shf, src.as_i64x2()))
+}
+
+/// Concatenate packed 64-bit integers in a and b producing an intermediate 128-bit result. Shift the result left by imm8 bits, and store the upper 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shldi_epi64&expand=5053)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_shldi_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x2 = vpshldvq128(a.as_i64x2(), b.as_i64x2(), _mm_set1_epi64x(imm8).as_i64x2());
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by imm8 bits, and store the upper 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shldi_epi32&expand=5051)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shldi_epi32<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ transmute(vpshldvd(
+ a.as_i32x16(),
+ b.as_i32x16(),
+ _mm512_set1_epi32(IMM8).as_i32x16(),
+ ))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by imm8 bits, and store the upper 32-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shldi_epi32&expand=5049)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shldi_epi32<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x16 = vpshldvd(
+ a.as_i32x16(),
+ b.as_i32x16(),
+ _mm512_set1_epi32(IMM8).as_i32x16(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i32x16()))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by imm8 bits, and store the upper 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shldi_epi32&expand=5050)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shldi_epi32<const IMM8: i32>(
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x16 = vpshldvd(
+ a.as_i32x16(),
+ b.as_i32x16(),
+ _mm512_set1_epi32(IMM8).as_i32x16(),
+ );
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by imm8 bits, and store the upper 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shldi_epi32&expand=5048)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_shldi_epi32<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(vpshldvd256(
+ a.as_i32x8(),
+ b.as_i32x8(),
+ _mm256_set1_epi32(IMM8).as_i32x8(),
+ ))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by imm8 bits, and store the upper 32-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shldi_epi32&expand=5046)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shldi_epi32<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x8 = vpshldvd256(
+ a.as_i32x8(),
+ b.as_i32x8(),
+ _mm256_set1_epi32(IMM8).as_i32x8(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i32x8()))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by imm8 bits, and store the upper 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shldi_epi32&expand=5047)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shldi_epi32<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x8 = vpshldvd256(
+ a.as_i32x8(),
+ b.as_i32x8(),
+ _mm256_set1_epi32(IMM8).as_i32x8(),
+ );
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by imm8 bits, and store the upper 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shldi_epi32&expand=5045)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_shldi_epi32<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(vpshldvd128(
+ a.as_i32x4(),
+ b.as_i32x4(),
+ _mm_set1_epi32(IMM8).as_i32x4(),
+ ))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by imm8 bits, and store the upper 32-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shldi_epi32&expand=5043)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_shldi_epi32<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x4 = vpshldvd128(a.as_i32x4(), b.as_i32x4(), _mm_set1_epi32(IMM8).as_i32x4());
+ transmute(simd_select_bitmask(k, shf, src.as_i32x4()))
+}
+
+/// Concatenate packed 32-bit integers in a and b producing an intermediate 64-bit result. Shift the result left by imm8 bits, and store the upper 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shldi_epi32&expand=5044)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_shldi_epi32<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x4 = vpshldvd128(a.as_i32x4(), b.as_i32x4(), _mm_set1_epi32(IMM8).as_i32x4());
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by imm8 bits, and store the upper 16-bits in dst).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shldi_epi16&expand=5042)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shldi_epi16<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ transmute(vpshldvw(
+ a.as_i16x32(),
+ b.as_i16x32(),
+ _mm512_set1_epi16(imm8).as_i16x32(),
+ ))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by imm8 bits, and store the upper 16-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shldi_epi16&expand=5040)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shldi_epi16<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask32,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ let shf: i16x32 = vpshldvw(
+ a.as_i16x32(),
+ b.as_i16x32(),
+ _mm512_set1_epi16(imm8).as_i16x32(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by imm8 bits, and store the upper 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shldi_epi16&expand=5041)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shldi_epi16<const IMM8: i32>(
+ k: __mmask32,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ let shf: i16x32 = vpshldvw(
+ a.as_i16x32(),
+ b.as_i16x32(),
+ _mm512_set1_epi16(imm8).as_i16x32(),
+ );
+ let zero = _mm512_setzero_si512().as_i16x32();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by imm8 bits, and store the upper 16-bits in dst).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shldi_epi16&expand=5039)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_shldi_epi16<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ transmute(vpshldvw256(
+ a.as_i16x16(),
+ b.as_i16x16(),
+ _mm256_set1_epi16(imm8).as_i16x16(),
+ ))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by imm8 bits, and store the upper 16-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shldi_epi16&expand=5037)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shldi_epi16<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask16,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ let shf: i16x16 = vpshldvw256(
+ a.as_i16x16(),
+ b.as_i16x16(),
+ _mm256_set1_epi16(imm8).as_i16x16(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by imm8 bits, and store the upper 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shldi_epi16&expand=5038)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shldi_epi16<const IMM8: i32>(
+ k: __mmask16,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ let shf: i16x16 = vpshldvw256(
+ a.as_i16x16(),
+ b.as_i16x16(),
+ _mm256_set1_epi16(imm8).as_i16x16(),
+ );
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by imm8 bits, and store the upper 16-bits in dst).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shldi_epi16&expand=5036)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_shldi_epi16<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ transmute(vpshldvw128(
+ a.as_i16x8(),
+ b.as_i16x8(),
+ _mm_set1_epi16(imm8).as_i16x8(),
+ ))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by imm8 bits, and store the upper 16-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shldi_epi16&expand=5034)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))]
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_shldi_epi16<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ let shf: i16x8 = vpshldvw128(a.as_i16x8(), b.as_i16x8(), _mm_set1_epi16(imm8).as_i16x8());
+ transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
+}
+
+/// Concatenate packed 16-bit integers in a and b producing an intermediate 32-bit result. Shift the result left by imm8 bits, and store the upper 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shldi_epi16&expand=5035)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_shldi_epi16<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ let shf: i16x8 = vpshldvw128(a.as_i16x8(), b.as_i16x8(), _mm_set1_epi16(imm8).as_i16x8());
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by imm8 bits, and store the lower 64-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shrdi_epi64&expand=5114)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shrdi_epi64<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ transmute(vpshrdvq(
+ a.as_i64x8(),
+ b.as_i64x8(),
+ _mm512_set1_epi64(imm8).as_i64x8(),
+ ))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by imm8 bits, and store the lower 64-bits in dst using writemask k (elements are copied from src" when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shrdi_epi64&expand=5112)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shrdi_epi64<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x8 = vpshrdvq(
+ a.as_i64x8(),
+ b.as_i64x8(),
+ _mm512_set1_epi64(imm8).as_i64x8(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i64x8()))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by imm8 bits, and store the lower 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shrdi_epi64&expand=5113)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 255))] //should be vpshrdq
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shrdi_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x8 = vpshrdvq(
+ a.as_i64x8(),
+ b.as_i64x8(),
+ _mm512_set1_epi64(imm8).as_i64x8(),
+ );
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by imm8 bits, and store the lower 64-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shrdi_epi64&expand=5111)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_shrdi_epi64<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ transmute(vpshrdvq256(
+ a.as_i64x4(),
+ b.as_i64x4(),
+ _mm256_set1_epi64x(imm8).as_i64x4(),
+ ))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by imm8 bits, and store the lower 64-bits in dst using writemask k (elements are copied from src" when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shrdi_epi64&expand=5109)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shrdi_epi64<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x4 = vpshrdvq256(
+ a.as_i64x4(),
+ b.as_i64x4(),
+ _mm256_set1_epi64x(imm8).as_i64x4(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i64x4()))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by imm8 bits, and store the lower 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shrdi_epi64&expand=5110)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shrdi_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x4 = vpshrdvq256(
+ a.as_i64x4(),
+ b.as_i64x4(),
+ _mm256_set1_epi64x(imm8).as_i64x4(),
+ );
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by imm8 bits, and store the lower 64-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shrdi_epi64&expand=5108)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_shrdi_epi64<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ transmute(vpshrdvq128(
+ a.as_i64x2(),
+ b.as_i64x2(),
+ _mm_set1_epi64x(imm8).as_i64x2(),
+ ))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by imm8 bits, and store the lower 64-bits in dst using writemask k (elements are copied from src" when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shrdi_epi64&expand=5106)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_shrdi_epi64<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x2 = vpshrdvq128(a.as_i64x2(), b.as_i64x2(), _mm_set1_epi64x(imm8).as_i64x2());
+ transmute(simd_select_bitmask(k, shf, src.as_i64x2()))
+}
+
+/// Concatenate packed 64-bit integers in b and a producing an intermediate 128-bit result. Shift the result right by imm8 bits, and store the lower 64-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shrdi_epi64&expand=5107)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_shrdi_epi64<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i64;
+ let shf: i64x2 = vpshrdvq128(a.as_i64x2(), b.as_i64x2(), _mm_set1_epi64x(imm8).as_i64x2());
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by imm8 bits, and store the lower 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shrdi_epi32&expand=5105)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shrdi_epi32<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ transmute(vpshrdvd(
+ a.as_i32x16(),
+ b.as_i32x16(),
+ _mm512_set1_epi32(IMM8).as_i32x16(),
+ ))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by imm8 bits, and store the lower 32-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shrdi_epi32&expand=5103)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shrdi_epi32<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x16 = vpshrdvd(
+ a.as_i32x16(),
+ b.as_i32x16(),
+ _mm512_set1_epi32(IMM8).as_i32x16(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i32x16()))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by imm8 bits, and store the lower 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shrdi_epi32&expand=5104)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shrdi_epi32<const IMM8: i32>(
+ k: __mmask16,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x16 = vpshrdvd(
+ a.as_i32x16(),
+ b.as_i32x16(),
+ _mm512_set1_epi32(IMM8).as_i32x16(),
+ );
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by imm8 bits, and store the lower 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shrdi_epi32&expand=5102)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_shrdi_epi32<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ transmute(vpshrdvd256(
+ a.as_i32x8(),
+ b.as_i32x8(),
+ _mm256_set1_epi32(IMM8).as_i32x8(),
+ ))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by imm8 bits, and store the lower 32-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shrdi_epi32&expand=5100)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shrdi_epi32<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x8 = vpshrdvd256(
+ a.as_i32x8(),
+ b.as_i32x8(),
+ _mm256_set1_epi32(IMM8).as_i32x8(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i32x8()))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by imm8 bits, and store the lower 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shrdi_epi32&expand=5101)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shrdi_epi32<const IMM8: i32>(
+ k: __mmask8,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x8 = vpshrdvd256(
+ a.as_i32x8(),
+ b.as_i32x8(),
+ _mm256_set1_epi32(IMM8).as_i32x8(),
+ );
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by imm8 bits, and store the lower 32-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shrdi_epi32&expand=5099)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_shrdi_epi32<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(vpshrdvd128(
+ a.as_i32x4(),
+ b.as_i32x4(),
+ _mm_set1_epi32(IMM8).as_i32x4(),
+ ))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by imm8 bits, and store the lower 32-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shrdi_epi32&expand=5097)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_shrdi_epi32<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x4 = vpshrdvd128(a.as_i32x4(), b.as_i32x4(), _mm_set1_epi32(IMM8).as_i32x4());
+ transmute(simd_select_bitmask(k, shf, src.as_i32x4()))
+}
+
+/// Concatenate packed 32-bit integers in b and a producing an intermediate 64-bit result. Shift the result right by imm8 bits, and store the lower 32-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shrdi_epi32&expand=5098)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_shrdi_epi32<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let shf: i32x4 = vpshrdvd128(a.as_i32x4(), b.as_i32x4(), _mm_set1_epi32(IMM8).as_i32x4());
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by imm8 bits, and store the lower 16-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_shrdi_epi16&expand=5096)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_shrdi_epi16<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ assert!(imm8 >= 0 && imm8 <= 255);
+ transmute(vpshrdvw(
+ a.as_i16x32(),
+ b.as_i16x32(),
+ _mm512_set1_epi16(imm8).as_i16x32(),
+ ))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by imm8 bits, and store the lower 16-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_shrdi_epi16&expand=5094)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm512_mask_shrdi_epi16<const IMM8: i32>(
+ src: __m512i,
+ k: __mmask32,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ assert!(imm8 >= 0 && imm8 <= 255);
+ let shf: i16x32 = vpshrdvw(
+ a.as_i16x32(),
+ b.as_i16x32(),
+ _mm512_set1_epi16(imm8).as_i16x32(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i16x32()))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by imm8 bits, and store the lower 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_shrdi_epi16&expand=5095)
+#[inline]
+#[target_feature(enable = "avx512vbmi2")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm512_maskz_shrdi_epi16<const IMM8: i32>(
+ k: __mmask32,
+ a: __m512i,
+ b: __m512i,
+) -> __m512i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ assert!(imm8 >= 0 && imm8 <= 255);
+ let shf: i16x32 = vpshrdvw(
+ a.as_i16x32(),
+ b.as_i16x32(),
+ _mm512_set1_epi16(imm8).as_i16x32(),
+ );
+ let zero = _mm512_setzero_si512().as_i16x32();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by imm8 bits, and store the lower 16-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_shrdi_epi16&expand=5093)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_shrdi_epi16<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ assert!(imm8 >= 0 && imm8 <= 255);
+ transmute(vpshrdvw256(
+ a.as_i16x16(),
+ b.as_i16x16(),
+ _mm256_set1_epi16(imm8).as_i16x16(),
+ ))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by imm8 bits, and store the lower 16-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_shrdi_epi16&expand=5091)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm256_mask_shrdi_epi16<const IMM8: i32>(
+ src: __m256i,
+ k: __mmask16,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ assert!(imm8 >= 0 && imm8 <= 255);
+ let shf: i16x16 = vpshrdvw256(
+ a.as_i16x16(),
+ b.as_i16x16(),
+ _mm256_set1_epi16(imm8).as_i16x16(),
+ );
+ transmute(simd_select_bitmask(k, shf, src.as_i16x16()))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by imm8 bits, and store the lower 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_shrdi_epi16&expand=5092)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm256_maskz_shrdi_epi16<const IMM8: i32>(
+ k: __mmask16,
+ a: __m256i,
+ b: __m256i,
+) -> __m256i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ let shf: i16x16 = vpshrdvw256(
+ a.as_i16x16(),
+ b.as_i16x16(),
+ _mm256_set1_epi16(imm8).as_i16x16(),
+ );
+ let zero = _mm256_setzero_si256().as_i16x16();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by imm8 bits, and store the lower 16-bits in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shrdi_epi16&expand=5090)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_shrdi_epi16<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ transmute(vpshrdvw128(
+ a.as_i16x8(),
+ b.as_i16x8(),
+ _mm_set1_epi16(imm8).as_i16x8(),
+ ))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by imm8 bits, and store the lower 16-bits in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_shrdi_epi16&expand=5088)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw
+#[rustc_legacy_const_generics(4)]
+pub unsafe fn _mm_mask_shrdi_epi16<const IMM8: i32>(
+ src: __m128i,
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ let shf: i16x8 = vpshrdvw128(a.as_i16x8(), b.as_i16x8(), _mm_set1_epi16(imm8).as_i16x8());
+ transmute(simd_select_bitmask(k, shf, src.as_i16x8()))
+}
+
+/// Concatenate packed 16-bit integers in b and a producing an intermediate 32-bit result. Shift the result right by imm8 bits, and store the lower 16-bits in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_shrdi_epi16&expand=5089)
+#[inline]
+#[target_feature(enable = "avx512vbmi2,avx512vl")]
+#[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn _mm_maskz_shrdi_epi16<const IMM8: i32>(
+ k: __mmask8,
+ a: __m128i,
+ b: __m128i,
+) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let imm8 = IMM8 as i16;
+ let shf: i16x8 = vpshrdvw128(a.as_i16x8(), b.as_i16x8(), _mm_set1_epi16(imm8).as_i16x8());
+ let zero = _mm_setzero_si128().as_i16x8();
+ transmute(simd_select_bitmask(k, shf, zero))
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.avx512.mask.compress.store.w.512"]
+ fn vcompressstorew(mem: *mut i8, data: i16x32, mask: u32);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.w.256"]
+ fn vcompressstorew256(mem: *mut i8, data: i16x16, mask: u16);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.w.128"]
+ fn vcompressstorew128(mem: *mut i8, data: i16x8, mask: u8);
+
+ #[link_name = "llvm.x86.avx512.mask.compress.store.b.512"]
+ fn vcompressstoreb(mem: *mut i8, data: i8x64, mask: u64);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.b.256"]
+ fn vcompressstoreb256(mem: *mut i8, data: i8x32, mask: u32);
+ #[link_name = "llvm.x86.avx512.mask.compress.store.b.128"]
+ fn vcompressstoreb128(mem: *mut i8, data: i8x16, mask: u16);
+
+ #[link_name = "llvm.x86.avx512.mask.compress.w.512"]
+ fn vpcompressw(a: i16x32, src: i16x32, mask: u32) -> i16x32;
+ #[link_name = "llvm.x86.avx512.mask.compress.w.256"]
+ fn vpcompressw256(a: i16x16, src: i16x16, mask: u16) -> i16x16;
+ #[link_name = "llvm.x86.avx512.mask.compress.w.128"]
+ fn vpcompressw128(a: i16x8, src: i16x8, mask: u8) -> i16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.compress.b.512"]
+ fn vpcompressb(a: i8x64, src: i8x64, mask: u64) -> i8x64;
+ #[link_name = "llvm.x86.avx512.mask.compress.b.256"]
+ fn vpcompressb256(a: i8x32, src: i8x32, mask: u32) -> i8x32;
+ #[link_name = "llvm.x86.avx512.mask.compress.b.128"]
+ fn vpcompressb128(a: i8x16, src: i8x16, mask: u16) -> i8x16;
+
+ #[link_name = "llvm.x86.avx512.mask.expand.w.512"]
+ fn vpexpandw(a: i16x32, src: i16x32, mask: u32) -> i16x32;
+ #[link_name = "llvm.x86.avx512.mask.expand.w.256"]
+ fn vpexpandw256(a: i16x16, src: i16x16, mask: u16) -> i16x16;
+ #[link_name = "llvm.x86.avx512.mask.expand.w.128"]
+ fn vpexpandw128(a: i16x8, src: i16x8, mask: u8) -> i16x8;
+
+ #[link_name = "llvm.x86.avx512.mask.expand.b.512"]
+ fn vpexpandb(a: i8x64, src: i8x64, mask: u64) -> i8x64;
+ #[link_name = "llvm.x86.avx512.mask.expand.b.256"]
+ fn vpexpandb256(a: i8x32, src: i8x32, mask: u32) -> i8x32;
+ #[link_name = "llvm.x86.avx512.mask.expand.b.128"]
+ fn vpexpandb128(a: i8x16, src: i8x16, mask: u16) -> i8x16;
+
+ #[link_name = "llvm.fshl.v8i64"]
+ fn vpshldvq(a: i64x8, b: i64x8, c: i64x8) -> i64x8;
+ #[link_name = "llvm.fshl.v4i64"]
+ fn vpshldvq256(a: i64x4, b: i64x4, c: i64x4) -> i64x4;
+ #[link_name = "llvm.fshl.v2i64"]
+ fn vpshldvq128(a: i64x2, b: i64x2, c: i64x2) -> i64x2;
+ #[link_name = "llvm.fshl.v16i32"]
+ fn vpshldvd(a: i32x16, b: i32x16, c: i32x16) -> i32x16;
+ #[link_name = "llvm.fshl.v8i32"]
+ fn vpshldvd256(a: i32x8, b: i32x8, c: i32x8) -> i32x8;
+ #[link_name = "llvm.fshl.v4i32"]
+ fn vpshldvd128(a: i32x4, b: i32x4, c: i32x4) -> i32x4;
+ #[link_name = "llvm.fshl.v32i16"]
+ fn vpshldvw(a: i16x32, b: i16x32, c: i16x32) -> i16x32;
+ #[link_name = "llvm.fshl.v16i16"]
+ fn vpshldvw256(a: i16x16, b: i16x16, c: i16x16) -> i16x16;
+ #[link_name = "llvm.fshl.v8i16"]
+ fn vpshldvw128(a: i16x8, b: i16x8, c: i16x8) -> i16x8;
+
+ #[link_name = "llvm.fshr.v8i64"]
+ fn vpshrdvq(a: i64x8, b: i64x8, c: i64x8) -> i64x8;
+ #[link_name = "llvm.fshr.v4i64"]
+ fn vpshrdvq256(a: i64x4, b: i64x4, c: i64x4) -> i64x4;
+ #[link_name = "llvm.fshr.v2i64"]
+ fn vpshrdvq128(a: i64x2, b: i64x2, c: i64x2) -> i64x2;
+ #[link_name = "llvm.fshr.v16i32"]
+ fn vpshrdvd(a: i32x16, b: i32x16, c: i32x16) -> i32x16;
+ #[link_name = "llvm.fshr.v8i32"]
+ fn vpshrdvd256(a: i32x8, b: i32x8, c: i32x8) -> i32x8;
+ #[link_name = "llvm.fshr.v4i32"]
+ fn vpshrdvd128(a: i32x4, b: i32x4, c: i32x4) -> i32x4;
+ #[link_name = "llvm.fshr.v32i16"]
+ fn vpshrdvw(a: i16x32, b: i16x32, c: i16x32) -> i16x32;
+ #[link_name = "llvm.fshr.v16i16"]
+ fn vpshrdvw256(a: i16x16, b: i16x16, c: i16x16) -> i16x16;
+ #[link_name = "llvm.fshr.v8i16"]
+ fn vpshrdvw128(a: i16x8, b: i16x8, c: i16x8) -> i16x8;
+}
+
+#[cfg(test)]
+mod tests {
+
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+ use crate::hint::black_box;
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_compress_epi16() {
+ let src = _mm512_set1_epi16(200);
+ #[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_compress_epi16(src, 0b01010101_01010101_01010101_01010101, a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi16(
+ 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
+ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_compress_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_compress_epi16(0b01010101_01010101_01010101_01010101, a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi16(
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_compress_epi16() {
+ let src = _mm256_set1_epi16(200);
+ 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_compress_epi16(src, 0b01010101_01010101, a);
+ let e = _mm256_set_epi16(
+ 200, 200, 200, 200, 200, 200, 200, 200, 1, 3, 5, 7, 9, 11, 13, 15,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_compress_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_compress_epi16(0b01010101_01010101, a);
+ let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 5, 7, 9, 11, 13, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_compress_epi16() {
+ let src = _mm_set1_epi16(200);
+ let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm_mask_compress_epi16(src, 0b01010101, a);
+ let e = _mm_set_epi16(200, 200, 200, 200, 1, 3, 5, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_compress_epi16() {
+ let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm_maskz_compress_epi16(0b01010101, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 1, 3, 5, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_compress_epi8() {
+ let src = _mm512_set1_epi8(100);
+ #[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 r = _mm512_mask_compress_epi8(
+ src,
+ 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101,
+ a,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_set_epi8(
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
+ 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_compress_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 r = _mm512_maskz_compress_epi8(
+ 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101,
+ a,
+ );
+ #[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,
+ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
+ 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_compress_epi8() {
+ let src = _mm256_set1_epi8(100);
+ #[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 r = _mm256_mask_compress_epi8(src, 0b01010101_01010101_01010101_01010101, a);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi8(
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_compress_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 r = _mm256_maskz_compress_epi8(0b01010101_01010101_01010101_01010101, a);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi8(
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_compress_epi8() {
+ let src = _mm_set1_epi8(100);
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_mask_compress_epi8(src, 0b01010101_01010101, a);
+ let e = _mm_set_epi8(
+ 100, 100, 100, 100, 100, 100, 100, 100, 1, 3, 5, 7, 9, 11, 13, 15,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_compress_epi8() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_maskz_compress_epi8(0b01010101_01010101, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 5, 7, 9, 11, 13, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_expand_epi16() {
+ let src = _mm512_set1_epi16(200);
+ #[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_expand_epi16(src, 0b01010101_01010101_01010101_01010101, a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi16(
+ 200, 16, 200, 17, 200, 18, 200, 19, 200, 20, 200, 21, 200, 22, 200, 23,
+ 200, 24, 200, 25, 200, 26, 200, 27, 200, 28, 200, 29, 200, 30, 200, 31,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_expand_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_expand_epi16(0b01010101_01010101_01010101_01010101, a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi16(0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23,
+ 0, 24, 0, 25, 0, 26, 0, 27, 0, 28, 0, 29, 0, 30, 0, 31);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_expand_epi16() {
+ let src = _mm256_set1_epi16(200);
+ 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_expand_epi16(src, 0b01010101_01010101, a);
+ let e = _mm256_set_epi16(
+ 200, 8, 200, 9, 200, 10, 200, 11, 200, 12, 200, 13, 200, 14, 200, 15,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_expand_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_expand_epi16(0b01010101_01010101, a);
+ let e = _mm256_set_epi16(0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_expand_epi16() {
+ let src = _mm_set1_epi16(200);
+ let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm_mask_expand_epi16(src, 0b01010101, a);
+ let e = _mm_set_epi16(200, 4, 200, 5, 200, 6, 200, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_expand_epi16() {
+ let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm_maskz_expand_epi16(0b01010101, a);
+ let e = _mm_set_epi16(0, 4, 0, 5, 0, 6, 0, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_expand_epi8() {
+ let src = _mm512_set1_epi8(100);
+ #[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 r = _mm512_mask_expand_epi8(
+ src,
+ 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101,
+ a,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_set_epi8(
+ 100, 32, 100, 33, 100, 34, 100, 35, 100, 36, 100, 37, 100, 38, 100, 39,
+ 100, 40, 100, 41, 100, 42, 100, 43, 100, 44, 100, 45, 100, 46, 100, 47,
+ 100, 48, 100, 49, 100, 50, 100, 51, 100, 52, 100, 53, 100, 54, 100, 55,
+ 100, 56, 100, 57, 100, 58, 100, 59, 100, 60, 100, 61, 100, 62, 100, 63,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_expand_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 r = _mm512_maskz_expand_epi8(
+ 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101,
+ a,
+ );
+ #[rustfmt::skip]
+ let e = _mm512_set_epi8(
+ 0, 32, 0, 33, 0, 34, 0, 35, 0, 36, 0, 37, 0, 38, 0, 39,
+ 0, 40, 0, 41, 0, 42, 0, 43, 0, 44, 0, 45, 0, 46, 0, 47,
+ 0, 48, 0, 49, 0, 50, 0, 51, 0, 52, 0, 53, 0, 54, 0, 55,
+ 0, 56, 0, 57, 0, 58, 0, 59, 0, 60, 0, 61, 0, 62, 0, 63,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_expand_epi8() {
+ let src = _mm256_set1_epi8(100);
+ #[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 r = _mm256_mask_expand_epi8(src, 0b01010101_01010101_01010101_01010101, a);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi8(
+ 100, 16, 100, 17, 100, 18, 100, 19, 100, 20, 100, 21, 100, 22, 100, 23,
+ 100, 24, 100, 25, 100, 26, 100, 27, 100, 28, 100, 29, 100, 30, 100, 31,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_expand_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 r = _mm256_maskz_expand_epi8(0b01010101_01010101_01010101_01010101, a);
+ #[rustfmt::skip]
+ let e = _mm256_set_epi8(
+ 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23,
+ 0, 24, 0, 25, 0, 26, 0, 27, 0, 28, 0, 29, 0, 30, 0, 31,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_expand_epi8() {
+ let src = _mm_set1_epi8(100);
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_mask_expand_epi8(src, 0b01010101_01010101, a);
+ let e = _mm_set_epi8(
+ 100, 8, 100, 9, 100, 10, 100, 11, 100, 12, 100, 13, 100, 14, 100, 15,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_expand_epi8() {
+ let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_maskz_expand_epi8(0b01010101_01010101, a);
+ let e = _mm_set_epi8(0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shldv_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let b = _mm512_set1_epi64(1 << 63);
+ let c = _mm512_set1_epi64(2);
+ let r = _mm512_shldv_epi64(a, b, c);
+ let e = _mm512_set1_epi64(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shldv_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let b = _mm512_set1_epi64(1 << 63);
+ let c = _mm512_set1_epi64(2);
+ let r = _mm512_mask_shldv_epi64(a, 0, b, c);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shldv_epi64(a, 0b11111111, b, c);
+ let e = _mm512_set1_epi64(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shldv_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let b = _mm512_set1_epi64(1 << 63);
+ let c = _mm512_set1_epi64(2);
+ let r = _mm512_maskz_shldv_epi64(0, a, b, c);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shldv_epi64(0b11111111, a, b, c);
+ let e = _mm512_set1_epi64(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shldv_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let b = _mm256_set1_epi64x(1 << 63);
+ let c = _mm256_set1_epi64x(2);
+ let r = _mm256_shldv_epi64(a, b, c);
+ let e = _mm256_set1_epi64x(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shldv_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let b = _mm256_set1_epi64x(1 << 63);
+ let c = _mm256_set1_epi64x(2);
+ let r = _mm256_mask_shldv_epi64(a, 0, b, c);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shldv_epi64(a, 0b00001111, b, c);
+ let e = _mm256_set1_epi64x(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shldv_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let b = _mm256_set1_epi64x(1 << 63);
+ let c = _mm256_set1_epi64x(2);
+ let r = _mm256_maskz_shldv_epi64(0, a, b, c);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shldv_epi64(0b00001111, a, b, c);
+ let e = _mm256_set1_epi64x(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shldv_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let b = _mm_set1_epi64x(1 << 63);
+ let c = _mm_set1_epi64x(2);
+ let r = _mm_shldv_epi64(a, b, c);
+ let e = _mm_set1_epi64x(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shldv_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let b = _mm_set1_epi64x(1 << 63);
+ let c = _mm_set1_epi64x(2);
+ let r = _mm_mask_shldv_epi64(a, 0, b, c);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shldv_epi64(a, 0b00000011, b, c);
+ let e = _mm_set1_epi64x(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shldv_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let b = _mm_set1_epi64x(1 << 63);
+ let c = _mm_set1_epi64x(2);
+ let r = _mm_maskz_shldv_epi64(0, a, b, c);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shldv_epi64(0b00000011, a, b, c);
+ let e = _mm_set1_epi64x(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shldv_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_set1_epi32(1 << 31);
+ let c = _mm512_set1_epi32(2);
+ let r = _mm512_shldv_epi32(a, b, c);
+ let e = _mm512_set1_epi32(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shldv_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_set1_epi32(1 << 31);
+ let c = _mm512_set1_epi32(2);
+ let r = _mm512_mask_shldv_epi32(a, 0, b, c);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shldv_epi32(a, 0b11111111_11111111, b, c);
+ let e = _mm512_set1_epi32(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shldv_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_set1_epi32(1 << 31);
+ let c = _mm512_set1_epi32(2);
+ let r = _mm512_maskz_shldv_epi32(0, a, b, c);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shldv_epi32(0b11111111_11111111, a, b, c);
+ let e = _mm512_set1_epi32(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shldv_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set1_epi32(1 << 31);
+ let c = _mm256_set1_epi32(2);
+ let r = _mm256_shldv_epi32(a, b, c);
+ let e = _mm256_set1_epi32(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shldv_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set1_epi32(1 << 31);
+ let c = _mm256_set1_epi32(2);
+ let r = _mm256_mask_shldv_epi32(a, 0, b, c);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shldv_epi32(a, 0b11111111, b, c);
+ let e = _mm256_set1_epi32(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shldv_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set1_epi32(1 << 31);
+ let c = _mm256_set1_epi32(2);
+ let r = _mm256_maskz_shldv_epi32(0, a, b, c);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shldv_epi32(0b11111111, a, b, c);
+ let e = _mm256_set1_epi32(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shldv_epi32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set1_epi32(1 << 31);
+ let c = _mm_set1_epi32(2);
+ let r = _mm_shldv_epi32(a, b, c);
+ let e = _mm_set1_epi32(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shldv_epi32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set1_epi32(1 << 31);
+ let c = _mm_set1_epi32(2);
+ let r = _mm_mask_shldv_epi32(a, 0, b, c);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shldv_epi32(a, 0b00001111, b, c);
+ let e = _mm_set1_epi32(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shldv_epi32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set1_epi32(1 << 31);
+ let c = _mm_set1_epi32(2);
+ let r = _mm_maskz_shldv_epi32(0, a, b, c);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shldv_epi32(0b00001111, a, b, c);
+ let e = _mm_set1_epi32(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shldv_epi16() {
+ let a = _mm512_set1_epi16(1);
+ let b = _mm512_set1_epi16(1 << 15);
+ let c = _mm512_set1_epi16(2);
+ let r = _mm512_shldv_epi16(a, b, c);
+ let e = _mm512_set1_epi16(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shldv_epi16() {
+ let a = _mm512_set1_epi16(1);
+ let b = _mm512_set1_epi16(1 << 15);
+ let c = _mm512_set1_epi16(2);
+ let r = _mm512_mask_shldv_epi16(a, 0, b, c);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shldv_epi16(a, 0b11111111_11111111_11111111_11111111, b, c);
+ let e = _mm512_set1_epi16(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shldv_epi16() {
+ let a = _mm512_set1_epi16(1);
+ let b = _mm512_set1_epi16(1 << 15);
+ let c = _mm512_set1_epi16(2);
+ let r = _mm512_maskz_shldv_epi16(0, a, b, c);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shldv_epi16(0b11111111_11111111_11111111_11111111, a, b, c);
+ let e = _mm512_set1_epi16(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shldv_epi16() {
+ let a = _mm256_set1_epi16(1);
+ let b = _mm256_set1_epi16(1 << 15);
+ let c = _mm256_set1_epi16(2);
+ let r = _mm256_shldv_epi16(a, b, c);
+ let e = _mm256_set1_epi16(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shldv_epi16() {
+ let a = _mm256_set1_epi16(1);
+ let b = _mm256_set1_epi16(1 << 15);
+ let c = _mm256_set1_epi16(2);
+ let r = _mm256_mask_shldv_epi16(a, 0, b, c);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shldv_epi16(a, 0b11111111_11111111, b, c);
+ let e = _mm256_set1_epi16(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shldv_epi16() {
+ let a = _mm256_set1_epi16(1);
+ let b = _mm256_set1_epi16(1 << 15);
+ let c = _mm256_set1_epi16(2);
+ let r = _mm256_maskz_shldv_epi16(0, a, b, c);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shldv_epi16(0b11111111_11111111, a, b, c);
+ let e = _mm256_set1_epi16(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shldv_epi16() {
+ let a = _mm_set1_epi16(1);
+ let b = _mm_set1_epi16(1 << 15);
+ let c = _mm_set1_epi16(2);
+ let r = _mm_shldv_epi16(a, b, c);
+ let e = _mm_set1_epi16(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shldv_epi16() {
+ let a = _mm_set1_epi16(1);
+ let b = _mm_set1_epi16(1 << 15);
+ let c = _mm_set1_epi16(2);
+ let r = _mm_mask_shldv_epi16(a, 0, b, c);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shldv_epi16(a, 0b11111111, b, c);
+ let e = _mm_set1_epi16(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shldv_epi16() {
+ let a = _mm_set1_epi16(1);
+ let b = _mm_set1_epi16(1 << 15);
+ let c = _mm_set1_epi16(2);
+ let r = _mm_maskz_shldv_epi16(0, a, b, c);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shldv_epi16(0b11111111, a, b, c);
+ let e = _mm_set1_epi16(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shrdv_epi64() {
+ let a = _mm512_set1_epi64(8);
+ let b = _mm512_set1_epi64(2);
+ let c = _mm512_set1_epi64(1);
+ let r = _mm512_shrdv_epi64(a, b, c);
+ let e = _mm512_set1_epi64(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shrdv_epi64() {
+ let a = _mm512_set1_epi64(8);
+ let b = _mm512_set1_epi64(2);
+ let c = _mm512_set1_epi64(1);
+ let r = _mm512_mask_shrdv_epi64(a, 0, b, c);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shrdv_epi64(a, 0b11111111, b, c);
+ let e = _mm512_set1_epi64(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shrdv_epi64() {
+ let a = _mm512_set1_epi64(8);
+ let b = _mm512_set1_epi64(2);
+ let c = _mm512_set1_epi64(1);
+ let r = _mm512_maskz_shrdv_epi64(0, a, b, c);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shrdv_epi64(0b11111111, a, b, c);
+ let e = _mm512_set1_epi64(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shrdv_epi64() {
+ let a = _mm256_set1_epi64x(8);
+ let b = _mm256_set1_epi64x(2);
+ let c = _mm256_set1_epi64x(1);
+ let r = _mm256_shrdv_epi64(a, b, c);
+ let e = _mm256_set1_epi64x(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shrdv_epi64() {
+ let a = _mm256_set1_epi64x(8);
+ let b = _mm256_set1_epi64x(2);
+ let c = _mm256_set1_epi64x(1);
+ let r = _mm256_mask_shrdv_epi64(a, 0, b, c);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shrdv_epi64(a, 0b00001111, b, c);
+ let e = _mm256_set1_epi64x(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shrdv_epi64() {
+ let a = _mm256_set1_epi64x(8);
+ let b = _mm256_set1_epi64x(2);
+ let c = _mm256_set1_epi64x(1);
+ let r = _mm256_maskz_shrdv_epi64(0, a, b, c);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shrdv_epi64(0b00001111, a, b, c);
+ let e = _mm256_set1_epi64x(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shrdv_epi64() {
+ let a = _mm_set1_epi64x(8);
+ let b = _mm_set1_epi64x(2);
+ let c = _mm_set1_epi64x(1);
+ let r = _mm_shrdv_epi64(a, b, c);
+ let e = _mm_set1_epi64x(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shrdv_epi64() {
+ let a = _mm_set1_epi64x(8);
+ let b = _mm_set1_epi64x(2);
+ let c = _mm_set1_epi64x(1);
+ let r = _mm_mask_shrdv_epi64(a, 0, b, c);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shrdv_epi64(a, 0b00000011, b, c);
+ let e = _mm_set1_epi64x(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shrdv_epi64() {
+ let a = _mm_set1_epi64x(8);
+ let b = _mm_set1_epi64x(2);
+ let c = _mm_set1_epi64x(1);
+ let r = _mm_maskz_shrdv_epi64(0, a, b, c);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shrdv_epi64(0b00000011, a, b, c);
+ let e = _mm_set1_epi64x(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shrdv_epi32() {
+ let a = _mm512_set1_epi32(8);
+ let b = _mm512_set1_epi32(2);
+ let c = _mm512_set1_epi32(1);
+ let r = _mm512_shrdv_epi32(a, b, c);
+ let e = _mm512_set1_epi32(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shrdv_epi32() {
+ let a = _mm512_set1_epi32(8);
+ let b = _mm512_set1_epi32(2);
+ let c = _mm512_set1_epi32(1);
+ let r = _mm512_mask_shrdv_epi32(a, 0, b, c);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shrdv_epi32(a, 0b11111111_11111111, b, c);
+ let e = _mm512_set1_epi32(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shrdv_epi32() {
+ let a = _mm512_set1_epi32(8);
+ let b = _mm512_set1_epi32(2);
+ let c = _mm512_set1_epi32(1);
+ let r = _mm512_maskz_shrdv_epi32(0, a, b, c);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shrdv_epi32(0b11111111_11111111, a, b, c);
+ let e = _mm512_set1_epi32(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shrdv_epi32() {
+ let a = _mm256_set1_epi32(8);
+ let b = _mm256_set1_epi32(2);
+ let c = _mm256_set1_epi32(1);
+ let r = _mm256_shrdv_epi32(a, b, c);
+ let e = _mm256_set1_epi32(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shrdv_epi32() {
+ let a = _mm256_set1_epi32(8);
+ let b = _mm256_set1_epi32(2);
+ let c = _mm256_set1_epi32(1);
+ let r = _mm256_mask_shrdv_epi32(a, 0, b, c);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shrdv_epi32(a, 0b11111111, b, c);
+ let e = _mm256_set1_epi32(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shrdv_epi32() {
+ let a = _mm256_set1_epi32(8);
+ let b = _mm256_set1_epi32(2);
+ let c = _mm256_set1_epi32(1);
+ let r = _mm256_maskz_shrdv_epi32(0, a, b, c);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shrdv_epi32(0b11111111, a, b, c);
+ let e = _mm256_set1_epi32(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shrdv_epi32() {
+ let a = _mm_set1_epi32(8);
+ let b = _mm_set1_epi32(2);
+ let c = _mm_set1_epi32(1);
+ let r = _mm_shrdv_epi32(a, b, c);
+ let e = _mm_set1_epi32(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shrdv_epi32() {
+ let a = _mm_set1_epi32(8);
+ let b = _mm_set1_epi32(2);
+ let c = _mm_set1_epi32(1);
+ let r = _mm_mask_shrdv_epi32(a, 0, b, c);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shrdv_epi32(a, 0b00001111, b, c);
+ let e = _mm_set1_epi32(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shrdv_epi32() {
+ let a = _mm_set1_epi32(8);
+ let b = _mm_set1_epi32(2);
+ let c = _mm_set1_epi32(1);
+ let r = _mm_maskz_shrdv_epi32(0, a, b, c);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shrdv_epi32(0b00001111, a, b, c);
+ let e = _mm_set1_epi32(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shrdv_epi16() {
+ let a = _mm512_set1_epi16(8);
+ let b = _mm512_set1_epi16(2);
+ let c = _mm512_set1_epi16(1);
+ let r = _mm512_shrdv_epi16(a, b, c);
+ let e = _mm512_set1_epi16(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shrdv_epi16() {
+ let a = _mm512_set1_epi16(8);
+ let b = _mm512_set1_epi16(2);
+ let c = _mm512_set1_epi16(1);
+ let r = _mm512_mask_shrdv_epi16(a, 0, b, c);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shrdv_epi16(a, 0b11111111_11111111_11111111_11111111, b, c);
+ let e = _mm512_set1_epi16(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shrdv_epi16() {
+ let a = _mm512_set1_epi16(8);
+ let b = _mm512_set1_epi16(2);
+ let c = _mm512_set1_epi16(1);
+ let r = _mm512_maskz_shrdv_epi16(0, a, b, c);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shrdv_epi16(0b11111111_11111111_11111111_11111111, a, b, c);
+ let e = _mm512_set1_epi16(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shrdv_epi16() {
+ let a = _mm256_set1_epi16(8);
+ let b = _mm256_set1_epi16(2);
+ let c = _mm256_set1_epi16(1);
+ let r = _mm256_shrdv_epi16(a, b, c);
+ let e = _mm256_set1_epi16(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shrdv_epi16() {
+ let a = _mm256_set1_epi16(8);
+ let b = _mm256_set1_epi16(2);
+ let c = _mm256_set1_epi16(1);
+ let r = _mm256_mask_shrdv_epi16(a, 0, b, c);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shrdv_epi16(a, 0b11111111_11111111, b, c);
+ let e = _mm256_set1_epi16(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shrdv_epi16() {
+ let a = _mm256_set1_epi16(8);
+ let b = _mm256_set1_epi16(2);
+ let c = _mm256_set1_epi16(1);
+ let r = _mm256_maskz_shrdv_epi16(0, a, b, c);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shrdv_epi16(0b11111111_11111111, a, b, c);
+ let e = _mm256_set1_epi16(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shrdv_epi16() {
+ let a = _mm_set1_epi16(8);
+ let b = _mm_set1_epi16(2);
+ let c = _mm_set1_epi16(1);
+ let r = _mm_shrdv_epi16(a, b, c);
+ let e = _mm_set1_epi16(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shrdv_epi16() {
+ let a = _mm_set1_epi16(8);
+ let b = _mm_set1_epi16(2);
+ let c = _mm_set1_epi16(1);
+ let r = _mm_mask_shrdv_epi16(a, 0, b, c);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shrdv_epi16(a, 0b11111111, b, c);
+ let e = _mm_set1_epi16(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shrdv_epi16() {
+ let a = _mm_set1_epi16(8);
+ let b = _mm_set1_epi16(2);
+ let c = _mm_set1_epi16(1);
+ let r = _mm_maskz_shrdv_epi16(0, a, b, c);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shrdv_epi16(0b11111111, a, b, c);
+ let e = _mm_set1_epi16(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shldi_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let b = _mm512_set1_epi64(1 << 63);
+ let r = _mm512_shldi_epi64::<2>(a, b);
+ let e = _mm512_set1_epi64(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shldi_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let b = _mm512_set1_epi64(1 << 63);
+ let r = _mm512_mask_shldi_epi64::<2>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shldi_epi64::<2>(a, 0b11111111, a, b);
+ let e = _mm512_set1_epi64(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shldi_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let b = _mm512_set1_epi64(1 << 63);
+ let r = _mm512_maskz_shldi_epi64::<2>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shldi_epi64::<2>(0b11111111, a, b);
+ let e = _mm512_set1_epi64(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shldi_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let b = _mm256_set1_epi64x(1 << 63);
+ let r = _mm256_shldi_epi64::<2>(a, b);
+ let e = _mm256_set1_epi64x(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shldi_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let b = _mm256_set1_epi64x(1 << 63);
+ let r = _mm256_mask_shldi_epi64::<2>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shldi_epi64::<2>(a, 0b00001111, a, b);
+ let e = _mm256_set1_epi64x(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shldi_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let b = _mm256_set1_epi64x(1 << 63);
+ let r = _mm256_maskz_shldi_epi64::<2>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shldi_epi64::<2>(0b00001111, a, b);
+ let e = _mm256_set1_epi64x(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shldi_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let b = _mm_set1_epi64x(1 << 63);
+ let r = _mm_shldi_epi64::<2>(a, b);
+ let e = _mm_set1_epi64x(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shldi_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let b = _mm_set1_epi64x(1 << 63);
+ let r = _mm_mask_shldi_epi64::<2>(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shldi_epi64::<2>(a, 0b00000011, a, b);
+ let e = _mm_set1_epi64x(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shldi_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let b = _mm_set1_epi64x(1 << 63);
+ let r = _mm_maskz_shldi_epi64::<2>(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shldi_epi64::<2>(0b00000011, a, b);
+ let e = _mm_set1_epi64x(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shldi_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_set1_epi32(1 << 31);
+ let r = _mm512_shldi_epi32::<2>(a, b);
+ let e = _mm512_set1_epi32(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shldi_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_set1_epi32(1 << 31);
+ let r = _mm512_mask_shldi_epi32::<2>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shldi_epi32::<2>(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set1_epi32(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shldi_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_set1_epi32(1 << 31);
+ let r = _mm512_maskz_shldi_epi32::<2>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shldi_epi32::<2>(0b11111111_11111111, a, b);
+ let e = _mm512_set1_epi32(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shldi_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set1_epi32(1 << 31);
+ let r = _mm256_shldi_epi32::<2>(a, b);
+ let e = _mm256_set1_epi32(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shldi_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set1_epi32(1 << 31);
+ let r = _mm256_mask_shldi_epi32::<2>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shldi_epi32::<2>(a, 0b11111111, a, b);
+ let e = _mm256_set1_epi32(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shldi_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set1_epi32(1 << 31);
+ let r = _mm256_maskz_shldi_epi32::<2>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shldi_epi32::<2>(0b11111111, a, b);
+ let e = _mm256_set1_epi32(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shldi_epi32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set1_epi32(1 << 31);
+ let r = _mm_shldi_epi32::<2>(a, b);
+ let e = _mm_set1_epi32(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shldi_epi32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set1_epi32(1 << 31);
+ let r = _mm_mask_shldi_epi32::<2>(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shldi_epi32::<2>(a, 0b00001111, a, b);
+ let e = _mm_set1_epi32(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shldi_epi32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set1_epi32(1 << 31);
+ let r = _mm_maskz_shldi_epi32::<2>(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shldi_epi32::<2>(0b00001111, a, b);
+ let e = _mm_set1_epi32(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shldi_epi16() {
+ let a = _mm512_set1_epi16(1);
+ let b = _mm512_set1_epi16(1 << 15);
+ let r = _mm512_shldi_epi16::<2>(a, b);
+ let e = _mm512_set1_epi16(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shldi_epi16() {
+ let a = _mm512_set1_epi16(1);
+ let b = _mm512_set1_epi16(1 << 15);
+ let r = _mm512_mask_shldi_epi16::<2>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shldi_epi16::<2>(a, 0b11111111_11111111_11111111_11111111, a, b);
+ let e = _mm512_set1_epi16(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shldi_epi16() {
+ let a = _mm512_set1_epi16(1);
+ let b = _mm512_set1_epi16(1 << 15);
+ let r = _mm512_maskz_shldi_epi16::<2>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shldi_epi16::<2>(0b11111111_11111111_11111111_11111111, a, b);
+ let e = _mm512_set1_epi16(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shldi_epi16() {
+ let a = _mm256_set1_epi16(1);
+ let b = _mm256_set1_epi16(1 << 15);
+ let r = _mm256_shldi_epi16::<2>(a, b);
+ let e = _mm256_set1_epi16(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shldi_epi16() {
+ let a = _mm256_set1_epi16(1);
+ let b = _mm256_set1_epi16(1 << 15);
+ let r = _mm256_mask_shldi_epi16::<2>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shldi_epi16::<2>(a, 0b11111111_11111111, a, b);
+ let e = _mm256_set1_epi16(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shldi_epi16() {
+ let a = _mm256_set1_epi16(1);
+ let b = _mm256_set1_epi16(1 << 15);
+ let r = _mm256_maskz_shldi_epi16::<2>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shldi_epi16::<2>(0b11111111_11111111, a, b);
+ let e = _mm256_set1_epi16(6);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shldi_epi16() {
+ let a = _mm_set1_epi16(1);
+ let b = _mm_set1_epi16(1 << 15);
+ let r = _mm_shldi_epi16::<2>(a, b);
+ let e = _mm_set1_epi16(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shldi_epi16() {
+ let a = _mm_set1_epi16(1);
+ let b = _mm_set1_epi16(1 << 15);
+ let r = _mm_mask_shldi_epi16::<2>(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shldi_epi16::<2>(a, 0b11111111, a, b);
+ let e = _mm_set1_epi16(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shldi_epi16() {
+ let a = _mm_set1_epi16(1);
+ let b = _mm_set1_epi16(1 << 15);
+ let r = _mm_maskz_shldi_epi16::<2>(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shldi_epi16::<2>(0b11111111, a, b);
+ let e = _mm_set1_epi16(6);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shrdi_epi64() {
+ let a = _mm512_set1_epi64(8);
+ let b = _mm512_set1_epi64(2);
+ let r = _mm512_shrdi_epi64::<1>(a, b);
+ let e = _mm512_set1_epi64(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shrdi_epi64() {
+ let a = _mm512_set1_epi64(8);
+ let b = _mm512_set1_epi64(2);
+ let r = _mm512_mask_shrdi_epi64::<1>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shrdi_epi64::<1>(a, 0b11111111, a, b);
+ let e = _mm512_set1_epi64(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shrdi_epi64() {
+ let a = _mm512_set1_epi64(8);
+ let b = _mm512_set1_epi64(2);
+ let r = _mm512_maskz_shrdi_epi64::<1>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shrdi_epi64::<1>(0b11111111, a, b);
+ let e = _mm512_set1_epi64(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shrdi_epi64() {
+ let a = _mm256_set1_epi64x(8);
+ let b = _mm256_set1_epi64x(2);
+ let r = _mm256_shrdi_epi64::<1>(a, b);
+ let e = _mm256_set1_epi64x(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shrdi_epi64() {
+ let a = _mm256_set1_epi64x(8);
+ let b = _mm256_set1_epi64x(2);
+ let r = _mm256_mask_shrdi_epi64::<1>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shrdi_epi64::<1>(a, 0b00001111, a, b);
+ let e = _mm256_set1_epi64x(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shrdi_epi64() {
+ let a = _mm256_set1_epi64x(8);
+ let b = _mm256_set1_epi64x(2);
+ let r = _mm256_maskz_shrdi_epi64::<1>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shrdi_epi64::<1>(0b00001111, a, b);
+ let e = _mm256_set1_epi64x(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shrdi_epi64() {
+ let a = _mm_set1_epi64x(8);
+ let b = _mm_set1_epi64x(2);
+ let r = _mm_shrdi_epi64::<1>(a, b);
+ let e = _mm_set1_epi64x(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shrdi_epi64() {
+ let a = _mm_set1_epi64x(8);
+ let b = _mm_set1_epi64x(2);
+ let r = _mm_mask_shrdi_epi64::<1>(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shrdi_epi64::<1>(a, 0b00000011, a, b);
+ let e = _mm_set1_epi64x(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shrdi_epi64() {
+ let a = _mm_set1_epi64x(8);
+ let b = _mm_set1_epi64x(2);
+ let r = _mm_maskz_shrdi_epi64::<1>(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shrdi_epi64::<1>(0b00000011, a, b);
+ let e = _mm_set1_epi64x(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shrdi_epi32() {
+ let a = _mm512_set1_epi32(8);
+ let b = _mm512_set1_epi32(2);
+ let r = _mm512_shrdi_epi32::<1>(a, b);
+ let e = _mm512_set1_epi32(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shrdi_epi32() {
+ let a = _mm512_set1_epi32(8);
+ let b = _mm512_set1_epi32(2);
+ let r = _mm512_mask_shrdi_epi32::<1>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shrdi_epi32::<1>(a, 0b11111111_11111111, a, b);
+ let e = _mm512_set1_epi32(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shrdi_epi32() {
+ let a = _mm512_set1_epi32(8);
+ let b = _mm512_set1_epi32(2);
+ let r = _mm512_maskz_shrdi_epi32::<1>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shrdi_epi32::<1>(0b11111111_11111111, a, b);
+ let e = _mm512_set1_epi32(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shrdi_epi32() {
+ let a = _mm256_set1_epi32(8);
+ let b = _mm256_set1_epi32(2);
+ let r = _mm256_shrdi_epi32::<1>(a, b);
+ let e = _mm256_set1_epi32(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shrdi_epi32() {
+ let a = _mm256_set1_epi32(8);
+ let b = _mm256_set1_epi32(2);
+ let r = _mm256_mask_shrdi_epi32::<1>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shrdi_epi32::<1>(a, 0b11111111, a, b);
+ let e = _mm256_set1_epi32(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shrdi_epi32() {
+ let a = _mm256_set1_epi32(8);
+ let b = _mm256_set1_epi32(2);
+ let r = _mm256_maskz_shrdi_epi32::<1>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shrdi_epi32::<1>(0b11111111, a, b);
+ let e = _mm256_set1_epi32(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shrdi_epi32() {
+ let a = _mm_set1_epi32(8);
+ let b = _mm_set1_epi32(2);
+ let r = _mm_shrdi_epi32::<1>(a, b);
+ let e = _mm_set1_epi32(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shrdi_epi32() {
+ let a = _mm_set1_epi32(8);
+ let b = _mm_set1_epi32(2);
+ let r = _mm_mask_shrdi_epi32::<1>(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shrdi_epi32::<1>(a, 0b00001111, a, b);
+ let e = _mm_set1_epi32(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shrdi_epi32() {
+ let a = _mm_set1_epi32(8);
+ let b = _mm_set1_epi32(2);
+ let r = _mm_maskz_shrdi_epi32::<1>(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shrdi_epi32::<1>(0b00001111, a, b);
+ let e = _mm_set1_epi32(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_shrdi_epi16() {
+ let a = _mm512_set1_epi16(8);
+ let b = _mm512_set1_epi16(2);
+ let r = _mm512_shrdi_epi16::<1>(a, b);
+ let e = _mm512_set1_epi16(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_shrdi_epi16() {
+ let a = _mm512_set1_epi16(8);
+ let b = _mm512_set1_epi16(2);
+ let r = _mm512_mask_shrdi_epi16::<1>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shrdi_epi16::<1>(a, 0b11111111_11111111_11111111_11111111, a, b);
+ let e = _mm512_set1_epi16(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_shrdi_epi16() {
+ let a = _mm512_set1_epi16(8);
+ let b = _mm512_set1_epi16(2);
+ let r = _mm512_maskz_shrdi_epi16::<1>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shrdi_epi16::<1>(0b11111111_11111111_11111111_11111111, a, b);
+ let e = _mm512_set1_epi16(1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_shrdi_epi16() {
+ let a = _mm256_set1_epi16(8);
+ let b = _mm256_set1_epi16(2);
+ let r = _mm256_shrdi_epi16::<1>(a, b);
+ let e = _mm256_set1_epi16(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_shrdi_epi16() {
+ let a = _mm256_set1_epi16(8);
+ let b = _mm256_set1_epi16(2);
+ let r = _mm256_mask_shrdi_epi16::<1>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shrdi_epi16::<1>(a, 0b11111111_11111111, a, b);
+ let e = _mm256_set1_epi16(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_shrdi_epi16() {
+ let a = _mm256_set1_epi16(8);
+ let b = _mm256_set1_epi16(2);
+ let r = _mm256_maskz_shrdi_epi16::<1>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shrdi_epi16::<1>(0b11111111_11111111, a, b);
+ let e = _mm256_set1_epi16(1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_shrdi_epi16() {
+ let a = _mm_set1_epi16(8);
+ let b = _mm_set1_epi16(2);
+ let r = _mm_shrdi_epi16::<1>(a, b);
+ let e = _mm_set1_epi16(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_shrdi_epi16() {
+ let a = _mm_set1_epi16(8);
+ let b = _mm_set1_epi16(2);
+ let r = _mm_mask_shrdi_epi16::<1>(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_shrdi_epi16::<1>(a, 0b11111111, a, b);
+ let e = _mm_set1_epi16(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_shrdi_epi16() {
+ let a = _mm_set1_epi16(8);
+ let b = _mm_set1_epi16(2);
+ let r = _mm_maskz_shrdi_epi16::<1>(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_shrdi_epi16::<1>(0b11111111, a, b);
+ let e = _mm_set1_epi16(1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_expandloadu_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 = 0b11101000_11001010_11110000_00001111;
+ let r = _mm512_mask_expandloadu_epi16(src, m, black_box(p));
+ let e = _mm512_set_epi16(
+ 16, 15, 14, 42, 13, 42, 42, 42, 12, 11, 42, 42, 10, 42, 9, 42, 8, 7, 6, 5, 42, 42, 42,
+ 42, 42, 42, 42, 42, 4, 3, 2, 1,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_expandloadu_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 = 0b11101000_11001010_11110000_00001111;
+ let r = _mm512_maskz_expandloadu_epi16(m, black_box(p));
+ let e = _mm512_set_epi16(
+ 16, 15, 14, 0, 13, 0, 0, 0, 12, 11, 0, 0, 10, 0, 9, 0, 8, 7, 6, 5, 0, 0, 0, 0, 0, 0, 0,
+ 0, 4, 3, 2, 1,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_expandloadu_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_expandloadu_epi16(src, m, black_box(p));
+ let e = _mm256_set_epi16(8, 7, 6, 42, 5, 42, 42, 42, 4, 3, 42, 42, 2, 42, 1, 42);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_expandloadu_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_expandloadu_epi16(m, black_box(p));
+ let e = _mm256_set_epi16(8, 7, 6, 0, 5, 0, 0, 0, 4, 3, 0, 0, 2, 0, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_expandloadu_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 = 0b11101000;
+ let r = _mm_mask_expandloadu_epi16(src, m, black_box(p));
+ let e = _mm_set_epi16(4, 3, 2, 42, 1, 42, 42, 42);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_expandloadu_epi16() {
+ let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8];
+ let p = a.as_ptr();
+ let m = 0b11101000;
+ let r = _mm_maskz_expandloadu_epi16(m, black_box(p));
+ let e = _mm_set_epi16(4, 3, 2, 0, 1, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_expandloadu_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 = 0b11101000_11001010_11110000_00001111_11111111_00000000_10101010_01010101;
+ let r = _mm512_mask_expandloadu_epi8(src, m, black_box(p));
+ let e = _mm512_set_epi8(
+ 32, 31, 30, 42, 29, 42, 42, 42, 28, 27, 42, 42, 26, 42, 25, 42, 24, 23, 22, 21, 42, 42,
+ 42, 42, 42, 42, 42, 42, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 42, 42, 42, 42,
+ 42, 42, 42, 42, 8, 42, 7, 42, 6, 42, 5, 42, 42, 4, 42, 3, 42, 2, 42, 1,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_maskz_expandloadu_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 = 0b11101000_11001010_11110000_00001111_11111111_00000000_10101010_01010101;
+ let r = _mm512_maskz_expandloadu_epi8(m, black_box(p));
+ let e = _mm512_set_epi8(
+ 32, 31, 30, 0, 29, 0, 0, 0, 28, 27, 0, 0, 26, 0, 25, 0, 24, 23, 22, 21, 0, 0, 0, 0, 0,
+ 0, 0, 0, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0,
+ 7, 0, 6, 0, 5, 0, 0, 4, 0, 3, 0, 2, 0, 1,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_expandloadu_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 = 0b11101000_11001010_11110000_00001111;
+ let r = _mm256_mask_expandloadu_epi8(src, m, black_box(p));
+ let e = _mm256_set_epi8(
+ 16, 15, 14, 42, 13, 42, 42, 42, 12, 11, 42, 42, 10, 42, 9, 42, 8, 7, 6, 5, 42, 42, 42,
+ 42, 42, 42, 42, 42, 4, 3, 2, 1,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_maskz_expandloadu_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 = 0b11101000_11001010_11110000_00001111;
+ let r = _mm256_maskz_expandloadu_epi8(m, black_box(p));
+ let e = _mm256_set_epi8(
+ 16, 15, 14, 0, 13, 0, 0, 0, 12, 11, 0, 0, 10, 0, 9, 0, 8, 7, 6, 5, 0, 0, 0, 0, 0, 0, 0,
+ 0, 4, 3, 2, 1,
+ );
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_expandloadu_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_expandloadu_epi8(src, m, black_box(p));
+ let e = _mm_set_epi8(8, 7, 6, 42, 5, 42, 42, 42, 4, 3, 42, 42, 2, 42, 1, 42);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_maskz_expandloadu_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_expandloadu_epi8(m, black_box(p));
+ let e = _mm_set_epi8(8, 7, 6, 0, 5, 0, 0, 0, 4, 3, 0, 0, 2, 0, 1, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_compressstoreu_epi16() {
+ let a = _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,
+ );
+ let mut r = [0_i16; 32];
+ _mm512_mask_compressstoreu_epi16(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i16; 32]);
+ _mm512_mask_compressstoreu_epi16(
+ r.as_mut_ptr() as *mut _,
+ 0b11110000_11001010_11111111_00000000,
+ a,
+ );
+ assert_eq!(
+ &r,
+ &[
+ 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 23, 24, 29, 30, 31, 32, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0
+ ]
+ );
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_compressstoreu_epi16() {
+ let a = _mm256_set_epi16(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let mut r = [0_i16; 16];
+ _mm256_mask_compressstoreu_epi16(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i16; 16]);
+ _mm256_mask_compressstoreu_epi16(r.as_mut_ptr() as *mut _, 0b11110000_11001010, a);
+ assert_eq!(&r, &[2, 4, 7, 8, 13, 14, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0]);
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_compressstoreu_epi16() {
+ let a = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
+ let mut r = [0_i16; 8];
+ _mm_mask_compressstoreu_epi16(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i16; 8]);
+ _mm_mask_compressstoreu_epi16(r.as_mut_ptr() as *mut _, 0b11110000, a);
+ assert_eq!(&r, &[5, 6, 7, 8, 0, 0, 0, 0]);
+ }
+
+ #[simd_test(enable = "avx512vbmi2")]
+ unsafe fn test_mm512_mask_compressstoreu_epi8() {
+ let a = _mm512_set_epi8(
+ 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43,
+ 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 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,
+ );
+ let mut r = [0_i8; 64];
+ _mm512_mask_compressstoreu_epi8(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i8; 64]);
+ _mm512_mask_compressstoreu_epi8(
+ r.as_mut_ptr() as *mut _,
+ 0b11110000_11001010_11111111_00000000_10101010_01010101_11110000_00001111,
+ a,
+ );
+ assert_eq!(
+ &r,
+ &[
+ 1, 2, 3, 4, 13, 14, 15, 16, 17, 19, 21, 23, 26, 28, 30, 32, 41, 42, 43, 44, 45, 46,
+ 47, 48, 50, 52, 55, 56, 61, 62, 63, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ ]
+ );
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm256_mask_compressstoreu_epi8() {
+ let a = _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,
+ );
+ let mut r = [0_i8; 32];
+ _mm256_mask_compressstoreu_epi8(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i8; 32]);
+ _mm256_mask_compressstoreu_epi8(
+ r.as_mut_ptr() as *mut _,
+ 0b11110000_11001010_11111111_00000000,
+ a,
+ );
+ assert_eq!(
+ &r,
+ &[
+ 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 23, 24, 29, 30, 31, 32, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0
+ ]
+ );
+ }
+
+ #[simd_test(enable = "avx512vbmi2,avx512vl")]
+ unsafe fn test_mm_mask_compressstoreu_epi8() {
+ let a = _mm_set_epi8(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let mut r = [0_i8; 16];
+ _mm_mask_compressstoreu_epi8(r.as_mut_ptr() as *mut _, 0, a);
+ assert_eq!(&r, &[0_i8; 16]);
+ _mm_mask_compressstoreu_epi8(r.as_mut_ptr() as *mut _, 0b11110000_11001010, a);
+ assert_eq!(&r, &[2, 4, 7, 8, 13, 14, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0]);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512vnni.rs b/library/stdarch/crates/core_arch/src/x86/avx512vnni.rs
new file mode 100644
index 000000000..ff2c773ec
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512vnni.rs
@@ -0,0 +1,939 @@
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_dpwssd_epi32&expand=2219)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_dpwssd_epi32&expand=2220)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_dpwssd_epi32&expand=2221)
+#[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))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_dpwssd_epi32&expand=2216)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_dpwssd_epi32&expand=2217)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_dpwssd_epi32&expand=2218)
+#[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))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_dpwssd_epi32&expand=2213)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_dpwssd_epi32&expand=2214)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_dpwssd_epi32&expand=2215)
+#[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))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_dpwssds_epi32&expand=2228)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_dpwssds_epi32&expand=2229)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_dpwssds_epi32&expand=2230)
+#[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))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_dpwssds_epi32&expand=2225)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_dpwssds_epi32&expand=2226)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_dpwssds_epi32&expand=2227)
+#[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))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_dpwssds_epi32&expand=2222)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_dpwssds_epi32&expand=2223)
+#[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()))
+}
+
+/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in a with corresponding 16-bit integers in b, producing 2 intermediate signed 32-bit results. Sum these 2 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_dpwssds_epi32&expand=2224)
+#[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))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_dpbusd_epi32&expand=2201)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_dpbusd_epi32&expand=2202)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_dpbusd_epi32&expand=2203)
+#[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))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_dpbusd_epi32&expand=2198)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_dpbusd_epi32&expand=2199)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_dpbusd_epi32&expand=2200)
+#[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))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_dpbusd_epi32&expand=2195)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_dpbusd_epi32&expand=2196)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_dpbusd_epi32&expand=2197)
+#[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))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_dpbusds_epi32&expand=2210)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_dpbusds_epi32&expand=2211)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_dpbusds_epi32&expand=2212)
+#[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))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_dpbusds_epi32&expand=2207)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_dpbusds_epi32&expand=2208)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_dpbusds_epi32&expand=2209)
+#[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))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_dpbusds_epi32&expand=2204)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_dpbusds_epi32&expand=2205)
+#[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()))
+}
+
+/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in a with corresponding signed 8-bit integers in b, producing 4 intermediate signed 16-bit results. Sum these 4 results with the corresponding 32-bit integer in src using signed saturation, and store the packed 32-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_dpbusds_epi32&expand=2206)
+#[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);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512vpclmulqdq.rs b/library/stdarch/crates/core_arch/src/x86/avx512vpclmulqdq.rs
new file mode 100644
index 000000000..9bfeb903a
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512vpclmulqdq.rs
@@ -0,0 +1,258 @@
+//! Vectorized Carry-less Multiplication (VCLMUL)
+//!
+//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
+//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref] (p. 4-241).
+//!
+//! [intel64_ref]: http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+
+use crate::core_arch::x86::__m256i;
+use crate::core_arch::x86::__m512i;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.pclmulqdq.256"]
+ fn pclmulqdq_256(a: __m256i, round_key: __m256i, imm8: u8) -> __m256i;
+ #[link_name = "llvm.x86.pclmulqdq.512"]
+ fn pclmulqdq_512(a: __m512i, round_key: __m512i, imm8: u8) -> __m512i;
+}
+
+// for some odd reason on x86_64 we generate the correct long name instructions
+// but on i686 we generate the short name + imm8
+// so we need to special-case on that...
+
+/// Performs a carry-less multiplication of two 64-bit polynomials over the
+/// finite field GF(2^k) - in each of the 4 128-bit lanes.
+///
+/// The immediate byte is used for determining which halves of each lane `a` and `b`
+/// should be used. Immediate bits other than 0 and 4 are ignored.
+/// All lanes share immediate byte.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_clmulepi64_epi128)
+#[inline]
+#[target_feature(enable = "avx512vpclmulqdq,avx512f")]
+// technically according to Intel's documentation we don't need avx512f here, however LLVM gets confused otherwise
+#[cfg_attr(test, assert_instr(vpclmul, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm512_clmulepi64_epi128<const IMM8: i32>(a: __m512i, b: __m512i) -> __m512i {
+ static_assert_imm8!(IMM8);
+ pclmulqdq_512(a, b, IMM8 as u8)
+}
+
+/// Performs a carry-less multiplication of two 64-bit polynomials over the
+/// finite field GF(2^k) - in each of the 2 128-bit lanes.
+///
+/// The immediate byte is used for determining which halves of each lane `a` and `b`
+/// should be used. Immediate bits other than 0 and 4 are ignored.
+/// All lanes share immediate byte.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_clmulepi64_epi128)
+#[inline]
+#[target_feature(enable = "avx512vpclmulqdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpclmul, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm256_clmulepi64_epi128<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
+ static_assert_imm8!(IMM8);
+ pclmulqdq_256(a, b, IMM8 as u8)
+}
+
+#[cfg(test)]
+mod tests {
+ // The constants in the tests below are just bit patterns. They should not
+ // be interpreted as integers; signedness does not make sense for them, but
+ // __mXXXi happens to be defined in terms of signed integers.
+ #![allow(overflowing_literals)]
+
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ macro_rules! verify_kat_pclmul {
+ ($broadcast:ident, $clmul:ident, $assert:ident) => {
+ // Constants taken from https://software.intel.com/sites/default/files/managed/72/cc/clmul-wp-rev-2.02-2014-04-20.pdf
+ let a = _mm_set_epi64x(0x7b5b546573745665, 0x63746f725d53475d);
+ let a = $broadcast(a);
+ let b = _mm_set_epi64x(0x4869285368617929, 0x5b477565726f6e5d);
+ let b = $broadcast(b);
+ let r00 = _mm_set_epi64x(0x1d4d84c85c3440c0, 0x929633d5d36f0451);
+ let r00 = $broadcast(r00);
+ let r01 = _mm_set_epi64x(0x1bd17c8d556ab5a1, 0x7fa540ac2a281315);
+ let r01 = $broadcast(r01);
+ let r10 = _mm_set_epi64x(0x1a2bf6db3a30862f, 0xbabf262df4b7d5c9);
+ let r10 = $broadcast(r10);
+ let r11 = _mm_set_epi64x(0x1d1e1f2c592e7c45, 0xd66ee03e410fd4ed);
+ let r11 = $broadcast(r11);
+
+ $assert($clmul::<0x00>(a, b), r00);
+ $assert($clmul::<0x10>(a, b), r01);
+ $assert($clmul::<0x01>(a, b), r10);
+ $assert($clmul::<0x11>(a, b), r11);
+
+ let a0 = _mm_set_epi64x(0x0000000000000000, 0x8000000000000000);
+ let a0 = $broadcast(a0);
+ let r = _mm_set_epi64x(0x4000000000000000, 0x0000000000000000);
+ let r = $broadcast(r);
+ $assert($clmul::<0x00>(a0, a0), r);
+ }
+ }
+
+ macro_rules! unroll {
+ ($target:ident[4] = $op:ident::<4>($source:ident);) => {
+ $target[3] = $op::<3>($source);
+ $target[2] = $op::<2>($source);
+ unroll! {$target[2] = $op::<2>($source);}
+ };
+ ($target:ident[2] = $op:ident::<2>($source:ident);) => {
+ $target[1] = $op::<1>($source);
+ $target[0] = $op::<0>($source);
+ };
+ (assert_eq_m128i($op:ident::<4>($vec_res:ident),$lin_res:ident[4]);) => {
+ assert_eq_m128i($op::<3>($vec_res), $lin_res[3]);
+ assert_eq_m128i($op::<2>($vec_res), $lin_res[2]);
+ unroll! {assert_eq_m128i($op::<2>($vec_res),$lin_res[2]);}
+ };
+ (assert_eq_m128i($op:ident::<2>($vec_res:ident),$lin_res:ident[2]);) => {
+ assert_eq_m128i($op::<1>($vec_res), $lin_res[1]);
+ assert_eq_m128i($op::<0>($vec_res), $lin_res[0]);
+ };
+ }
+
+ // this function tests one of the possible 4 instances
+ // with different inputs across lanes
+ #[target_feature(enable = "avx512vpclmulqdq,avx512f")]
+ unsafe fn verify_512_helper(
+ linear: unsafe fn(__m128i, __m128i) -> __m128i,
+ vectorized: unsafe fn(__m512i, __m512i) -> __m512i,
+ ) {
+ let a = _mm512_set_epi64(
+ 0xDCB4DB3657BF0B7D,
+ 0x18DB0601068EDD9F,
+ 0xB76B908233200DC5,
+ 0xE478235FA8E22D5E,
+ 0xAB05CFFA2621154C,
+ 0x1171B47A186174C9,
+ 0x8C6B6C0E7595CEC9,
+ 0xBE3E7D4934E961BD,
+ );
+ let b = _mm512_set_epi64(
+ 0x672F6F105A94CEA7,
+ 0x8298B8FFCA5F829C,
+ 0xA3927047B3FB61D8,
+ 0x978093862CDE7187,
+ 0xB1927AB22F31D0EC,
+ 0xA9A5DA619BE4D7AF,
+ 0xCA2590F56884FDC6,
+ 0x19BE9F660038BDB5,
+ );
+
+ let mut a_decomp = [_mm_setzero_si128(); 4];
+ unroll! {a_decomp[4] = _mm512_extracti32x4_epi32::<4>(a);}
+ let mut b_decomp = [_mm_setzero_si128(); 4];
+ unroll! {b_decomp[4] = _mm512_extracti32x4_epi32::<4>(b);}
+
+ let r = vectorized(a, b);
+ let mut e_decomp = [_mm_setzero_si128(); 4];
+ for i in 0..4 {
+ e_decomp[i] = linear(a_decomp[i], b_decomp[i]);
+ }
+ unroll! {assert_eq_m128i(_mm512_extracti32x4_epi32::<4>(r),e_decomp[4]);}
+ }
+
+ // this function tests one of the possible 4 instances
+ // with different inputs across lanes for the VL version
+ #[target_feature(enable = "avx512vpclmulqdq,avx512vl")]
+ unsafe fn verify_256_helper(
+ linear: unsafe fn(__m128i, __m128i) -> __m128i,
+ vectorized: unsafe fn(__m256i, __m256i) -> __m256i,
+ ) {
+ let a = _mm512_set_epi64(
+ 0xDCB4DB3657BF0B7D,
+ 0x18DB0601068EDD9F,
+ 0xB76B908233200DC5,
+ 0xE478235FA8E22D5E,
+ 0xAB05CFFA2621154C,
+ 0x1171B47A186174C9,
+ 0x8C6B6C0E7595CEC9,
+ 0xBE3E7D4934E961BD,
+ );
+ let b = _mm512_set_epi64(
+ 0x672F6F105A94CEA7,
+ 0x8298B8FFCA5F829C,
+ 0xA3927047B3FB61D8,
+ 0x978093862CDE7187,
+ 0xB1927AB22F31D0EC,
+ 0xA9A5DA619BE4D7AF,
+ 0xCA2590F56884FDC6,
+ 0x19BE9F660038BDB5,
+ );
+
+ let mut a_decomp = [_mm_setzero_si128(); 2];
+ unroll! {a_decomp[2] = _mm512_extracti32x4_epi32::<2>(a);}
+ let mut b_decomp = [_mm_setzero_si128(); 2];
+ unroll! {b_decomp[2] = _mm512_extracti32x4_epi32::<2>(b);}
+
+ let r = vectorized(
+ _mm512_extracti64x4_epi64::<0>(a),
+ _mm512_extracti64x4_epi64::<0>(b),
+ );
+ let mut e_decomp = [_mm_setzero_si128(); 2];
+ for i in 0..2 {
+ e_decomp[i] = linear(a_decomp[i], b_decomp[i]);
+ }
+ unroll! {assert_eq_m128i(_mm256_extracti128_si256::<2>(r),e_decomp[2]);}
+ }
+
+ #[simd_test(enable = "avx512vpclmulqdq,avx512f")]
+ unsafe fn test_mm512_clmulepi64_epi128() {
+ verify_kat_pclmul!(
+ _mm512_broadcast_i32x4,
+ _mm512_clmulepi64_epi128,
+ assert_eq_m512i
+ );
+
+ verify_512_helper(
+ |a, b| _mm_clmulepi64_si128::<0x00>(a, b),
+ |a, b| _mm512_clmulepi64_epi128::<0x00>(a, b),
+ );
+ verify_512_helper(
+ |a, b| _mm_clmulepi64_si128::<0x01>(a, b),
+ |a, b| _mm512_clmulepi64_epi128::<0x01>(a, b),
+ );
+ verify_512_helper(
+ |a, b| _mm_clmulepi64_si128::<0x10>(a, b),
+ |a, b| _mm512_clmulepi64_epi128::<0x10>(a, b),
+ );
+ verify_512_helper(
+ |a, b| _mm_clmulepi64_si128::<0x11>(a, b),
+ |a, b| _mm512_clmulepi64_epi128::<0x11>(a, b),
+ );
+ }
+
+ #[simd_test(enable = "avx512vpclmulqdq,avx512vl")]
+ unsafe fn test_mm256_clmulepi64_epi128() {
+ verify_kat_pclmul!(
+ _mm256_broadcastsi128_si256,
+ _mm256_clmulepi64_epi128,
+ assert_eq_m256i
+ );
+
+ verify_256_helper(
+ |a, b| _mm_clmulepi64_si128::<0x00>(a, b),
+ |a, b| _mm256_clmulepi64_epi128::<0x00>(a, b),
+ );
+ verify_256_helper(
+ |a, b| _mm_clmulepi64_si128::<0x01>(a, b),
+ |a, b| _mm256_clmulepi64_epi128::<0x01>(a, b),
+ );
+ verify_256_helper(
+ |a, b| _mm_clmulepi64_si128::<0x10>(a, b),
+ |a, b| _mm256_clmulepi64_epi128::<0x10>(a, b),
+ );
+ verify_256_helper(
+ |a, b| _mm_clmulepi64_si128::<0x11>(a, b),
+ |a, b| _mm256_clmulepi64_epi128::<0x11>(a, b),
+ );
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/avx512vpopcntdq.rs b/library/stdarch/crates/core_arch/src/x86/avx512vpopcntdq.rs
new file mode 100644
index 000000000..3b97c4c19
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/avx512vpopcntdq.rs
@@ -0,0 +1,541 @@
+//! Vectorized Population Count Instructions for Double- and Quadwords (VPOPCNTDQ)
+//!
+//! The intrinsics here correspond to those in the `immintrin.h` C header.
+//!
+//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
+//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref].
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+
+use crate::core_arch::simd::i32x16;
+use crate::core_arch::simd::i32x4;
+use crate::core_arch::simd::i32x8;
+use crate::core_arch::simd::i64x2;
+use crate::core_arch::simd::i64x4;
+use crate::core_arch::simd::i64x8;
+use crate::core_arch::simd_llvm::simd_select_bitmask;
+use crate::core_arch::x86::__m128i;
+use crate::core_arch::x86::__m256i;
+use crate::core_arch::x86::__m512i;
+use crate::core_arch::x86::__mmask16;
+use crate::core_arch::x86::__mmask8;
+use crate::core_arch::x86::_mm256_setzero_si256;
+use crate::core_arch::x86::_mm512_setzero_si512;
+use crate::core_arch::x86::_mm_setzero_si128;
+use crate::core_arch::x86::m128iExt;
+use crate::core_arch::x86::m256iExt;
+use crate::core_arch::x86::m512iExt;
+use crate::mem::transmute;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.ctpop.v16i32"]
+ fn popcnt_v16i32(x: i32x16) -> i32x16;
+ #[link_name = "llvm.ctpop.v8i32"]
+ fn popcnt_v8i32(x: i32x8) -> i32x8;
+ #[link_name = "llvm.ctpop.v4i32"]
+ fn popcnt_v4i32(x: i32x4) -> i32x4;
+
+ #[link_name = "llvm.ctpop.v8i64"]
+ fn popcnt_v8i64(x: i64x8) -> i64x8;
+ #[link_name = "llvm.ctpop.v4i64"]
+ fn popcnt_v4i64(x: i64x4) -> i64x4;
+ #[link_name = "llvm.ctpop.v2i64"]
+ fn popcnt_v2i64(x: i64x2) -> i64x2;
+}
+
+/// For each packed 32-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_popcnt_epi32)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq")]
+#[cfg_attr(test, assert_instr(vpopcntd))]
+pub unsafe fn _mm512_popcnt_epi32(a: __m512i) -> __m512i {
+ transmute(popcnt_v16i32(a.as_i32x16()))
+}
+
+/// For each packed 32-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_popcnt_epi32)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq")]
+#[cfg_attr(test, assert_instr(vpopcntd))]
+pub unsafe fn _mm512_maskz_popcnt_epi32(k: __mmask16, a: __m512i) -> __m512i {
+ let zero = _mm512_setzero_si512().as_i32x16();
+ transmute(simd_select_bitmask(k, popcnt_v16i32(a.as_i32x16()), zero))
+}
+
+/// For each packed 32-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_popcnt_epi32)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq")]
+#[cfg_attr(test, assert_instr(vpopcntd))]
+pub unsafe fn _mm512_mask_popcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v16i32(a.as_i32x16()),
+ src.as_i32x16(),
+ ))
+}
+
+/// For each packed 32-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_popcnt_epi32)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntd))]
+pub unsafe fn _mm256_popcnt_epi32(a: __m256i) -> __m256i {
+ transmute(popcnt_v8i32(a.as_i32x8()))
+}
+
+/// For each packed 32-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_popcnt_epi32)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntd))]
+pub unsafe fn _mm256_maskz_popcnt_epi32(k: __mmask8, a: __m256i) -> __m256i {
+ let zero = _mm256_setzero_si256().as_i32x8();
+ transmute(simd_select_bitmask(k, popcnt_v8i32(a.as_i32x8()), zero))
+}
+
+/// For each packed 32-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_popcnt_epi32)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntd))]
+pub unsafe fn _mm256_mask_popcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v8i32(a.as_i32x8()),
+ src.as_i32x8(),
+ ))
+}
+
+/// For each packed 32-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_popcnt_epi32)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntd))]
+pub unsafe fn _mm_popcnt_epi32(a: __m128i) -> __m128i {
+ transmute(popcnt_v4i32(a.as_i32x4()))
+}
+
+/// For each packed 32-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_popcnt_epi32)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntd))]
+pub unsafe fn _mm_maskz_popcnt_epi32(k: __mmask8, a: __m128i) -> __m128i {
+ let zero = _mm_setzero_si128().as_i32x4();
+ transmute(simd_select_bitmask(k, popcnt_v4i32(a.as_i32x4()), zero))
+}
+
+/// For each packed 32-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_popcnt_epi32)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntd))]
+pub unsafe fn _mm_mask_popcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v4i32(a.as_i32x4()),
+ src.as_i32x4(),
+ ))
+}
+
+/// For each packed 64-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_popcnt_epi64)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq")]
+#[cfg_attr(test, assert_instr(vpopcntq))]
+pub unsafe fn _mm512_popcnt_epi64(a: __m512i) -> __m512i {
+ transmute(popcnt_v8i64(a.as_i64x8()))
+}
+
+/// For each packed 64-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_popcnt_epi64)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq")]
+#[cfg_attr(test, assert_instr(vpopcntq))]
+pub unsafe fn _mm512_maskz_popcnt_epi64(k: __mmask8, a: __m512i) -> __m512i {
+ let zero = _mm512_setzero_si512().as_i64x8();
+ transmute(simd_select_bitmask(k, popcnt_v8i64(a.as_i64x8()), zero))
+}
+
+/// For each packed 64-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_popcnt_epi64)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq")]
+#[cfg_attr(test, assert_instr(vpopcntq))]
+pub unsafe fn _mm512_mask_popcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v8i64(a.as_i64x8()),
+ src.as_i64x8(),
+ ))
+}
+
+/// For each packed 64-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_popcnt_epi64)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntq))]
+pub unsafe fn _mm256_popcnt_epi64(a: __m256i) -> __m256i {
+ transmute(popcnt_v4i64(a.as_i64x4()))
+}
+
+/// For each packed 64-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_popcnt_epi64)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntq))]
+pub unsafe fn _mm256_maskz_popcnt_epi64(k: __mmask8, a: __m256i) -> __m256i {
+ let zero = _mm256_setzero_si256().as_i64x4();
+ transmute(simd_select_bitmask(k, popcnt_v4i64(a.as_i64x4()), zero))
+}
+
+/// For each packed 64-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_popcnt_epi64)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntq))]
+pub unsafe fn _mm256_mask_popcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v4i64(a.as_i64x4()),
+ src.as_i64x4(),
+ ))
+}
+
+/// For each packed 64-bit integer maps the value to the number of logical 1 bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_popcnt_epi64)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntq))]
+pub unsafe fn _mm_popcnt_epi64(a: __m128i) -> __m128i {
+ transmute(popcnt_v2i64(a.as_i64x2()))
+}
+
+/// For each packed 64-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are zeroed in the result if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_popcnt_epi64)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntq))]
+pub unsafe fn _mm_maskz_popcnt_epi64(k: __mmask8, a: __m128i) -> __m128i {
+ let zero = _mm_setzero_si128().as_i64x2();
+ transmute(simd_select_bitmask(k, popcnt_v2i64(a.as_i64x2()), zero))
+}
+
+/// For each packed 64-bit integer maps the value to the number of logical 1 bits.
+///
+/// Uses the writemask in k - elements are copied from src if the corresponding mask bit is not set.
+/// Otherwise the computation result is written into the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_popcnt_epi64)
+#[inline]
+#[target_feature(enable = "avx512vpopcntdq,avx512vl")]
+#[cfg_attr(test, assert_instr(vpopcntq))]
+pub unsafe fn _mm_mask_popcnt_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
+ transmute(simd_select_bitmask(
+ k,
+ popcnt_v2i64(a.as_i64x2()),
+ src.as_i64x2(),
+ ))
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f")]
+ unsafe fn test_mm512_popcnt_epi32() {
+ let test_data = _mm512_set_epi32(
+ 0,
+ 1,
+ -1,
+ 2,
+ 7,
+ 0xFF_FE,
+ 0x7F_FF_FF_FF,
+ -100,
+ 0x40_00_00_00,
+ 103,
+ 371,
+ 552,
+ 432_948,
+ 818_826_998,
+ 255,
+ 256,
+ );
+ let actual_result = _mm512_popcnt_epi32(test_data);
+ let reference_result =
+ _mm512_set_epi32(0, 1, 32, 1, 3, 15, 31, 28, 1, 5, 6, 3, 10, 17, 8, 1);
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f")]
+ unsafe fn test_mm512_mask_popcnt_epi32() {
+ let test_data = _mm512_set_epi32(
+ 0,
+ 1,
+ -1,
+ 2,
+ 7,
+ 0xFF_FE,
+ 0x7F_FF_FF_FF,
+ -100,
+ 0x40_00_00_00,
+ 103,
+ 371,
+ 552,
+ 432_948,
+ 818_826_998,
+ 255,
+ 256,
+ );
+ let mask = 0xFF_00;
+ let actual_result = _mm512_mask_popcnt_epi32(test_data, mask, test_data);
+ let reference_result = _mm512_set_epi32(
+ 0,
+ 1,
+ 32,
+ 1,
+ 3,
+ 15,
+ 31,
+ 28,
+ 0x40_00_00_00,
+ 103,
+ 371,
+ 552,
+ 432_948,
+ 818_826_998,
+ 255,
+ 256,
+ );
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f")]
+ unsafe fn test_mm512_maskz_popcnt_epi32() {
+ let test_data = _mm512_set_epi32(
+ 0,
+ 1,
+ -1,
+ 2,
+ 7,
+ 0xFF_FE,
+ 0x7F_FF_FF_FF,
+ -100,
+ 0x40_00_00_00,
+ 103,
+ 371,
+ 552,
+ 432_948,
+ 818_826_998,
+ 255,
+ 256,
+ );
+ let mask = 0xFF_00;
+ let actual_result = _mm512_maskz_popcnt_epi32(mask, test_data);
+ let reference_result = _mm512_set_epi32(0, 1, 32, 1, 3, 15, 31, 28, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")]
+ unsafe fn test_mm256_popcnt_epi32() {
+ let test_data = _mm256_set_epi32(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF, -100);
+ let actual_result = _mm256_popcnt_epi32(test_data);
+ let reference_result = _mm256_set_epi32(0, 1, 32, 1, 3, 15, 31, 28);
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_popcnt_epi32() {
+ let test_data = _mm256_set_epi32(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF, -100);
+ let mask = 0xF0;
+ let actual_result = _mm256_mask_popcnt_epi32(test_data, mask, test_data);
+ let reference_result = _mm256_set_epi32(0, 1, 32, 1, 7, 0xFF_FE, 0x7F_FF_FF_FF, -100);
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_popcnt_epi32() {
+ let test_data = _mm256_set_epi32(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF, -100);
+ let mask = 0xF0;
+ let actual_result = _mm256_maskz_popcnt_epi32(mask, test_data);
+ let reference_result = _mm256_set_epi32(0, 1, 32, 1, 0, 0, 0, 0);
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")]
+ unsafe fn test_mm_popcnt_epi32() {
+ let test_data = _mm_set_epi32(0, 1, -1, -100);
+ let actual_result = _mm_popcnt_epi32(test_data);
+ let reference_result = _mm_set_epi32(0, 1, 32, 28);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")]
+ unsafe fn test_mm_mask_popcnt_epi32() {
+ let test_data = _mm_set_epi32(0, 1, -1, -100);
+ let mask = 0xE;
+ let actual_result = _mm_mask_popcnt_epi32(test_data, mask, test_data);
+ let reference_result = _mm_set_epi32(0, 1, 32, -100);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_popcnt_epi32() {
+ let test_data = _mm_set_epi32(0, 1, -1, -100);
+ let mask = 0xE;
+ let actual_result = _mm_maskz_popcnt_epi32(mask, test_data);
+ let reference_result = _mm_set_epi32(0, 1, 32, 0);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f")]
+ unsafe fn test_mm512_popcnt_epi64() {
+ let test_data = _mm512_set_epi64(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF_FF_FF_FF_FF, -100);
+ let actual_result = _mm512_popcnt_epi64(test_data);
+ let reference_result = _mm512_set_epi64(0, 1, 64, 1, 3, 15, 63, 60);
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f")]
+ unsafe fn test_mm512_mask_popcnt_epi64() {
+ let test_data = _mm512_set_epi64(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF_FF_FF_FF_FF, -100);
+ let mask = 0xF0;
+ let actual_result = _mm512_mask_popcnt_epi64(test_data, mask, test_data);
+ let reference_result =
+ _mm512_set_epi64(0, 1, 64, 1, 7, 0xFF_FE, 0x7F_FF_FF_FF_FF_FF_FF_FF, -100);
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512f")]
+ unsafe fn test_mm512_maskz_popcnt_epi64() {
+ let test_data = _mm512_set_epi64(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF_FF_FF_FF_FF, -100);
+ let mask = 0xF0;
+ let actual_result = _mm512_maskz_popcnt_epi64(mask, test_data);
+ let reference_result = _mm512_set_epi64(0, 1, 64, 1, 0, 0, 0, 0);
+ assert_eq_m512i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512vl")]
+ unsafe fn test_mm256_popcnt_epi64() {
+ let test_data = _mm256_set_epi64x(0, 1, -1, -100);
+ let actual_result = _mm256_popcnt_epi64(test_data);
+ let reference_result = _mm256_set_epi64x(0, 1, 64, 60);
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512vl")]
+ unsafe fn test_mm256_mask_popcnt_epi64() {
+ let test_data = _mm256_set_epi64x(0, 1, -1, -100);
+ let mask = 0xE;
+ let actual_result = _mm256_mask_popcnt_epi64(test_data, mask, test_data);
+ let reference_result = _mm256_set_epi64x(0, 1, 64, -100);
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512vl")]
+ unsafe fn test_mm256_maskz_popcnt_epi64() {
+ let test_data = _mm256_set_epi64x(0, 1, -1, -100);
+ let mask = 0xE;
+ let actual_result = _mm256_maskz_popcnt_epi64(mask, test_data);
+ let reference_result = _mm256_set_epi64x(0, 1, 64, 0);
+ assert_eq_m256i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512vl")]
+ unsafe fn test_mm_popcnt_epi64() {
+ let test_data = _mm_set_epi64x(0, 1);
+ let actual_result = _mm_popcnt_epi64(test_data);
+ let reference_result = _mm_set_epi64x(0, 1);
+ assert_eq_m128i(actual_result, reference_result);
+ let test_data = _mm_set_epi64x(-1, -100);
+ let actual_result = _mm_popcnt_epi64(test_data);
+ let reference_result = _mm_set_epi64x(64, 60);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512vl")]
+ unsafe fn test_mm_mask_popcnt_epi64() {
+ let test_data = _mm_set_epi64x(0, -100);
+ let mask = 0x2;
+ let actual_result = _mm_mask_popcnt_epi64(test_data, mask, test_data);
+ let reference_result = _mm_set_epi64x(0, -100);
+ assert_eq_m128i(actual_result, reference_result);
+ let test_data = _mm_set_epi64x(-1, 1);
+ let mask = 0x2;
+ let actual_result = _mm_mask_popcnt_epi64(test_data, mask, test_data);
+ let reference_result = _mm_set_epi64x(64, 1);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+
+ #[simd_test(enable = "avx512vpopcntdq,avx512vl")]
+ unsafe fn test_mm_maskz_popcnt_epi64() {
+ let test_data = _mm_set_epi64x(0, 1);
+ let mask = 0x2;
+ let actual_result = _mm_maskz_popcnt_epi64(mask, test_data);
+ let reference_result = _mm_set_epi64x(0, 0);
+ assert_eq_m128i(actual_result, reference_result);
+ let test_data = _mm_set_epi64x(-1, -100);
+ let mask = 0x2;
+ let actual_result = _mm_maskz_popcnt_epi64(mask, test_data);
+ let reference_result = _mm_set_epi64x(64, 0);
+ assert_eq_m128i(actual_result, reference_result);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/bmi1.rs b/library/stdarch/crates/core_arch/src/x86/bmi1.rs
new file mode 100644
index 000000000..0f769f33b
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/bmi1.rs
@@ -0,0 +1,178 @@
+//! Bit Manipulation Instruction (BMI) Set 1.0.
+//!
+//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
+//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref].
+//!
+//! [Wikipedia][wikipedia_bmi] provides a quick overview of the instructions
+//! available.
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+//! [wikipedia_bmi]: https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Extracts bits in range [`start`, `start` + `length`) from `a` into
+/// the least significant bits of the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_bextr_u32)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(bextr))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _bextr_u32(a: u32, start: u32, len: u32) -> u32 {
+ _bextr2_u32(a, (start & 0xff_u32) | ((len & 0xff_u32) << 8_u32))
+}
+
+/// Extracts bits of `a` specified by `control` into
+/// the least significant bits of the result.
+///
+/// Bits `[7,0]` of `control` specify the index to the first bit in the range
+/// to be extracted, and bits `[15,8]` specify the length of the range.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_bextr2_u32)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(bextr))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _bextr2_u32(a: u32, control: u32) -> u32 {
+ x86_bmi_bextr_32(a, control)
+}
+
+/// Bitwise logical `AND` of inverted `a` with `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_andn_u32)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(andn))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _andn_u32(a: u32, b: u32) -> u32 {
+ !a & b
+}
+
+/// Extracts lowest set isolated bit.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_blsi_u32)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(blsi))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blsi_u32(x: u32) -> u32 {
+ x & x.wrapping_neg()
+}
+
+/// Gets mask up to lowest set bit.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_blsmsk_u32)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(blsmsk))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blsmsk_u32(x: u32) -> u32 {
+ x ^ (x.wrapping_sub(1_u32))
+}
+
+/// Resets the lowest set bit of `x`.
+///
+/// If `x` is sets CF.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_blsr_u32)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(blsr))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blsr_u32(x: u32) -> u32 {
+ x & (x.wrapping_sub(1))
+}
+
+/// Counts the number of trailing least significant zero bits.
+///
+/// When the source operand is `0`, it returns its size in bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_tzcnt_u32)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(tzcnt))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _tzcnt_u32(x: u32) -> u32 {
+ x.trailing_zeros()
+}
+
+/// Counts the number of trailing least significant zero bits.
+///
+/// When the source operand is `0`, it returns its size in bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_tzcnt_32)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(tzcnt))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_tzcnt_32(x: u32) -> i32 {
+ x.trailing_zeros() as i32
+}
+
+extern "C" {
+ #[link_name = "llvm.x86.bmi.bextr.32"]
+ fn x86_bmi_bextr_32(x: u32, y: u32) -> u32;
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_bextr_u32() {
+ let r = _bextr_u32(0b0101_0000u32, 4, 4);
+ assert_eq!(r, 0b0000_0101u32);
+ }
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_andn_u32() {
+ assert_eq!(_andn_u32(0, 0), 0);
+ assert_eq!(_andn_u32(0, 1), 1);
+ assert_eq!(_andn_u32(1, 0), 0);
+ assert_eq!(_andn_u32(1, 1), 0);
+
+ let r = _andn_u32(0b0000_0000u32, 0b0000_0000u32);
+ assert_eq!(r, 0b0000_0000u32);
+
+ let r = _andn_u32(0b0000_0000u32, 0b1111_1111u32);
+ assert_eq!(r, 0b1111_1111u32);
+
+ let r = _andn_u32(0b1111_1111u32, 0b0000_0000u32);
+ assert_eq!(r, 0b0000_0000u32);
+
+ let r = _andn_u32(0b1111_1111u32, 0b1111_1111u32);
+ assert_eq!(r, 0b0000_0000u32);
+
+ let r = _andn_u32(0b0100_0000u32, 0b0101_1101u32);
+ assert_eq!(r, 0b0001_1101u32);
+ }
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_blsi_u32() {
+ assert_eq!(_blsi_u32(0b1101_0000u32), 0b0001_0000u32);
+ }
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_blsmsk_u32() {
+ let r = _blsmsk_u32(0b0011_0000u32);
+ assert_eq!(r, 0b0001_1111u32);
+ }
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_blsr_u32() {
+ // TODO: test the behavior when the input is `0`.
+ let r = _blsr_u32(0b0011_0000u32);
+ assert_eq!(r, 0b0010_0000u32);
+ }
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_tzcnt_u32() {
+ assert_eq!(_tzcnt_u32(0b0000_0001u32), 0u32);
+ assert_eq!(_tzcnt_u32(0b0000_0000u32), 32u32);
+ assert_eq!(_tzcnt_u32(0b1001_0000u32), 4u32);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/bmi2.rs b/library/stdarch/crates/core_arch/src/x86/bmi2.rs
new file mode 100644
index 000000000..b08b8733c
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/bmi2.rs
@@ -0,0 +1,133 @@
+//! Bit Manipulation Instruction (BMI) Set 2.0.
+//!
+//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
+//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref].
+//!
+//! [Wikipedia][wikipedia_bmi] provides a quick overview of the instructions
+//! available.
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+//! [wikipedia_bmi]:
+//! https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Unsigned multiply without affecting flags.
+///
+/// Unsigned multiplication of `a` with `b` returning a pair `(lo, hi)` with
+/// the low half and the high half of the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mulx_u32)
+#[inline]
+// LLVM BUG (should be mulxl): https://bugs.llvm.org/show_bug.cgi?id=34232
+#[cfg_attr(all(test, target_arch = "x86_64"), assert_instr(imul))]
+#[cfg_attr(all(test, target_arch = "x86"), assert_instr(mul))]
+#[target_feature(enable = "bmi2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mulx_u32(a: u32, b: u32, hi: &mut u32) -> u32 {
+ let result: u64 = (a as u64) * (b as u64);
+ *hi = (result >> 32) as u32;
+ result as u32
+}
+
+/// Zeroes higher bits of `a` >= `index`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_bzhi_u32)
+#[inline]
+#[target_feature(enable = "bmi2")]
+#[cfg_attr(test, assert_instr(bzhi))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _bzhi_u32(a: u32, index: u32) -> u32 {
+ x86_bmi2_bzhi_32(a, index)
+}
+
+/// Scatter contiguous low order bits of `a` to the result at the positions
+/// specified by the `mask`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_pdep_u32)
+#[inline]
+#[target_feature(enable = "bmi2")]
+#[cfg_attr(test, assert_instr(pdep))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _pdep_u32(a: u32, mask: u32) -> u32 {
+ x86_bmi2_pdep_32(a, mask)
+}
+
+/// Gathers the bits of `x` specified by the `mask` into the contiguous low
+/// order bit positions of the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_pext_u32)
+#[inline]
+#[target_feature(enable = "bmi2")]
+#[cfg_attr(test, assert_instr(pext))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _pext_u32(a: u32, mask: u32) -> u32 {
+ x86_bmi2_pext_32(a, mask)
+}
+
+extern "C" {
+ #[link_name = "llvm.x86.bmi.bzhi.32"]
+ fn x86_bmi2_bzhi_32(x: u32, y: u32) -> u32;
+ #[link_name = "llvm.x86.bmi.pdep.32"]
+ fn x86_bmi2_pdep_32(x: u32, y: u32) -> u32;
+ #[link_name = "llvm.x86.bmi.pext.32"]
+ fn x86_bmi2_pext_32(x: u32, y: u32) -> u32;
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "bmi2")]
+ unsafe fn test_pext_u32() {
+ let n = 0b1011_1110_1001_0011u32;
+
+ let m0 = 0b0110_0011_1000_0101u32;
+ let s0 = 0b0000_0000_0011_0101u32;
+
+ let m1 = 0b1110_1011_1110_1111u32;
+ let s1 = 0b0001_0111_0100_0011u32;
+
+ assert_eq!(_pext_u32(n, m0), s0);
+ assert_eq!(_pext_u32(n, m1), s1);
+ }
+
+ #[simd_test(enable = "bmi2")]
+ unsafe fn test_pdep_u32() {
+ let n = 0b1011_1110_1001_0011u32;
+
+ let m0 = 0b0110_0011_1000_0101u32;
+ let s0 = 0b0000_0010_0000_0101u32;
+
+ let m1 = 0b1110_1011_1110_1111u32;
+ let s1 = 0b1110_1001_0010_0011u32;
+
+ assert_eq!(_pdep_u32(n, m0), s0);
+ assert_eq!(_pdep_u32(n, m1), s1);
+ }
+
+ #[simd_test(enable = "bmi2")]
+ unsafe fn test_bzhi_u32() {
+ let n = 0b1111_0010u32;
+ let s = 0b0001_0010u32;
+ assert_eq!(_bzhi_u32(n, 5), s);
+ }
+
+ #[simd_test(enable = "bmi2")]
+ unsafe fn test_mulx_u32() {
+ let a: u32 = 4_294_967_200;
+ let b: u32 = 2;
+ let mut hi = 0;
+ let lo = _mulx_u32(a, b, &mut hi);
+ /*
+ result = 8589934400
+ = 0b0001_1111_1111_1111_1111_1111_1111_0100_0000u64
+ ^~hi ^~lo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+ assert_eq!(lo, 0b1111_1111_1111_1111_1111_1111_0100_0000u32);
+ assert_eq!(hi, 0b0001u32);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/bswap.rs b/library/stdarch/crates/core_arch/src/x86/bswap.rs
new file mode 100644
index 000000000..fcaad26fb
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/bswap.rs
@@ -0,0 +1,28 @@
+//! Byte swap intrinsics.
+#![allow(clippy::module_name_repetitions)]
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Returns an integer with the reversed byte order of x
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_bswap)
+#[inline]
+#[cfg_attr(test, assert_instr(bswap))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _bswap(x: i32) -> i32 {
+ x.swap_bytes()
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_bswap() {
+ unsafe {
+ assert_eq!(_bswap(0x0EADBE0F), 0x0FBEAD0E);
+ assert_eq!(_bswap(0x00000000), 0x00000000);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/bt.rs b/library/stdarch/crates/core_arch/src/x86/bt.rs
new file mode 100644
index 000000000..338cb97a3
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/bt.rs
@@ -0,0 +1,135 @@
+use crate::arch::asm;
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+// x32 wants to use a 32-bit address size, but asm! defaults to using the full
+// register name (e.g. rax). We have to explicitly override the placeholder to
+// use the 32-bit register name in that case.
+#[cfg(target_pointer_width = "32")]
+macro_rules! bt {
+ ($inst:expr) => {
+ concat!($inst, " {b:e}, ({p:e})")
+ };
+}
+#[cfg(target_pointer_width = "64")]
+macro_rules! bt {
+ ($inst:expr) => {
+ concat!($inst, " {b:e}, ({p})")
+ };
+}
+
+/// Returns the bit in position `b` of the memory addressed by `p`.
+#[inline]
+#[cfg_attr(test, assert_instr(bt))]
+#[stable(feature = "simd_x86_bittest", since = "1.55.0")]
+pub unsafe fn _bittest(p: *const i32, b: i32) -> u8 {
+ let r: u8;
+ asm!(
+ bt!("btl"),
+ "setc {r}",
+ p = in(reg) p,
+ b = in(reg) b,
+ r = out(reg_byte) r,
+ options(readonly, nostack, pure, att_syntax)
+ );
+ r
+}
+
+/// Returns the bit in position `b` of the memory addressed by `p`, then sets the bit to `1`.
+#[inline]
+#[cfg_attr(test, assert_instr(bts))]
+#[stable(feature = "simd_x86_bittest", since = "1.55.0")]
+pub unsafe fn _bittestandset(p: *mut i32, b: i32) -> u8 {
+ let r: u8;
+ asm!(
+ bt!("btsl"),
+ "setc {r}",
+ p = in(reg) p,
+ b = in(reg) b,
+ r = out(reg_byte) r,
+ options(nostack, att_syntax)
+ );
+ r
+}
+
+/// Returns the bit in position `b` of the memory addressed by `p`, then resets that bit to `0`.
+#[inline]
+#[cfg_attr(test, assert_instr(btr))]
+#[stable(feature = "simd_x86_bittest", since = "1.55.0")]
+pub unsafe fn _bittestandreset(p: *mut i32, b: i32) -> u8 {
+ let r: u8;
+ asm!(
+ bt!("btrl"),
+ "setc {r}",
+ p = in(reg) p,
+ b = in(reg) b,
+ r = out(reg_byte) r,
+ options(nostack, att_syntax)
+ );
+ r
+}
+
+/// Returns the bit in position `b` of the memory addressed by `p`, then inverts that bit.
+#[inline]
+#[cfg_attr(test, assert_instr(btc))]
+#[stable(feature = "simd_x86_bittest", since = "1.55.0")]
+pub unsafe fn _bittestandcomplement(p: *mut i32, b: i32) -> u8 {
+ let r: u8;
+ asm!(
+ bt!("btcl"),
+ "setc {r}",
+ p = in(reg) p,
+ b = in(reg) b,
+ r = out(reg_byte) r,
+ options(nostack, att_syntax)
+ );
+ r
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::x86::*;
+
+ #[test]
+ fn test_bittest() {
+ unsafe {
+ let a = 0b0101_0000i32;
+ assert_eq!(_bittest(&a as _, 4), 1);
+ assert_eq!(_bittest(&a as _, 5), 0);
+ }
+ }
+
+ #[test]
+ fn test_bittestandset() {
+ unsafe {
+ let mut a = 0b0101_0000i32;
+ assert_eq!(_bittestandset(&mut a as _, 4), 1);
+ assert_eq!(_bittestandset(&mut a as _, 4), 1);
+ assert_eq!(_bittestandset(&mut a as _, 5), 0);
+ assert_eq!(_bittestandset(&mut a as _, 5), 1);
+ }
+ }
+
+ #[test]
+ fn test_bittestandreset() {
+ unsafe {
+ let mut a = 0b0101_0000i32;
+ assert_eq!(_bittestandreset(&mut a as _, 4), 1);
+ assert_eq!(_bittestandreset(&mut a as _, 4), 0);
+ assert_eq!(_bittestandreset(&mut a as _, 5), 0);
+ assert_eq!(_bittestandreset(&mut a as _, 5), 0);
+ }
+ }
+
+ #[test]
+ fn test_bittestandcomplement() {
+ unsafe {
+ let mut a = 0b0101_0000i32;
+ assert_eq!(_bittestandcomplement(&mut a as _, 4), 1);
+ assert_eq!(_bittestandcomplement(&mut a as _, 4), 0);
+ assert_eq!(_bittestandcomplement(&mut a as _, 4), 1);
+ assert_eq!(_bittestandcomplement(&mut a as _, 5), 0);
+ assert_eq!(_bittestandcomplement(&mut a as _, 5), 1);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/cpuid.rs b/library/stdarch/crates/core_arch/src/x86/cpuid.rs
new file mode 100644
index 000000000..6b90295ef
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/cpuid.rs
@@ -0,0 +1,197 @@
+//! `cpuid` intrinsics
+#![allow(clippy::module_name_repetitions)]
+
+use crate::arch::asm;
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Result of the `cpuid` instruction.
+#[allow(clippy::missing_inline_in_public_items)]
+// ^^ the derived impl of Debug for CpuidResult is not #[inline] and that's OK.
+#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub struct CpuidResult {
+ /// EAX register.
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub eax: u32,
+ /// EBX register.
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub ebx: u32,
+ /// ECX register.
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub ecx: u32,
+ /// EDX register.
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub edx: u32,
+}
+
+/// Returns the result of the `cpuid` instruction for a given `leaf` (`EAX`)
+/// and
+/// `sub_leaf` (`ECX`).
+///
+/// The highest-supported leaf value is returned by the first tuple argument of
+/// [`__get_cpuid_max(0)`](fn.__get_cpuid_max.html). For leaves containung
+/// sub-leaves, the second tuple argument returns the highest-supported
+/// sub-leaf
+/// value.
+///
+/// The [CPUID Wikipedia page][wiki_cpuid] contains how to query which
+/// information using the `EAX` and `ECX` registers, and the interpretation of
+/// the results returned in `EAX`, `EBX`, `ECX`, and `EDX`.
+///
+/// The references are:
+/// - [Intel 64 and IA-32 Architectures Software Developer's Manual Volume 2:
+/// Instruction Set Reference, A-Z][intel64_ref].
+/// - [AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and
+/// System Instructions][amd64_ref].
+///
+/// [wiki_cpuid]: https://en.wikipedia.org/wiki/CPUID
+/// [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+/// [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf
+#[inline]
+#[cfg_attr(test, assert_instr(cpuid))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn __cpuid_count(leaf: u32, sub_leaf: u32) -> CpuidResult {
+ let eax;
+ let ebx;
+ let ecx;
+ let edx;
+
+ // LLVM sometimes reserves `ebx` for its internal use, we so we need to use
+ // a scratch register for it instead.
+ #[cfg(target_arch = "x86")]
+ {
+ asm!(
+ "movl %ebx, {0}",
+ "cpuid",
+ "xchgl %ebx, {0}",
+ lateout(reg) ebx,
+ inlateout("eax") leaf => eax,
+ inlateout("ecx") sub_leaf => ecx,
+ lateout("edx") edx,
+ options(nostack, preserves_flags, att_syntax),
+ );
+ }
+ #[cfg(target_arch = "x86_64")]
+ {
+ asm!(
+ "movq %rbx, {0:r}",
+ "cpuid",
+ "xchgq %rbx, {0:r}",
+ lateout(reg) ebx,
+ inlateout("eax") leaf => eax,
+ inlateout("ecx") sub_leaf => ecx,
+ lateout("edx") edx,
+ options(nostack, preserves_flags, att_syntax),
+ );
+ }
+ CpuidResult { eax, ebx, ecx, edx }
+}
+
+/// See [`__cpuid_count`](fn.__cpuid_count.html).
+#[inline]
+#[cfg_attr(test, assert_instr(cpuid))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn __cpuid(leaf: u32) -> CpuidResult {
+ __cpuid_count(leaf, 0)
+}
+
+/// Does the host support the `cpuid` instruction?
+#[inline]
+pub fn has_cpuid() -> bool {
+ #[cfg(target_env = "sgx")]
+ {
+ false
+ }
+ #[cfg(all(not(target_env = "sgx"), target_arch = "x86_64"))]
+ {
+ true
+ }
+ #[cfg(all(not(target_env = "sgx"), target_arch = "x86"))]
+ {
+ // Optimization for i586 and i686 Rust targets which SSE enabled
+ // and support cpuid:
+ #[cfg(target_feature = "sse")]
+ {
+ true
+ }
+
+ // If SSE is not enabled, detect whether cpuid is available:
+ #[cfg(not(target_feature = "sse"))]
+ unsafe {
+ // On `x86` the `cpuid` instruction is not always available.
+ // This follows the approach indicated in:
+ // http://wiki.osdev.org/CPUID#Checking_CPUID_availability
+ // https://software.intel.com/en-us/articles/using-cpuid-to-detect-the-presence-of-sse-41-and-sse-42-instruction-sets/
+ // which detects whether `cpuid` is available by checking whether
+ // the 21st bit of the EFLAGS register is modifiable or not.
+ // If it is, then `cpuid` is available.
+ let result: u32;
+ asm!(
+ // Read eflags and save a copy of it
+ "pushfd",
+ "pop {result}",
+ "mov {result}, {saved_flags}",
+ // Flip 21st bit of the flags
+ "xor $0x200000, {result}",
+ // Load the modified flags and read them back.
+ // Bit 21 can only be modified if cpuid is available.
+ "push {result}",
+ "popfd",
+ "pushfd",
+ "pop {result}",
+ // Use xor to find out whether bit 21 has changed
+ "xor {saved_flags}, {result}",
+ result = out(reg) result,
+ saved_flags = out(reg) _,
+ options(nomem, att_syntax),
+ );
+ // There is a race between popfd (A) and pushfd (B)
+ // where other bits beyond 21st may have been modified due to
+ // interrupts, a debugger stepping through the asm, etc.
+ //
+ // Therefore, explicitly check whether the 21st bit
+ // was modified or not.
+ //
+ // If the result is zero, the cpuid bit was not modified.
+ // If the result is `0x200000` (non-zero), then the cpuid
+ // was correctly modified and the CPU supports the cpuid
+ // instruction:
+ (result & 0x200000) != 0
+ }
+ }
+}
+
+/// Returns the highest-supported `leaf` (`EAX`) and sub-leaf (`ECX`) `cpuid`
+/// values.
+///
+/// If `cpuid` is supported, and `leaf` is zero, then the first tuple argument
+/// contains the highest `leaf` value that `cpuid` supports. For `leaf`s
+/// containing sub-leafs, the second tuple argument contains the
+/// highest-supported sub-leaf value.
+///
+/// See also [`__cpuid`](fn.__cpuid.html) and
+/// [`__cpuid_count`](fn.__cpuid_count.html).
+#[inline]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn __get_cpuid_max(leaf: u32) -> (u32, u32) {
+ let CpuidResult { eax, ebx, .. } = __cpuid(leaf);
+ (eax, ebx)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::x86::*;
+
+ #[test]
+ fn test_always_has_cpuid() {
+ // all currently-tested targets have the instruction
+ // FIXME: add targets without `cpuid` to CI
+ assert!(cpuid::has_cpuid());
+ }
+
+ #[test]
+ fn test_has_cpuid_idempotent() {
+ assert_eq!(cpuid::has_cpuid(), cpuid::has_cpuid());
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/eflags.rs b/library/stdarch/crates/core_arch/src/x86/eflags.rs
new file mode 100644
index 000000000..e9ebdf22b
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/eflags.rs
@@ -0,0 +1,85 @@
+//! `i386` intrinsics
+
+use crate::arch::asm;
+
+/// Reads EFLAGS.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=__readeflags)
+#[cfg(target_arch = "x86")]
+#[inline(always)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[deprecated(
+ since = "1.29.0",
+ note = "See issue #51810 - use inline assembly instead"
+)]
+#[doc(hidden)]
+pub unsafe fn __readeflags() -> u32 {
+ let eflags: u32;
+ asm!("pushfd", "pop {}", out(reg) eflags, options(nomem, att_syntax));
+ eflags
+}
+
+/// Reads EFLAGS.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=__readeflags)
+#[cfg(target_arch = "x86_64")]
+#[inline(always)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[deprecated(
+ since = "1.29.0",
+ note = "See issue #51810 - use inline assembly instead"
+)]
+#[doc(hidden)]
+pub unsafe fn __readeflags() -> u64 {
+ let eflags: u64;
+ asm!("pushfq", "pop {}", out(reg) eflags, options(nomem, att_syntax));
+ eflags
+}
+
+/// Write EFLAGS.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=__writeeflags)
+#[cfg(target_arch = "x86")]
+#[inline(always)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[deprecated(
+ since = "1.29.0",
+ note = "See issue #51810 - use inline assembly instead"
+)]
+#[doc(hidden)]
+pub unsafe fn __writeeflags(eflags: u32) {
+ asm!("push {}", "popfd", in(reg) eflags, options(nomem, att_syntax));
+}
+
+/// Write EFLAGS.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=__writeeflags)
+#[cfg(target_arch = "x86_64")]
+#[inline(always)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[deprecated(
+ since = "1.29.0",
+ note = "See issue #51810 - use inline assembly instead"
+)]
+#[doc(hidden)]
+pub unsafe fn __writeeflags(eflags: u64) {
+ asm!("push {}", "popfq", in(reg) eflags, options(nomem, att_syntax));
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::x86::*;
+
+ #[test]
+ #[allow(deprecated)]
+ fn test_eflags() {
+ unsafe {
+ // reads eflags, writes them back, reads them again,
+ // and compare for equality:
+ let v = __readeflags();
+ __writeeflags(v);
+ let u = __readeflags();
+ assert_eq!(v, u);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/f16c.rs b/library/stdarch/crates/core_arch/src/x86/f16c.rs
new file mode 100644
index 000000000..8b25fd65e
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/f16c.rs
@@ -0,0 +1,112 @@
+//! [F16C intrinsics].
+//!
+//! [F16C intrinsics]: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=fp16&expand=1769
+
+use crate::{
+ core_arch::{simd::*, x86::*},
+ // hint::unreachable_unchecked,
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "unadjusted" {
+ #[link_name = "llvm.x86.vcvtph2ps.128"]
+ fn llvm_vcvtph2ps_128(a: i16x8) -> f32x4;
+ #[link_name = "llvm.x86.vcvtph2ps.256"]
+ fn llvm_vcvtph2ps_256(a: i16x8) -> f32x8;
+ #[link_name = "llvm.x86.vcvtps2ph.128"]
+ fn llvm_vcvtps2ph_128(a: f32x4, rounding: i32) -> i16x8;
+ #[link_name = "llvm.x86.vcvtps2ph.256"]
+ fn llvm_vcvtps2ph_256(a: f32x8, rounding: i32) -> i16x8;
+}
+
+/// Converts the 4 x 16-bit half-precision float values in the lowest 64-bit of
+/// the 128-bit vector `a` into 4 x 32-bit float values stored in a 128-bit wide
+/// vector.
+#[inline]
+#[target_feature(enable = "f16c")]
+#[cfg_attr(test, assert_instr("vcvtph2ps"))]
+pub unsafe fn _mm_cvtph_ps(a: __m128i) -> __m128 {
+ transmute(llvm_vcvtph2ps_128(transmute(a)))
+}
+
+/// Converts the 8 x 16-bit half-precision float values in the 128-bit vector
+/// `a` into 8 x 32-bit float values stored in a 256-bit wide vector.
+#[inline]
+#[target_feature(enable = "f16c")]
+#[cfg_attr(test, assert_instr("vcvtph2ps"))]
+pub unsafe fn _mm256_cvtph_ps(a: __m128i) -> __m256 {
+ transmute(llvm_vcvtph2ps_256(transmute(a)))
+}
+
+/// Converts the 4 x 32-bit float values in the 128-bit vector `a` into 4 x
+/// 16-bit half-precision float values stored in the lowest 64-bit of a 128-bit
+/// vector.
+///
+/// Rounding is done according to the `imm_rounding` parameter, which can be one of:
+///
+/// * `_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC`: round to nearest and suppress exceptions,
+/// * `_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC`: round down and suppress exceptions,
+/// * `_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC`: round up and suppress exceptions,
+/// * `_MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC`: truncate and suppress exceptions,
+/// * `_MM_FROUND_CUR_DIRECTION`: use `MXCSR.RC` - see [`_MM_SET_ROUNDING_MODE`].
+#[inline]
+#[target_feature(enable = "f16c")]
+#[cfg_attr(test, assert_instr("vcvtps2ph", IMM_ROUNDING = 0))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtps_ph<const IMM_ROUNDING: i32>(a: __m128) -> __m128i {
+ static_assert_imm3!(IMM_ROUNDING);
+ let a = a.as_f32x4();
+ let r = llvm_vcvtps2ph_128(a, IMM_ROUNDING);
+ transmute(r)
+}
+
+/// Converts the 8 x 32-bit float values in the 256-bit vector `a` into 8 x
+/// 16-bit half-precision float values stored in a 128-bit wide vector.
+///
+/// Rounding is done according to the `imm_rounding` parameter, which can be one of:
+///
+/// * `_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC`: round to nearest and suppress exceptions,
+/// * `_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC`: round down and suppress exceptions,
+/// * `_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC`: round up and suppress exceptions,
+/// * `_MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC`: truncate and suppress exceptions,
+/// * `_MM_FROUND_CUR_DIRECTION`: use `MXCSR.RC` - see [`_MM_SET_ROUNDING_MODE`].
+#[inline]
+#[target_feature(enable = "f16c")]
+#[cfg_attr(test, assert_instr("vcvtps2ph", IMM_ROUNDING = 0))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm256_cvtps_ph<const IMM_ROUNDING: i32>(a: __m256) -> __m128i {
+ static_assert_imm3!(IMM_ROUNDING);
+ let a = a.as_f32x8();
+ let r = llvm_vcvtps2ph_256(a, IMM_ROUNDING);
+ transmute(r)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::{core_arch::x86::*, mem::transmute};
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "f16c")]
+ unsafe fn test_mm_cvtph_ps() {
+ let array = [1_f32, 2_f32, 3_f32, 4_f32];
+ let float_vec: __m128 = transmute(array);
+ let halfs: __m128i = _mm_cvtps_ph::<0>(float_vec);
+ let floats: __m128 = _mm_cvtph_ps(halfs);
+ let result: [f32; 4] = transmute(floats);
+ assert_eq!(result, array);
+ }
+
+ #[simd_test(enable = "f16c")]
+ unsafe fn test_mm256_cvtph_ps() {
+ let array = [1_f32, 2_f32, 3_f32, 4_f32, 5_f32, 6_f32, 7_f32, 8_f32];
+ let float_vec: __m256 = transmute(array);
+ let halfs: __m128i = _mm256_cvtps_ph::<0>(float_vec);
+ let floats: __m256 = _mm256_cvtph_ps(halfs);
+ let result: [f32; 8] = transmute(floats);
+ assert_eq!(result, array);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/fma.rs b/library/stdarch/crates/core_arch/src/x86/fma.rs
new file mode 100644
index 000000000..476f4538c
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/fma.rs
@@ -0,0 +1,795 @@
+//! Fused Multiply-Add instruction set (FMA)
+//!
+//! The FMA instruction set is an extension to the 128 and 256-bit SSE
+//! instructions in the x86 microprocessor instruction set to perform fused
+//! multiply–add (FMA) operations.
+//!
+//! The references are:
+//!
+//! - [Intel 64 and IA-32 Architectures Software Developer's Manual Volume 2:
+//! Instruction Set Reference, A-Z][intel64_ref].
+//! - [AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and
+//! System Instructions][amd64_ref].
+//!
+//! Wikipedia's [FMA][wiki_fma] page provides a quick overview of the
+//! instructions available.
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf
+//! [wiki_fma]: https://en.wikipedia.org/wiki/Fused_multiply-accumulate
+
+use crate::core_arch::simd_llvm::simd_fma;
+use crate::core_arch::x86::*;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and add the intermediate result to packed elements in `c`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmadd_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ simd_fma(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and add the intermediate result to packed elements in `c`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fmadd_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fmadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ simd_fma(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and add the intermediate result to packed elements in `c`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmadd_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 {
+ simd_fma(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and add the intermediate result to packed elements in `c`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fmadd_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fmadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 {
+ simd_fma(a, b, c)
+}
+
+/// Multiplies the lower double-precision (64-bit) floating-point elements in
+/// `a` and `b`, and add the intermediate result to the lower element in `c`.
+/// Stores the result in the lower element of the returned value, and copy the
+/// upper element from `a` to the upper elements of the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmadd_sd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmadd_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ vfmaddsd(a, b, c)
+}
+
+/// Multiplies the lower single-precision (32-bit) floating-point elements in
+/// `a` and `b`, and add the intermediate result to the lower element in `c`.
+/// Stores the result in the lower element of the returned value, and copy the
+/// 3 upper elements from `a` to the upper elements of the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmadd_ss)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmadd_ss(a: __m128, b: __m128, c: __m128) -> __m128 {
+ vfmaddss(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and alternatively add and subtract packed elements in `c` to/from
+/// the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmaddsub_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmaddsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmaddsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ vfmaddsubpd(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and alternatively add and subtract packed elements in `c` to/from
+/// the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fmaddsub_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmaddsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fmaddsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ vfmaddsubpd256(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and alternatively add and subtract packed elements in `c` to/from
+/// the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmaddsub_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmaddsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmaddsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 {
+ vfmaddsubps(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and alternatively add and subtract packed elements in `c` to/from
+/// the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fmaddsub_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmaddsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fmaddsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 {
+ vfmaddsubps256(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and subtract packed elements in `c` from the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmsub_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ vfmsubpd(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and subtract packed elements in `c` from the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fmsub_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fmsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ vfmsubpd256(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and subtract packed elements in `c` from the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmsub_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmsub213ps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 {
+ vfmsubps(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and subtract packed elements in `c` from the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fmsub_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmsub213ps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fmsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 {
+ vfmsubps256(a, b, c)
+}
+
+/// Multiplies the lower double-precision (64-bit) floating-point elements in
+/// `a` and `b`, and subtract the lower element in `c` from the intermediate
+/// result. Store the result in the lower element of the returned value, and
+/// copy the upper element from `a` to the upper elements of the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmsub_sd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmsub_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ vfmsubsd(a, b, c)
+}
+
+/// Multiplies the lower single-precision (32-bit) floating-point elements in
+/// `a` and `b`, and subtract the lower element in `c` from the intermediate
+/// result. Store the result in the lower element of the returned value, and
+/// copy the 3 upper elements from `a` to the upper elements of the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmsub_ss)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmsub_ss(a: __m128, b: __m128, c: __m128) -> __m128 {
+ vfmsubss(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and alternatively subtract and add packed elements in `c` from/to
+/// the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmsubadd_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmsubadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmsubadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ vfmsubaddpd(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and alternatively subtract and add packed elements in `c` from/to
+/// the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fmsubadd_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmsubadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fmsubadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ vfmsubaddpd256(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and alternatively subtract and add packed elements in `c` from/to
+/// the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fmsubadd_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmsubadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fmsubadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 {
+ vfmsubaddps(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and alternatively subtract and add packed elements in `c` from/to
+/// the intermediate result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fmsubadd_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfmsubadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fmsubadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 {
+ vfmsubaddps256(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and add the negated intermediate result to packed elements in `c`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fnmadd_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fnmadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ vfnmaddpd(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and add the negated intermediate result to packed elements in `c`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fnmadd_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fnmadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ vfnmaddpd256(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and add the negated intermediate result to packed elements in `c`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fnmadd_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fnmadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 {
+ vfnmaddps(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and add the negated intermediate result to packed elements in `c`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fnmadd_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fnmadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 {
+ vfnmaddps256(a, b, c)
+}
+
+/// Multiplies the lower double-precision (64-bit) floating-point elements in
+/// `a` and `b`, and add the negated intermediate result to the lower element
+/// in `c`. Store the result in the lower element of the returned value, and
+/// copy the upper element from `a` to the upper elements of the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fnmadd_sd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fnmadd_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ vfnmaddsd(a, b, c)
+}
+
+/// Multiplies the lower single-precision (32-bit) floating-point elements in
+/// `a` and `b`, and add the negated intermediate result to the lower element
+/// in `c`. Store the result in the lower element of the returned value, and
+/// copy the 3 upper elements from `a` to the upper elements of the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fnmadd_ss)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmadd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fnmadd_ss(a: __m128, b: __m128, c: __m128) -> __m128 {
+ vfnmaddss(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and subtract packed elements in `c` from the negated intermediate
+/// result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fnmsub_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fnmsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ vfnmsubpd(a, b, c)
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`, and subtract packed elements in `c` from the negated intermediate
+/// result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fnmsub_pd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fnmsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d {
+ vfnmsubpd256(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and subtract packed elements in `c` from the negated intermediate
+/// result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fnmsub_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fnmsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 {
+ vfnmsubps(a, b, c)
+}
+
+/// Multiplies packed single-precision (32-bit) floating-point elements in `a`
+/// and `b`, and subtract packed elements in `c` from the negated intermediate
+/// result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_fnmsub_ps)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_fnmsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 {
+ vfnmsubps256(a, b, c)
+}
+
+/// Multiplies the lower double-precision (64-bit) floating-point elements in
+/// `a` and `b`, and subtract packed elements in `c` from the negated
+/// intermediate result. Store the result in the lower element of the returned
+/// value, and copy the upper element from `a` to the upper elements of the
+/// result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fnmsub_sd)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fnmsub_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d {
+ vfnmsubsd(a, b, c)
+}
+
+/// Multiplies the lower single-precision (32-bit) floating-point elements in
+/// `a` and `b`, and subtract packed elements in `c` from the negated
+/// intermediate result. Store the result in the lower element of the
+/// returned value, and copy the 3 upper elements from `a` to the upper
+/// elements of the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_fnmsub_ss)
+#[inline]
+#[target_feature(enable = "fma")]
+#[cfg_attr(test, assert_instr(vfnmsub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_fnmsub_ss(a: __m128, b: __m128, c: __m128) -> __m128 {
+ vfnmsubss(a, b, c)
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.fma.vfmadd.sd"]
+ fn vfmaddsd(a: __m128d, b: __m128d, c: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.fma.vfmadd.ss"]
+ fn vfmaddss(a: __m128, b: __m128, c: __m128) -> __m128;
+ #[link_name = "llvm.x86.fma.vfmaddsub.pd"]
+ fn vfmaddsubpd(a: __m128d, b: __m128d, c: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.fma.vfmaddsub.pd.256"]
+ fn vfmaddsubpd256(a: __m256d, b: __m256d, c: __m256d) -> __m256d;
+ #[link_name = "llvm.x86.fma.vfmaddsub.ps"]
+ fn vfmaddsubps(a: __m128, b: __m128, c: __m128) -> __m128;
+ #[link_name = "llvm.x86.fma.vfmaddsub.ps.256"]
+ fn vfmaddsubps256(a: __m256, b: __m256, c: __m256) -> __m256;
+ #[link_name = "llvm.x86.fma.vfmsub.pd"]
+ fn vfmsubpd(a: __m128d, b: __m128d, c: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.fma.vfmsub.pd.256"]
+ fn vfmsubpd256(a: __m256d, b: __m256d, c: __m256d) -> __m256d;
+ #[link_name = "llvm.x86.fma.vfmsub.ps"]
+ fn vfmsubps(a: __m128, b: __m128, c: __m128) -> __m128;
+ #[link_name = "llvm.x86.fma.vfmsub.ps.256"]
+ fn vfmsubps256(a: __m256, b: __m256, c: __m256) -> __m256;
+ #[link_name = "llvm.x86.fma.vfmsub.sd"]
+ fn vfmsubsd(a: __m128d, b: __m128d, c: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.fma.vfmsub.ss"]
+ fn vfmsubss(a: __m128, b: __m128, c: __m128) -> __m128;
+ #[link_name = "llvm.x86.fma.vfmsubadd.pd"]
+ fn vfmsubaddpd(a: __m128d, b: __m128d, c: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.fma.vfmsubadd.pd.256"]
+ fn vfmsubaddpd256(a: __m256d, b: __m256d, c: __m256d) -> __m256d;
+ #[link_name = "llvm.x86.fma.vfmsubadd.ps"]
+ fn vfmsubaddps(a: __m128, b: __m128, c: __m128) -> __m128;
+ #[link_name = "llvm.x86.fma.vfmsubadd.ps.256"]
+ fn vfmsubaddps256(a: __m256, b: __m256, c: __m256) -> __m256;
+ #[link_name = "llvm.x86.fma.vfnmadd.pd"]
+ fn vfnmaddpd(a: __m128d, b: __m128d, c: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.fma.vfnmadd.pd.256"]
+ fn vfnmaddpd256(a: __m256d, b: __m256d, c: __m256d) -> __m256d;
+ #[link_name = "llvm.x86.fma.vfnmadd.ps"]
+ fn vfnmaddps(a: __m128, b: __m128, c: __m128) -> __m128;
+ #[link_name = "llvm.x86.fma.vfnmadd.ps.256"]
+ fn vfnmaddps256(a: __m256, b: __m256, c: __m256) -> __m256;
+ #[link_name = "llvm.x86.fma.vfnmadd.sd"]
+ fn vfnmaddsd(a: __m128d, b: __m128d, c: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.fma.vfnmadd.ss"]
+ fn vfnmaddss(a: __m128, b: __m128, c: __m128) -> __m128;
+ #[link_name = "llvm.x86.fma.vfnmsub.pd"]
+ fn vfnmsubpd(a: __m128d, b: __m128d, c: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.fma.vfnmsub.pd.256"]
+ fn vfnmsubpd256(a: __m256d, b: __m256d, c: __m256d) -> __m256d;
+ #[link_name = "llvm.x86.fma.vfnmsub.ps"]
+ fn vfnmsubps(a: __m128, b: __m128, c: __m128) -> __m128;
+ #[link_name = "llvm.x86.fma.vfnmsub.ps.256"]
+ fn vfnmsubps256(a: __m256, b: __m256, c: __m256) -> __m256;
+ #[link_name = "llvm.x86.fma.vfnmsub.sd"]
+ fn vfnmsubsd(a: __m128d, b: __m128d, c: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.fma.vfnmsub.ss"]
+ fn vfnmsubss(a: __m128, b: __m128, c: __m128) -> __m128;
+}
+
+#[cfg(test)]
+mod tests {
+
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmadd_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 3.);
+ let c = _mm_setr_pd(4., 9.);
+ let r = _mm_setr_pd(9., 15.);
+ assert_eq_m128d(_mm_fmadd_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fmadd_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 3., 7., 2.);
+ let c = _mm256_setr_pd(4., 9., 1., 7.);
+ let r = _mm256_setr_pd(9., 15., 22., 15.);
+ assert_eq_m256d(_mm256_fmadd_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmadd_ps() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let b = _mm_setr_ps(5., 3., 7., 2.);
+ let c = _mm_setr_ps(4., 9., 1., 7.);
+ let r = _mm_setr_ps(9., 15., 22., 15.);
+ assert_eq_m128(_mm_fmadd_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fmadd_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.);
+ let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.);
+ let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.);
+ let r = _mm256_setr_ps(9., 15., 22., 15., -5., -49., -2., -31.);
+ assert_eq_m256(_mm256_fmadd_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmadd_sd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 3.);
+ let c = _mm_setr_pd(4., 9.);
+ let r = _mm_setr_pd(9., 2.);
+ assert_eq_m128d(_mm_fmadd_sd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmadd_ss() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let b = _mm_setr_ps(5., 3., 7., 2.);
+ let c = _mm_setr_ps(4., 9., 1., 7.);
+ let r = _mm_setr_ps(9., 2., 3., 4.);
+ assert_eq_m128(_mm_fmadd_ss(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmaddsub_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 3.);
+ let c = _mm_setr_pd(4., 9.);
+ let r = _mm_setr_pd(1., 15.);
+ assert_eq_m128d(_mm_fmaddsub_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fmaddsub_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 3., 7., 2.);
+ let c = _mm256_setr_pd(4., 9., 1., 7.);
+ let r = _mm256_setr_pd(1., 15., 20., 15.);
+ assert_eq_m256d(_mm256_fmaddsub_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmaddsub_ps() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let b = _mm_setr_ps(5., 3., 7., 2.);
+ let c = _mm_setr_ps(4., 9., 1., 7.);
+ let r = _mm_setr_ps(1., 15., 20., 15.);
+ assert_eq_m128(_mm_fmaddsub_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fmaddsub_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.);
+ let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.);
+ let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.);
+ let r = _mm256_setr_ps(1., 15., 20., 15., 5., -49., 2., -31.);
+ assert_eq_m256(_mm256_fmaddsub_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmsub_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 3.);
+ let c = _mm_setr_pd(4., 9.);
+ let r = _mm_setr_pd(1., -3.);
+ assert_eq_m128d(_mm_fmsub_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fmsub_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 3., 7., 2.);
+ let c = _mm256_setr_pd(4., 9., 1., 7.);
+ let r = _mm256_setr_pd(1., -3., 20., 1.);
+ assert_eq_m256d(_mm256_fmsub_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmsub_ps() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let b = _mm_setr_ps(5., 3., 7., 2.);
+ let c = _mm_setr_ps(4., 9., 1., 7.);
+ let r = _mm_setr_ps(1., -3., 20., 1.);
+ assert_eq_m128(_mm_fmsub_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fmsub_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.);
+ let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.);
+ let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.);
+ let r = _mm256_setr_ps(1., -3., 20., 1., 5., -71., 2., -25.);
+ assert_eq_m256(_mm256_fmsub_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmsub_sd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 3.);
+ let c = _mm_setr_pd(4., 9.);
+ let r = _mm_setr_pd(1., 2.);
+ assert_eq_m128d(_mm_fmsub_sd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmsub_ss() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let b = _mm_setr_ps(5., 3., 7., 2.);
+ let c = _mm_setr_ps(4., 9., 1., 7.);
+ let r = _mm_setr_ps(1., 2., 3., 4.);
+ assert_eq_m128(_mm_fmsub_ss(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmsubadd_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 3.);
+ let c = _mm_setr_pd(4., 9.);
+ let r = _mm_setr_pd(9., -3.);
+ assert_eq_m128d(_mm_fmsubadd_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fmsubadd_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 3., 7., 2.);
+ let c = _mm256_setr_pd(4., 9., 1., 7.);
+ let r = _mm256_setr_pd(9., -3., 22., 1.);
+ assert_eq_m256d(_mm256_fmsubadd_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fmsubadd_ps() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let b = _mm_setr_ps(5., 3., 7., 2.);
+ let c = _mm_setr_ps(4., 9., 1., 7.);
+ let r = _mm_setr_ps(9., -3., 22., 1.);
+ assert_eq_m128(_mm_fmsubadd_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fmsubadd_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.);
+ let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.);
+ let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.);
+ let r = _mm256_setr_ps(9., -3., 22., 1., -5., -71., -2., -25.);
+ assert_eq_m256(_mm256_fmsubadd_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fnmadd_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 3.);
+ let c = _mm_setr_pd(4., 9.);
+ let r = _mm_setr_pd(-1., 3.);
+ assert_eq_m128d(_mm_fnmadd_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fnmadd_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 3., 7., 2.);
+ let c = _mm256_setr_pd(4., 9., 1., 7.);
+ let r = _mm256_setr_pd(-1., 3., -20., -1.);
+ assert_eq_m256d(_mm256_fnmadd_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fnmadd_ps() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let b = _mm_setr_ps(5., 3., 7., 2.);
+ let c = _mm_setr_ps(4., 9., 1., 7.);
+ let r = _mm_setr_ps(-1., 3., -20., -1.);
+ assert_eq_m128(_mm_fnmadd_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fnmadd_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.);
+ let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.);
+ let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.);
+ let r = _mm256_setr_ps(-1., 3., -20., -1., -5., 71., -2., 25.);
+ assert_eq_m256(_mm256_fnmadd_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fnmadd_sd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 3.);
+ let c = _mm_setr_pd(4., 9.);
+ let r = _mm_setr_pd(-1., 2.);
+ assert_eq_m128d(_mm_fnmadd_sd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fnmadd_ss() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let b = _mm_setr_ps(5., 3., 7., 2.);
+ let c = _mm_setr_ps(4., 9., 1., 7.);
+ let r = _mm_setr_ps(-1., 2., 3., 4.);
+ assert_eq_m128(_mm_fnmadd_ss(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fnmsub_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 3.);
+ let c = _mm_setr_pd(4., 9.);
+ let r = _mm_setr_pd(-9., -15.);
+ assert_eq_m128d(_mm_fnmsub_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fnmsub_pd() {
+ let a = _mm256_setr_pd(1., 2., 3., 4.);
+ let b = _mm256_setr_pd(5., 3., 7., 2.);
+ let c = _mm256_setr_pd(4., 9., 1., 7.);
+ let r = _mm256_setr_pd(-9., -15., -22., -15.);
+ assert_eq_m256d(_mm256_fnmsub_pd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fnmsub_ps() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let b = _mm_setr_ps(5., 3., 7., 2.);
+ let c = _mm_setr_ps(4., 9., 1., 7.);
+ let r = _mm_setr_ps(-9., -15., -22., -15.);
+ assert_eq_m128(_mm_fnmsub_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm256_fnmsub_ps() {
+ let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.);
+ let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.);
+ let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.);
+ let r = _mm256_setr_ps(-9., -15., -22., -15., 5., 49., 2., 31.);
+ assert_eq_m256(_mm256_fnmsub_ps(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fnmsub_sd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(5., 3.);
+ let c = _mm_setr_pd(4., 9.);
+ let r = _mm_setr_pd(-9., 2.);
+ assert_eq_m128d(_mm_fnmsub_sd(a, b, c), r);
+ }
+
+ #[simd_test(enable = "fma")]
+ unsafe fn test_mm_fnmsub_ss() {
+ let a = _mm_setr_ps(1., 2., 3., 4.);
+ let b = _mm_setr_ps(5., 3., 7., 2.);
+ let c = _mm_setr_ps(4., 9., 1., 7.);
+ let r = _mm_setr_ps(-9., 2., 3., 4.);
+ assert_eq_m128(_mm_fnmsub_ss(a, b, c), r);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/fxsr.rs b/library/stdarch/crates/core_arch/src/x86/fxsr.rs
new file mode 100644
index 000000000..8ea1bfab7
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/fxsr.rs
@@ -0,0 +1,112 @@
+//! FXSR floating-point context fast save and restore.
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.fxsave"]
+ fn fxsave(p: *mut u8);
+ #[link_name = "llvm.x86.fxrstor"]
+ fn fxrstor(p: *const u8);
+}
+
+/// Saves the `x87` FPU, `MMX` technology, `XMM`, and `MXCSR` registers to the
+/// 512-byte-long 16-byte-aligned memory region `mem_addr`.
+///
+/// A misaligned destination operand raises a general-protection (#GP) or an
+/// alignment check exception (#AC).
+///
+/// See [`FXSAVE`][fxsave] and [`FXRSTOR`][fxrstor].
+///
+/// [fxsave]: http://www.felixcloutier.com/x86/FXSAVE.html
+/// [fxrstor]: http://www.felixcloutier.com/x86/FXRSTOR.html
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_fxsave)
+#[inline]
+#[target_feature(enable = "fxsr")]
+#[cfg_attr(test, assert_instr(fxsave))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _fxsave(mem_addr: *mut u8) {
+ fxsave(mem_addr)
+}
+
+/// Restores the `XMM`, `MMX`, `MXCSR`, and `x87` FPU registers from the
+/// 512-byte-long 16-byte-aligned memory region `mem_addr`.
+///
+/// The contents of this memory region should have been written to by a
+/// previous
+/// `_fxsave` or `_fxsave64` intrinsic.
+///
+/// A misaligned destination operand raises a general-protection (#GP) or an
+/// alignment check exception (#AC).
+///
+/// See [`FXSAVE`][fxsave] and [`FXRSTOR`][fxrstor].
+///
+/// [fxsave]: http://www.felixcloutier.com/x86/FXSAVE.html
+/// [fxrstor]: http://www.felixcloutier.com/x86/FXRSTOR.html
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_fxrstor)
+#[inline]
+#[target_feature(enable = "fxsr")]
+#[cfg_attr(test, assert_instr(fxrstor))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _fxrstor(mem_addr: *const u8) {
+ fxrstor(mem_addr)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::x86::*;
+ use std::{cmp::PartialEq, fmt};
+ use stdarch_test::simd_test;
+
+ #[repr(align(16))]
+ struct FxsaveArea {
+ data: [u8; 512], // 512 bytes
+ }
+
+ impl FxsaveArea {
+ fn new() -> FxsaveArea {
+ FxsaveArea { data: [0; 512] }
+ }
+ fn ptr(&mut self) -> *mut u8 {
+ &mut self.data[0] as *mut _ as *mut u8
+ }
+ }
+
+ impl PartialEq<FxsaveArea> for FxsaveArea {
+ fn eq(&self, other: &FxsaveArea) -> bool {
+ for i in 0..self.data.len() {
+ if self.data[i] != other.data[i] {
+ return false;
+ }
+ }
+ true
+ }
+ }
+
+ impl fmt::Debug for FxsaveArea {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "[")?;
+ for i in 0..self.data.len() {
+ write!(f, "{}", self.data[i])?;
+ if i != self.data.len() - 1 {
+ write!(f, ", ")?;
+ }
+ }
+ write!(f, "]")
+ }
+ }
+
+ #[simd_test(enable = "fxsr")]
+ unsafe fn fxsave() {
+ let mut a = FxsaveArea::new();
+ let mut b = FxsaveArea::new();
+
+ fxsr::_fxsave(a.ptr());
+ fxsr::_fxrstor(a.ptr());
+ fxsr::_fxsave(b.ptr());
+ assert_eq!(a, b);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/macros.rs b/library/stdarch/crates/core_arch/src/x86/macros.rs
new file mode 100644
index 000000000..e686e65b3
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/macros.rs
@@ -0,0 +1,104 @@
+//! Utility macros.
+//!
+// Helper struct used to trigger const eval errors when the const generic immediate value `imm` is
+// not a round number.
+pub(crate) struct ValidateConstRound<const IMM: i32>;
+impl<const IMM: i32> ValidateConstRound<IMM> {
+ pub(crate) const VALID: () = {
+ assert!(
+ IMM == 4 || IMM == 8 || IMM == 9 || IMM == 10 || IMM == 11,
+ "Invalid IMM value"
+ );
+ };
+}
+
+#[allow(unused)]
+macro_rules! static_assert_rounding {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::x86::macros::ValidateConstRound::<$imm>::VALID;
+ };
+}
+
+// Helper struct used to trigger const eval errors when the const generic immediate value `imm` is
+// not a sae number.
+pub(crate) struct ValidateConstSae<const IMM: i32>;
+impl<const IMM: i32> ValidateConstSae<IMM> {
+ pub(crate) const VALID: () = {
+ assert!(IMM == 4 || IMM == 8, "Invalid IMM value");
+ };
+}
+
+#[allow(unused)]
+macro_rules! static_assert_sae {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::x86::macros::ValidateConstSae::<$imm>::VALID;
+ };
+}
+
+// Helper struct used to trigger const eval errors when the const generic immediate value `imm` is
+// not a mantissas sae number.
+pub(crate) struct ValidateConstMantissasSae<const IMM: i32>;
+impl<const IMM: i32> ValidateConstMantissasSae<IMM> {
+ pub(crate) const VALID: () = {
+ assert!(IMM == 4 || IMM == 8 || IMM == 12, "Invalid IMM value");
+ };
+}
+
+#[allow(unused)]
+macro_rules! static_assert_mantissas_sae {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::x86::macros::ValidateConstMantissasSae::<$imm>::VALID;
+ };
+}
+
+// Helper struct used to trigger const eval errors when the unsigned const generic immediate value
+// `IMM` is out of `[MIN-MAX]` range.
+pub(crate) struct ValidateConstImmU32<const IMM: u32, const MIN: u32, const MAX: u32>;
+impl<const IMM: u32, const MIN: u32, const MAX: u32> ValidateConstImmU32<IMM, MIN, MAX> {
+ pub(crate) const VALID: () = {
+ assert!(IMM >= MIN && IMM <= MAX, "IMM value not in expected range");
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! static_assert_imm_u8 {
+ ($imm:ident) => {
+ let _ =
+ $crate::core_arch::x86::macros::ValidateConstImmU32::<$imm, 0, { (1 << 8) - 1 }>::VALID;
+ };
+}
+
+// Helper struct used to trigger const eval errors when the const generic immediate value `SCALE` is
+// not valid for gather instructions: the only valid scale values are 1, 2, 4 and 8.
+pub(crate) struct ValidateConstGatherScale<const SCALE: i32>;
+impl<const SCALE: i32> ValidateConstGatherScale<SCALE> {
+ pub(crate) const VALID: () = {
+ assert!(
+ SCALE == 1 || SCALE == 2 || SCALE == 4 || SCALE == 8,
+ "Invalid SCALE value"
+ );
+ };
+}
+
+#[allow(unused)]
+macro_rules! static_assert_imm8_scale {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::x86::macros::ValidateConstGatherScale::<$imm>::VALID;
+ };
+}
+
+#[cfg(test)]
+macro_rules! assert_approx_eq {
+ ($a:expr, $b:expr, $eps:expr) => {{
+ let (a, b) = (&$a, &$b);
+ assert!(
+ (*a - *b).abs() < $eps,
+ "assertion failed: `(left !== right)` \
+ (left: `{:?}`, right: `{:?}`, expect diff: `{:?}`, real diff: `{:?}`)",
+ *a,
+ *b,
+ $eps,
+ (*a - *b).abs()
+ );
+ }};
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/mod.rs b/library/stdarch/crates/core_arch/src/x86/mod.rs
new file mode 100644
index 000000000..547bfe67d
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/mod.rs
@@ -0,0 +1,860 @@
+//! `x86` and `x86_64` intrinsics.
+
+use crate::{intrinsics, marker::Sized, mem::transmute};
+
+#[macro_use]
+mod macros;
+
+types! {
+ /// 128-bit wide integer vector type, x86-specific
+ ///
+ /// This type is the same as the `__m128i` type defined by Intel,
+ /// representing a 128-bit SIMD register. Usage of this type typically
+ /// corresponds to the `sse` and up target features for x86/x86_64.
+ ///
+ /// Internally this type may be viewed as:
+ ///
+ /// * `i8x16` - sixteen `i8` variables packed together
+ /// * `i16x8` - eight `i16` variables packed together
+ /// * `i32x4` - four `i32` variables packed together
+ /// * `i64x2` - two `i64` variables packed together
+ ///
+ /// (as well as unsigned versions). Each intrinsic may interpret the
+ /// internal bits differently, check the documentation of the intrinsic
+ /// to see how it's being used.
+ ///
+ /// Note that this means that an instance of `__m128i` typically just means
+ /// a "bag of bits" which is left up to interpretation at the point of use.
+ ///
+ /// Most intrinsics using `__m128i` are prefixed with `_mm_` and the
+ /// integer types tend to correspond to suffixes like "epi8" or "epi32".
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// #[cfg(target_arch = "x86")]
+ /// use std::arch::x86::*;
+ /// #[cfg(target_arch = "x86_64")]
+ /// use std::arch::x86_64::*;
+ ///
+ /// # fn main() {
+ /// # #[target_feature(enable = "sse2")]
+ /// # unsafe fn foo() {
+ /// let all_bytes_zero = _mm_setzero_si128();
+ /// let all_bytes_one = _mm_set1_epi8(1);
+ /// let four_i32 = _mm_set_epi32(1, 2, 3, 4);
+ /// # }
+ /// # if is_x86_feature_detected!("sse2") { unsafe { foo() } }
+ /// # }
+ /// ```
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub struct __m128i(i64, i64);
+
+ /// 128-bit wide set of four `f32` types, x86-specific
+ ///
+ /// This type is the same as the `__m128` type defined by Intel,
+ /// representing a 128-bit SIMD register which internally is consisted of
+ /// four packed `f32` instances. Usage of this type typically corresponds
+ /// to the `sse` and up target features for x86/x86_64.
+ ///
+ /// Note that unlike `__m128i`, the integer version of the 128-bit
+ /// registers, this `__m128` type has *one* interpretation. Each instance
+ /// of `__m128` always corresponds to `f32x4`, or four `f32` types packed
+ /// together.
+ ///
+ /// Most intrinsics using `__m128` are prefixed with `_mm_` and are
+ /// suffixed with "ps" (or otherwise contain "ps"). Not to be confused with
+ /// "pd" which is used for `__m128d`.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// #[cfg(target_arch = "x86")]
+ /// use std::arch::x86::*;
+ /// #[cfg(target_arch = "x86_64")]
+ /// use std::arch::x86_64::*;
+ ///
+ /// # fn main() {
+ /// # #[target_feature(enable = "sse")]
+ /// # unsafe fn foo() {
+ /// let four_zeros = _mm_setzero_ps();
+ /// let four_ones = _mm_set1_ps(1.0);
+ /// let four_floats = _mm_set_ps(1.0, 2.0, 3.0, 4.0);
+ /// # }
+ /// # if is_x86_feature_detected!("sse") { unsafe { foo() } }
+ /// # }
+ /// ```
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub struct __m128(f32, f32, f32, f32);
+
+ /// 128-bit wide set of two `f64` types, x86-specific
+ ///
+ /// This type is the same as the `__m128d` type defined by Intel,
+ /// representing a 128-bit SIMD register which internally is consisted of
+ /// two packed `f64` instances. Usage of this type typically corresponds
+ /// to the `sse` and up target features for x86/x86_64.
+ ///
+ /// Note that unlike `__m128i`, the integer version of the 128-bit
+ /// registers, this `__m128d` type has *one* interpretation. Each instance
+ /// of `__m128d` always corresponds to `f64x2`, or two `f64` types packed
+ /// together.
+ ///
+ /// Most intrinsics using `__m128d` are prefixed with `_mm_` and are
+ /// suffixed with "pd" (or otherwise contain "pd"). Not to be confused with
+ /// "ps" which is used for `__m128`.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// #[cfg(target_arch = "x86")]
+ /// use std::arch::x86::*;
+ /// #[cfg(target_arch = "x86_64")]
+ /// use std::arch::x86_64::*;
+ ///
+ /// # fn main() {
+ /// # #[target_feature(enable = "sse")]
+ /// # unsafe fn foo() {
+ /// let two_zeros = _mm_setzero_pd();
+ /// let two_ones = _mm_set1_pd(1.0);
+ /// let two_floats = _mm_set_pd(1.0, 2.0);
+ /// # }
+ /// # if is_x86_feature_detected!("sse") { unsafe { foo() } }
+ /// # }
+ /// ```
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub struct __m128d(f64, f64);
+
+ /// 256-bit wide integer vector type, x86-specific
+ ///
+ /// This type is the same as the `__m256i` type defined by Intel,
+ /// representing a 256-bit SIMD register. Usage of this type typically
+ /// corresponds to the `avx` and up target features for x86/x86_64.
+ ///
+ /// Internally this type may be viewed as:
+ ///
+ /// * `i8x32` - thirty two `i8` variables packed together
+ /// * `i16x16` - sixteen `i16` variables packed together
+ /// * `i32x8` - eight `i32` variables packed together
+ /// * `i64x4` - four `i64` variables packed together
+ ///
+ /// (as well as unsigned versions). Each intrinsic may interpret the
+ /// internal bits differently, check the documentation of the intrinsic
+ /// to see how it's being used.
+ ///
+ /// Note that this means that an instance of `__m256i` typically just means
+ /// a "bag of bits" which is left up to interpretation at the point of use.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// #[cfg(target_arch = "x86")]
+ /// use std::arch::x86::*;
+ /// #[cfg(target_arch = "x86_64")]
+ /// use std::arch::x86_64::*;
+ ///
+ /// # fn main() {
+ /// # #[target_feature(enable = "avx")]
+ /// # unsafe fn foo() {
+ /// let all_bytes_zero = _mm256_setzero_si256();
+ /// let all_bytes_one = _mm256_set1_epi8(1);
+ /// let eight_i32 = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ /// # }
+ /// # if is_x86_feature_detected!("avx") { unsafe { foo() } }
+ /// # }
+ /// ```
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub struct __m256i(i64, i64, i64, i64);
+
+ /// 256-bit wide set of eight `f32` types, x86-specific
+ ///
+ /// This type is the same as the `__m256` type defined by Intel,
+ /// representing a 256-bit SIMD register which internally is consisted of
+ /// eight packed `f32` instances. Usage of this type typically corresponds
+ /// to the `avx` and up target features for x86/x86_64.
+ ///
+ /// Note that unlike `__m256i`, the integer version of the 256-bit
+ /// registers, this `__m256` type has *one* interpretation. Each instance
+ /// of `__m256` always corresponds to `f32x8`, or eight `f32` types packed
+ /// together.
+ ///
+ /// Most intrinsics using `__m256` are prefixed with `_mm256_` and are
+ /// suffixed with "ps" (or otherwise contain "ps"). Not to be confused with
+ /// "pd" which is used for `__m256d`.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// #[cfg(target_arch = "x86")]
+ /// use std::arch::x86::*;
+ /// #[cfg(target_arch = "x86_64")]
+ /// use std::arch::x86_64::*;
+ ///
+ /// # fn main() {
+ /// # #[target_feature(enable = "avx")]
+ /// # unsafe fn foo() {
+ /// let eight_zeros = _mm256_setzero_ps();
+ /// let eight_ones = _mm256_set1_ps(1.0);
+ /// let eight_floats = _mm256_set_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0);
+ /// # }
+ /// # if is_x86_feature_detected!("avx") { unsafe { foo() } }
+ /// # }
+ /// ```
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub struct __m256(f32, f32, f32, f32, f32, f32, f32, f32);
+
+ /// 256-bit wide set of four `f64` types, x86-specific
+ ///
+ /// This type is the same as the `__m256d` type defined by Intel,
+ /// representing a 256-bit SIMD register which internally is consisted of
+ /// four packed `f64` instances. Usage of this type typically corresponds
+ /// to the `avx` and up target features for x86/x86_64.
+ ///
+ /// Note that unlike `__m256i`, the integer version of the 256-bit
+ /// registers, this `__m256d` type has *one* interpretation. Each instance
+ /// of `__m256d` always corresponds to `f64x4`, or four `f64` types packed
+ /// together.
+ ///
+ /// Most intrinsics using `__m256d` are prefixed with `_mm256_` and are
+ /// suffixed with "pd" (or otherwise contain "pd"). Not to be confused with
+ /// "ps" which is used for `__m256`.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// #[cfg(target_arch = "x86")]
+ /// use std::arch::x86::*;
+ /// #[cfg(target_arch = "x86_64")]
+ /// use std::arch::x86_64::*;
+ ///
+ /// # fn main() {
+ /// # #[target_feature(enable = "avx")]
+ /// # unsafe fn foo() {
+ /// let four_zeros = _mm256_setzero_pd();
+ /// let four_ones = _mm256_set1_pd(1.0);
+ /// let four_floats = _mm256_set_pd(1.0, 2.0, 3.0, 4.0);
+ /// # }
+ /// # if is_x86_feature_detected!("avx") { unsafe { foo() } }
+ /// # }
+ /// ```
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub struct __m256d(f64, f64, f64, f64);
+
+ /// 512-bit wide integer vector type, x86-specific
+ ///
+ /// This type is the same as the `__m512i` type defined by Intel,
+ /// representing a 512-bit SIMD register. Usage of this type typically
+ /// corresponds to the `avx512*` and up target features for x86/x86_64.
+ ///
+ /// Internally this type may be viewed as:
+ ///
+ /// * `i8x64` - sixty-four `i8` variables packed together
+ /// * `i16x32` - thirty-two `i16` variables packed together
+ /// * `i32x16` - sixteen `i32` variables packed together
+ /// * `i64x8` - eight `i64` variables packed together
+ ///
+ /// (as well as unsigned versions). Each intrinsic may interpret the
+ /// internal bits differently, check the documentation of the intrinsic
+ /// to see how it's being used.
+ ///
+ /// Note that this means that an instance of `__m512i` typically just means
+ /// a "bag of bits" which is left up to interpretation at the point of use.
+ pub struct __m512i(i64, i64, i64, i64, i64, i64, i64, i64);
+
+ /// 512-bit wide set of sixteen `f32` types, x86-specific
+ ///
+ /// This type is the same as the `__m512` type defined by Intel,
+ /// representing a 512-bit SIMD register which internally is consisted of
+ /// eight packed `f32` instances. Usage of this type typically corresponds
+ /// to the `avx512*` and up target features for x86/x86_64.
+ ///
+ /// Note that unlike `__m512i`, the integer version of the 512-bit
+ /// registers, this `__m512` type has *one* interpretation. Each instance
+ /// of `__m512` always corresponds to `f32x16`, or sixteen `f32` types
+ /// packed together.
+ ///
+ /// Most intrinsics using `__m512` are prefixed with `_mm512_` and are
+ /// suffixed with "ps" (or otherwise contain "ps"). Not to be confused with
+ /// "pd" which is used for `__m512d`.
+ pub struct __m512(
+ f32, f32, f32, f32, f32, f32, f32, f32,
+ f32, f32, f32, f32, f32, f32, f32, f32,
+ );
+
+ /// 512-bit wide set of eight `f64` types, x86-specific
+ ///
+ /// This type is the same as the `__m512d` type defined by Intel,
+ /// representing a 512-bit SIMD register which internally is consisted of
+ /// eight packed `f64` instances. Usage of this type typically corresponds
+ /// to the `avx` and up target features for x86/x86_64.
+ ///
+ /// Note that unlike `__m512i`, the integer version of the 512-bit
+ /// registers, this `__m512d` type has *one* interpretation. Each instance
+ /// of `__m512d` always corresponds to `f64x4`, or eight `f64` types packed
+ /// together.
+ ///
+ /// Most intrinsics using `__m512d` are prefixed with `_mm512_` and are
+ /// suffixed with "pd" (or otherwise contain "pd"). Not to be confused with
+ /// "ps" which is used for `__m512`.
+ pub struct __m512d(f64, f64, f64, f64, f64, f64, f64, f64);
+
+ /// 128-bit wide set of eight 'u16' types, x86-specific
+ ///
+ /// This type is representing a 128-bit SIMD register which internally is consisted of
+ /// eight packed `u16` instances. Its purpose is for bf16 related intrinsic
+ /// implementations.
+ pub struct __m128bh(u16, u16, u16, u16, u16, u16, u16, u16);
+
+ /// 256-bit wide set of 16 'u16' types, x86-specific
+ ///
+ /// This type is the same as the `__m128bh` type defined by Intel,
+ /// representing a 256-bit SIMD register which internally is consisted of
+ /// 16 packed `u16` instances. Its purpose is for bf16 related intrinsic
+ /// implementations.
+ pub struct __m256bh(
+ u16, u16, u16, u16, u16, u16, u16, u16,
+ u16, u16, u16, u16, u16, u16, u16, u16
+ );
+
+ /// 512-bit wide set of 32 'u16' types, x86-specific
+ ///
+ /// This type is the same as the `__m128bh` type defined by Intel,
+ /// representing a 512-bit SIMD register which internally is consisted of
+ /// 32 packed `u16` instances. Its purpose is for bf16 related intrinsic
+ /// implementations.
+ pub struct __m512bh(
+ u16, u16, u16, u16, u16, u16, u16, u16,
+ u16, u16, u16, u16, u16, u16, u16, u16,
+ u16, u16, u16, u16, u16, u16, u16, u16,
+ u16, u16, u16, u16, u16, u16, u16, u16
+ );
+}
+
+/// The `__mmask64` type used in AVX-512 intrinsics, a 64-bit integer
+#[allow(non_camel_case_types)]
+pub type __mmask64 = u64;
+
+/// The `__mmask32` type used in AVX-512 intrinsics, a 32-bit integer
+#[allow(non_camel_case_types)]
+pub type __mmask32 = u32;
+
+/// The `__mmask16` type used in AVX-512 intrinsics, a 16-bit integer
+#[allow(non_camel_case_types)]
+pub type __mmask16 = u16;
+
+/// The `__mmask8` type used in AVX-512 intrinsics, a 8-bit integer
+#[allow(non_camel_case_types)]
+pub type __mmask8 = u8;
+
+/// The `_MM_CMPINT_ENUM` type used to specify comparison operations in AVX-512 intrinsics.
+#[allow(non_camel_case_types)]
+pub type _MM_CMPINT_ENUM = i32;
+
+/// The `MM_MANTISSA_NORM_ENUM` type used to specify mantissa normalized operations in AVX-512 intrinsics.
+#[allow(non_camel_case_types)]
+pub type _MM_MANTISSA_NORM_ENUM = i32;
+
+/// The `MM_MANTISSA_SIGN_ENUM` type used to specify mantissa signed operations in AVX-512 intrinsics.
+#[allow(non_camel_case_types)]
+pub type _MM_MANTISSA_SIGN_ENUM = i32;
+
+/// The `MM_PERM_ENUM` type used to specify shuffle operations in AVX-512 intrinsics.
+#[allow(non_camel_case_types)]
+pub type _MM_PERM_ENUM = i32;
+
+#[cfg(test)]
+mod test;
+#[cfg(test)]
+pub use self::test::*;
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m128iExt: Sized {
+ fn as_m128i(self) -> __m128i;
+
+ #[inline]
+ fn as_u8x16(self) -> crate::core_arch::simd::u8x16 {
+ unsafe { transmute(self.as_m128i()) }
+ }
+
+ #[inline]
+ fn as_u16x8(self) -> crate::core_arch::simd::u16x8 {
+ unsafe { transmute(self.as_m128i()) }
+ }
+
+ #[inline]
+ fn as_u32x4(self) -> crate::core_arch::simd::u32x4 {
+ unsafe { transmute(self.as_m128i()) }
+ }
+
+ #[inline]
+ fn as_u64x2(self) -> crate::core_arch::simd::u64x2 {
+ unsafe { transmute(self.as_m128i()) }
+ }
+
+ #[inline]
+ fn as_i8x16(self) -> crate::core_arch::simd::i8x16 {
+ unsafe { transmute(self.as_m128i()) }
+ }
+
+ #[inline]
+ fn as_i16x8(self) -> crate::core_arch::simd::i16x8 {
+ unsafe { transmute(self.as_m128i()) }
+ }
+
+ #[inline]
+ fn as_i32x4(self) -> crate::core_arch::simd::i32x4 {
+ unsafe { transmute(self.as_m128i()) }
+ }
+
+ #[inline]
+ fn as_i64x2(self) -> crate::core_arch::simd::i64x2 {
+ unsafe { transmute(self.as_m128i()) }
+ }
+}
+
+impl m128iExt for __m128i {
+ #[inline]
+ fn as_m128i(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m256iExt: Sized {
+ fn as_m256i(self) -> __m256i;
+
+ #[inline]
+ fn as_u8x32(self) -> crate::core_arch::simd::u8x32 {
+ unsafe { transmute(self.as_m256i()) }
+ }
+
+ #[inline]
+ fn as_u16x16(self) -> crate::core_arch::simd::u16x16 {
+ unsafe { transmute(self.as_m256i()) }
+ }
+
+ #[inline]
+ fn as_u32x8(self) -> crate::core_arch::simd::u32x8 {
+ unsafe { transmute(self.as_m256i()) }
+ }
+
+ #[inline]
+ fn as_u64x4(self) -> crate::core_arch::simd::u64x4 {
+ unsafe { transmute(self.as_m256i()) }
+ }
+
+ #[inline]
+ fn as_i8x32(self) -> crate::core_arch::simd::i8x32 {
+ unsafe { transmute(self.as_m256i()) }
+ }
+
+ #[inline]
+ fn as_i16x16(self) -> crate::core_arch::simd::i16x16 {
+ unsafe { transmute(self.as_m256i()) }
+ }
+
+ #[inline]
+ fn as_i32x8(self) -> crate::core_arch::simd::i32x8 {
+ unsafe { transmute(self.as_m256i()) }
+ }
+
+ #[inline]
+ fn as_i64x4(self) -> crate::core_arch::simd::i64x4 {
+ unsafe { transmute(self.as_m256i()) }
+ }
+}
+
+impl m256iExt for __m256i {
+ #[inline]
+ fn as_m256i(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m128Ext: Sized {
+ fn as_m128(self) -> __m128;
+
+ #[inline]
+ fn as_f32x4(self) -> crate::core_arch::simd::f32x4 {
+ unsafe { transmute(self.as_m128()) }
+ }
+}
+
+impl m128Ext for __m128 {
+ #[inline]
+ fn as_m128(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m128dExt: Sized {
+ fn as_m128d(self) -> __m128d;
+
+ #[inline]
+ fn as_f64x2(self) -> crate::core_arch::simd::f64x2 {
+ unsafe { transmute(self.as_m128d()) }
+ }
+}
+
+impl m128dExt for __m128d {
+ #[inline]
+ fn as_m128d(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m256Ext: Sized {
+ fn as_m256(self) -> __m256;
+
+ #[inline]
+ fn as_f32x8(self) -> crate::core_arch::simd::f32x8 {
+ unsafe { transmute(self.as_m256()) }
+ }
+}
+
+impl m256Ext for __m256 {
+ #[inline]
+ fn as_m256(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m256dExt: Sized {
+ fn as_m256d(self) -> __m256d;
+
+ #[inline]
+ fn as_f64x4(self) -> crate::core_arch::simd::f64x4 {
+ unsafe { transmute(self.as_m256d()) }
+ }
+}
+
+impl m256dExt for __m256d {
+ #[inline]
+ fn as_m256d(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m512iExt: Sized {
+ fn as_m512i(self) -> __m512i;
+
+ #[inline]
+ fn as_u8x64(self) -> crate::core_arch::simd::u8x64 {
+ unsafe { transmute(self.as_m512i()) }
+ }
+
+ #[inline]
+ fn as_i8x64(self) -> crate::core_arch::simd::i8x64 {
+ unsafe { transmute(self.as_m512i()) }
+ }
+
+ #[inline]
+ fn as_u16x32(self) -> crate::core_arch::simd::u16x32 {
+ unsafe { transmute(self.as_m512i()) }
+ }
+
+ #[inline]
+ fn as_i16x32(self) -> crate::core_arch::simd::i16x32 {
+ unsafe { transmute(self.as_m512i()) }
+ }
+
+ #[inline]
+ fn as_u32x16(self) -> crate::core_arch::simd::u32x16 {
+ unsafe { transmute(self.as_m512i()) }
+ }
+
+ #[inline]
+ fn as_i32x16(self) -> crate::core_arch::simd::i32x16 {
+ unsafe { transmute(self.as_m512i()) }
+ }
+
+ #[inline]
+ fn as_u64x8(self) -> crate::core_arch::simd::u64x8 {
+ unsafe { transmute(self.as_m512i()) }
+ }
+
+ #[inline]
+ fn as_i64x8(self) -> crate::core_arch::simd::i64x8 {
+ unsafe { transmute(self.as_m512i()) }
+ }
+}
+
+impl m512iExt for __m512i {
+ #[inline]
+ fn as_m512i(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m512Ext: Sized {
+ fn as_m512(self) -> __m512;
+
+ #[inline]
+ fn as_f32x16(self) -> crate::core_arch::simd::f32x16 {
+ unsafe { transmute(self.as_m512()) }
+ }
+}
+
+impl m512Ext for __m512 {
+ #[inline]
+ fn as_m512(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m512dExt: Sized {
+ fn as_m512d(self) -> __m512d;
+
+ #[inline]
+ fn as_f64x8(self) -> crate::core_arch::simd::f64x8 {
+ unsafe { transmute(self.as_m512d()) }
+ }
+}
+
+impl m512dExt for __m512d {
+ #[inline]
+ fn as_m512d(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m128bhExt: Sized {
+ fn as_m128bh(self) -> __m128bh;
+
+ #[inline]
+ fn as_u16x8(self) -> crate::core_arch::simd::u16x8 {
+ unsafe { transmute(self.as_m128bh()) }
+ }
+
+ #[inline]
+ fn as_i16x8(self) -> crate::core_arch::simd::i16x8 {
+ unsafe { transmute(self.as_m128bh()) }
+ }
+
+ #[inline]
+ fn as_u32x4(self) -> crate::core_arch::simd::u32x4 {
+ unsafe { transmute(self.as_m128bh()) }
+ }
+
+ #[inline]
+ fn as_i32x4(self) -> crate::core_arch::simd::i32x4 {
+ unsafe { transmute(self.as_m128bh()) }
+ }
+}
+
+impl m128bhExt for __m128bh {
+ #[inline]
+ fn as_m128bh(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m256bhExt: Sized {
+ fn as_m256bh(self) -> __m256bh;
+
+ #[inline]
+ fn as_u16x16(self) -> crate::core_arch::simd::u16x16 {
+ unsafe { transmute(self.as_m256bh()) }
+ }
+
+ #[inline]
+ fn as_i16x16(self) -> crate::core_arch::simd::i16x16 {
+ unsafe { transmute(self.as_m256bh()) }
+ }
+
+ #[inline]
+ fn as_u32x8(self) -> crate::core_arch::simd::u32x8 {
+ unsafe { transmute(self.as_m256bh()) }
+ }
+
+ #[inline]
+ fn as_i32x8(self) -> crate::core_arch::simd::i32x8 {
+ unsafe { transmute(self.as_m256bh()) }
+ }
+}
+
+impl m256bhExt for __m256bh {
+ #[inline]
+ fn as_m256bh(self) -> Self {
+ self
+ }
+}
+
+#[allow(non_camel_case_types)]
+#[unstable(feature = "stdsimd_internal", issue = "none")]
+pub(crate) trait m512bhExt: Sized {
+ fn as_m512bh(self) -> __m512bh;
+
+ #[inline]
+ fn as_u16x32(self) -> crate::core_arch::simd::u16x32 {
+ unsafe { transmute(self.as_m512bh()) }
+ }
+
+ #[inline]
+ fn as_i16x32(self) -> crate::core_arch::simd::i16x32 {
+ unsafe { transmute(self.as_m512bh()) }
+ }
+
+ #[inline]
+ fn as_u32x16(self) -> crate::core_arch::simd::u32x16 {
+ unsafe { transmute(self.as_m512bh()) }
+ }
+
+ #[inline]
+ fn as_i32x16(self) -> crate::core_arch::simd::i32x16 {
+ unsafe { transmute(self.as_m512bh()) }
+ }
+}
+
+impl m512bhExt for __m512bh {
+ #[inline]
+ fn as_m512bh(self) -> Self {
+ self
+ }
+}
+
+mod eflags;
+pub use self::eflags::*;
+
+mod fxsr;
+pub use self::fxsr::*;
+
+mod bswap;
+pub use self::bswap::*;
+
+mod rdtsc;
+pub use self::rdtsc::*;
+
+mod cpuid;
+pub use self::cpuid::*;
+mod xsave;
+pub use self::xsave::*;
+
+mod sse;
+pub use self::sse::*;
+mod sse2;
+pub use self::sse2::*;
+mod sse3;
+pub use self::sse3::*;
+mod ssse3;
+pub use self::ssse3::*;
+mod sse41;
+pub use self::sse41::*;
+mod sse42;
+pub use self::sse42::*;
+mod avx;
+pub use self::avx::*;
+mod avx2;
+pub use self::avx2::*;
+mod fma;
+pub use self::fma::*;
+
+mod abm;
+pub use self::abm::*;
+mod bmi1;
+pub use self::bmi1::*;
+
+mod bmi2;
+pub use self::bmi2::*;
+
+#[cfg(not(stdarch_intel_sde))]
+mod sse4a;
+#[cfg(not(stdarch_intel_sde))]
+pub use self::sse4a::*;
+
+#[cfg(not(stdarch_intel_sde))]
+mod tbm;
+#[cfg(not(stdarch_intel_sde))]
+pub use self::tbm::*;
+
+mod pclmulqdq;
+pub use self::pclmulqdq::*;
+
+mod aes;
+pub use self::aes::*;
+
+mod rdrand;
+pub use self::rdrand::*;
+
+mod sha;
+pub use self::sha::*;
+
+mod adx;
+pub use self::adx::*;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Generates the trap instruction `UD2`
+#[cfg_attr(test, assert_instr(ud2))]
+#[inline]
+pub unsafe fn ud2() -> ! {
+ intrinsics::abort()
+}
+
+mod avx512f;
+pub use self::avx512f::*;
+
+mod avx512bw;
+pub use self::avx512bw::*;
+
+mod avx512cd;
+pub use self::avx512cd::*;
+
+mod avx512ifma;
+pub use self::avx512ifma::*;
+
+mod avx512vbmi;
+pub use self::avx512vbmi::*;
+
+mod avx512vbmi2;
+pub use self::avx512vbmi2::*;
+
+mod avx512vnni;
+pub use self::avx512vnni::*;
+
+mod avx512bitalg;
+pub use self::avx512bitalg::*;
+
+mod avx512gfni;
+pub use self::avx512gfni::*;
+
+mod avx512vpopcntdq;
+pub use self::avx512vpopcntdq::*;
+
+mod avx512vaes;
+pub use self::avx512vaes::*;
+
+mod avx512vpclmulqdq;
+pub use self::avx512vpclmulqdq::*;
+
+mod bt;
+pub use self::bt::*;
+
+mod rtm;
+pub use self::rtm::*;
+
+mod f16c;
+pub use self::f16c::*;
+
+mod avx512bf16;
+pub use self::avx512bf16::*;
diff --git a/library/stdarch/crates/core_arch/src/x86/pclmulqdq.rs b/library/stdarch/crates/core_arch/src/x86/pclmulqdq.rs
new file mode 100644
index 000000000..a2ebdf9c8
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/pclmulqdq.rs
@@ -0,0 +1,70 @@
+//! Carry-less Multiplication (CLMUL)
+//!
+//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
+//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref] (p. 4-241).
+//!
+//! [intel64_ref]: http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+
+use crate::core_arch::x86::__m128i;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.pclmulqdq"]
+ fn pclmulqdq(a: __m128i, round_key: __m128i, imm8: u8) -> __m128i;
+}
+
+/// Performs a carry-less multiplication of two 64-bit polynomials over the
+/// finite field GF(2^k).
+///
+/// The immediate byte is used for determining which halves of `a` and `b`
+/// should be used. Immediate bits other than 0 and 4 are ignored.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_clmulepi64_si128)
+#[inline]
+#[target_feature(enable = "pclmulqdq")]
+#[cfg_attr(all(test, not(target_os = "linux")), assert_instr(pclmulqdq, IMM8 = 0))]
+#[cfg_attr(all(test, target_os = "linux"), assert_instr(pclmullqlqdq, IMM8 = 0))]
+#[cfg_attr(all(test, target_os = "linux"), assert_instr(pclmulhqlqdq, IMM8 = 1))]
+#[cfg_attr(all(test, target_os = "linux"), assert_instr(pclmullqhqdq, IMM8 = 16))]
+#[cfg_attr(all(test, target_os = "linux"), assert_instr(pclmulhqhqdq, IMM8 = 17))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_clmulepi64_si128<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ pclmulqdq(a, b, IMM8 as u8)
+}
+
+#[cfg(test)]
+mod tests {
+ // The constants in the tests below are just bit patterns. They should not
+ // be interpreted as integers; signedness does not make sense for them, but
+ // __m128i happens to be defined in terms of signed integers.
+ #![allow(overflowing_literals)]
+
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "pclmulqdq")]
+ unsafe fn test_mm_clmulepi64_si128() {
+ // Constants taken from https://software.intel.com/sites/default/files/managed/72/cc/clmul-wp-rev-2.02-2014-04-20.pdf
+ let a = _mm_set_epi64x(0x7b5b546573745665, 0x63746f725d53475d);
+ let b = _mm_set_epi64x(0x4869285368617929, 0x5b477565726f6e5d);
+ let r00 = _mm_set_epi64x(0x1d4d84c85c3440c0, 0x929633d5d36f0451);
+ let r01 = _mm_set_epi64x(0x1bd17c8d556ab5a1, 0x7fa540ac2a281315);
+ let r10 = _mm_set_epi64x(0x1a2bf6db3a30862f, 0xbabf262df4b7d5c9);
+ let r11 = _mm_set_epi64x(0x1d1e1f2c592e7c45, 0xd66ee03e410fd4ed);
+
+ assert_eq_m128i(_mm_clmulepi64_si128::<0x00>(a, b), r00);
+ assert_eq_m128i(_mm_clmulepi64_si128::<0x10>(a, b), r01);
+ assert_eq_m128i(_mm_clmulepi64_si128::<0x01>(a, b), r10);
+ assert_eq_m128i(_mm_clmulepi64_si128::<0x11>(a, b), r11);
+
+ let a0 = _mm_set_epi64x(0x0000000000000000, 0x8000000000000000);
+ let r = _mm_set_epi64x(0x4000000000000000, 0x0000000000000000);
+ assert_eq_m128i(_mm_clmulepi64_si128::<0x00>(a0, a0), r);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/rdrand.rs b/library/stdarch/crates/core_arch/src/x86/rdrand.rs
new file mode 100644
index 000000000..c6bab9148
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/rdrand.rs
@@ -0,0 +1,75 @@
+//! RDRAND and RDSEED instructions for returning random numbers from an Intel
+//! on-chip hardware random number generator which has been seeded by an
+//! on-chip entropy source.
+#![allow(clippy::module_name_repetitions)]
+
+#[allow(improper_ctypes)]
+extern "unadjusted" {
+ #[link_name = "llvm.x86.rdrand.16"]
+ fn x86_rdrand16_step() -> (u16, i32);
+ #[link_name = "llvm.x86.rdrand.32"]
+ fn x86_rdrand32_step() -> (u32, i32);
+ #[link_name = "llvm.x86.rdseed.16"]
+ fn x86_rdseed16_step() -> (u16, i32);
+ #[link_name = "llvm.x86.rdseed.32"]
+ fn x86_rdseed32_step() -> (u32, i32);
+}
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Read a hardware generated 16-bit random value and store the result in val.
+/// Returns 1 if a random value was generated, and 0 otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rdrand16_step)
+#[inline]
+#[target_feature(enable = "rdrand")]
+#[cfg_attr(test, assert_instr(rdrand))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _rdrand16_step(val: &mut u16) -> i32 {
+ let (v, flag) = x86_rdrand16_step();
+ *val = v;
+ flag
+}
+
+/// Read a hardware generated 32-bit random value and store the result in val.
+/// Returns 1 if a random value was generated, and 0 otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rdrand32_step)
+#[inline]
+#[target_feature(enable = "rdrand")]
+#[cfg_attr(test, assert_instr(rdrand))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _rdrand32_step(val: &mut u32) -> i32 {
+ let (v, flag) = x86_rdrand32_step();
+ *val = v;
+ flag
+}
+
+/// Read a 16-bit NIST SP800-90B and SP800-90C compliant random value and store
+/// in val. Return 1 if a random value was generated, and 0 otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rdseed16_step)
+#[inline]
+#[target_feature(enable = "rdseed")]
+#[cfg_attr(test, assert_instr(rdseed))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _rdseed16_step(val: &mut u16) -> i32 {
+ let (v, flag) = x86_rdseed16_step();
+ *val = v;
+ flag
+}
+
+/// Read a 32-bit NIST SP800-90B and SP800-90C compliant random value and store
+/// in val. Return 1 if a random value was generated, and 0 otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rdseed32_step)
+#[inline]
+#[target_feature(enable = "rdseed")]
+#[cfg_attr(test, assert_instr(rdseed))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _rdseed32_step(val: &mut u32) -> i32 {
+ let (v, flag) = x86_rdseed32_step();
+ *val = v;
+ flag
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/rdtsc.rs b/library/stdarch/crates/core_arch/src/x86/rdtsc.rs
new file mode 100644
index 000000000..67f6e48fa
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/rdtsc.rs
@@ -0,0 +1,77 @@
+//! RDTSC instructions.
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Reads the current value of the processor’s time-stamp counter.
+///
+/// The processor monotonically increments the time-stamp counter MSR
+/// every clock cycle and resets it to 0 whenever the processor is
+/// reset.
+///
+/// The RDTSC instruction is not a serializing instruction. It does
+/// not necessarily wait until all previous instructions have been
+/// executed before reading the counter. Similarly, subsequent
+/// instructions may begin execution before the read operation is
+/// performed.
+///
+/// On processors that support the Intel 64 architecture, the
+/// high-order 32 bits of each of RAX and RDX are cleared.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rdtsc)
+#[inline]
+#[cfg_attr(test, assert_instr(rdtsc))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _rdtsc() -> u64 {
+ rdtsc()
+}
+
+/// Reads the current value of the processor’s time-stamp counter and
+/// the `IA32_TSC_AUX MSR`.
+///
+/// The processor monotonically increments the time-stamp counter MSR
+/// every clock cycle and resets it to 0 whenever the processor is
+/// reset.
+///
+/// The RDTSCP instruction waits until all previous instructions have
+/// been executed before reading the counter. However, subsequent
+/// instructions may begin execution before the read operation is
+/// performed.
+///
+/// On processors that support the Intel 64 architecture, the
+/// high-order 32 bits of each of RAX, RDX, and RCX are cleared.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=__rdtscp)
+#[inline]
+#[cfg_attr(test, assert_instr(rdtscp))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn __rdtscp(aux: *mut u32) -> u64 {
+ rdtscp(aux as *mut _)
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.rdtsc"]
+ fn rdtsc() -> u64;
+ #[link_name = "llvm.x86.rdtscp"]
+ fn rdtscp(aux: *mut u8) -> u64;
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::x86::*;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn _rdtsc() {
+ let r = rdtsc::_rdtsc();
+ assert_ne!(r, 0); // The chances of this being 0 are infinitesimal
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn _rdtscp() {
+ let mut aux = 0;
+ let r = rdtsc::__rdtscp(&mut aux);
+ assert_ne!(r, 0); // The chances of this being 0 are infinitesimal
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/rtm.rs b/library/stdarch/crates/core_arch/src/x86/rtm.rs
new file mode 100644
index 000000000..dab73cde9
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/rtm.rs
@@ -0,0 +1,162 @@
+//! Intel's Restricted Transactional Memory (RTM).
+//!
+//! This CPU feature is available on Intel Broadwell or later CPUs (and some Haswell).
+//!
+//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
+//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref].
+//!
+//! [Wikipedia][wikipedia_rtm] provides a quick overview of the assembly instructions, and
+//! Intel's [programming considerations][intel_consid] details what sorts of instructions within a
+//! transaction are likely to cause an abort.
+//!
+//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
+//! [wikipedia_rtm]: https://en.wikipedia.org/wiki/Transactional_Synchronization_Extensions#Restricted_Transactional_Memory
+//! [intel_consid]: https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-intel-transactional-synchronization-extensions-intel-tsx-programming-considerations
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+extern "C" {
+ #[link_name = "llvm.x86.xbegin"]
+ fn x86_xbegin() -> i32;
+ #[link_name = "llvm.x86.xend"]
+ fn x86_xend();
+ #[link_name = "llvm.x86.xabort"]
+ fn x86_xabort(imm8: i8);
+ #[link_name = "llvm.x86.xtest"]
+ fn x86_xtest() -> i32;
+}
+
+/// Transaction successfully started.
+pub const _XBEGIN_STARTED: u32 = !0;
+
+/// Transaction explicitly aborted with xabort. The parameter passed to xabort is available with
+/// `_xabort_code(status)`.
+#[allow(clippy::identity_op)]
+pub const _XABORT_EXPLICIT: u32 = 1 << 0;
+
+/// Transaction retry is possible.
+pub const _XABORT_RETRY: u32 = 1 << 1;
+
+/// Transaction abort due to a memory conflict with another thread.
+pub const _XABORT_CONFLICT: u32 = 1 << 2;
+
+/// Transaction abort due to the transaction using too much memory.
+pub const _XABORT_CAPACITY: u32 = 1 << 3;
+
+/// Transaction abort due to a debug trap.
+pub const _XABORT_DEBUG: u32 = 1 << 4;
+
+/// Transaction abort in a inner nested transaction.
+pub const _XABORT_NESTED: u32 = 1 << 5;
+
+/// Specifies the start of a restricted transactional memory (RTM) code region and returns a value
+/// indicating status.
+///
+/// [Intel's documentation](https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-xbegin).
+#[inline]
+#[target_feature(enable = "rtm")]
+#[cfg_attr(test, assert_instr(xbegin))]
+pub unsafe fn _xbegin() -> u32 {
+ x86_xbegin() as _
+}
+
+/// Specifies the end of a restricted transactional memory (RTM) code region.
+///
+/// [Intel's documentation](https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-xend).
+#[inline]
+#[target_feature(enable = "rtm")]
+#[cfg_attr(test, assert_instr(xend))]
+pub unsafe fn _xend() {
+ x86_xend()
+}
+
+/// Forces a restricted transactional memory (RTM) region to abort.
+///
+/// [Intel's documentation](https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-xabort).
+#[inline]
+#[target_feature(enable = "rtm")]
+#[cfg_attr(test, assert_instr(xabort, IMM8 = 0x0))]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn _xabort<const IMM8: u32>() {
+ static_assert_imm_u8!(IMM8);
+ x86_xabort(IMM8 as i8)
+}
+
+/// Queries whether the processor is executing in a transactional region identified by restricted
+/// transactional memory (RTM) or hardware lock elision (HLE).
+///
+/// [Intel's documentation](https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-xtest).
+#[inline]
+#[target_feature(enable = "rtm")]
+#[cfg_attr(test, assert_instr(xtest))]
+pub unsafe fn _xtest() -> u8 {
+ x86_xtest() as _
+}
+
+/// Retrieves the parameter passed to [`_xabort`] when [`_xbegin`]'s status has the
+/// `_XABORT_EXPLICIT` flag set.
+#[inline]
+pub const fn _xabort_code(status: u32) -> u32 {
+ (status >> 24) & 0xFF
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "rtm")]
+ unsafe fn test_xbegin_xend() {
+ let mut x = 0;
+ for _ in 0..10 {
+ let code = rtm::_xbegin();
+ if code == _XBEGIN_STARTED {
+ x += 1;
+ rtm::_xend();
+ assert_eq!(x, 1);
+ break;
+ }
+ assert_eq!(x, 0);
+ }
+ }
+
+ #[simd_test(enable = "rtm")]
+ unsafe fn test_xabort() {
+ const ABORT_CODE: u32 = 42;
+ // aborting outside a transactional region does nothing
+ _xabort::<ABORT_CODE>();
+
+ for _ in 0..10 {
+ let mut x = 0;
+ let code = rtm::_xbegin();
+ if code == _XBEGIN_STARTED {
+ x += 1;
+ rtm::_xabort::<ABORT_CODE>();
+ } else if code & _XABORT_EXPLICIT != 0 {
+ let test_abort_code = rtm::_xabort_code(code);
+ assert_eq!(test_abort_code, ABORT_CODE);
+ }
+ assert_eq!(x, 0);
+ }
+ }
+
+ #[simd_test(enable = "rtm")]
+ unsafe fn test_xtest() {
+ assert_eq!(_xtest(), 0);
+
+ for _ in 0..10 {
+ let code = rtm::_xbegin();
+ if code == _XBEGIN_STARTED {
+ let in_tx = _xtest();
+ rtm::_xend();
+
+ // putting the assert inside the transaction would abort the transaction on fail
+ // without any output/panic/etc
+ assert_eq!(in_tx, 1);
+ break;
+ }
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/sha.rs b/library/stdarch/crates/core_arch/src/x86/sha.rs
new file mode 100644
index 000000000..cfb330cfb
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/sha.rs
@@ -0,0 +1,221 @@
+use crate::{
+ core_arch::{simd::*, x86::*},
+ mem::transmute,
+};
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.sha1msg1"]
+ fn sha1msg1(a: i32x4, b: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.sha1msg2"]
+ fn sha1msg2(a: i32x4, b: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.sha1nexte"]
+ fn sha1nexte(a: i32x4, b: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.sha1rnds4"]
+ fn sha1rnds4(a: i32x4, b: i32x4, c: i8) -> i32x4;
+ #[link_name = "llvm.x86.sha256msg1"]
+ fn sha256msg1(a: i32x4, b: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.sha256msg2"]
+ fn sha256msg2(a: i32x4, b: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.sha256rnds2"]
+ fn sha256rnds2(a: i32x4, b: i32x4, k: i32x4) -> i32x4;
+}
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Performs an intermediate calculation for the next four SHA1 message values
+/// (unsigned 32-bit integers) using previous message values from `a` and `b`,
+/// and returning the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sha1msg1_epu32)
+#[inline]
+#[target_feature(enable = "sha")]
+#[cfg_attr(test, assert_instr(sha1msg1))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sha1msg1_epu32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(sha1msg1(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Performs the final calculation for the next four SHA1 message values
+/// (unsigned 32-bit integers) using the intermediate result in `a` and the
+/// previous message values in `b`, and returns the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sha1msg2_epu32)
+#[inline]
+#[target_feature(enable = "sha")]
+#[cfg_attr(test, assert_instr(sha1msg2))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sha1msg2_epu32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(sha1msg2(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Calculate SHA1 state variable E after four rounds of operation from the
+/// current SHA1 state variable `a`, add that value to the scheduled values
+/// (unsigned 32-bit integers) in `b`, and returns the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sha1nexte_epu32)
+#[inline]
+#[target_feature(enable = "sha")]
+#[cfg_attr(test, assert_instr(sha1nexte))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sha1nexte_epu32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(sha1nexte(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Performs four rounds of SHA1 operation using an initial SHA1 state (A,B,C,D)
+/// from `a` and some pre-computed sum of the next 4 round message values
+/// (unsigned 32-bit integers), and state variable E from `b`, and return the
+/// updated SHA1 state (A,B,C,D). `FUNC` contains the logic functions and round
+/// constants.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sha1rnds4_epu32)
+#[inline]
+#[target_feature(enable = "sha")]
+#[cfg_attr(test, assert_instr(sha1rnds4, FUNC = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sha1rnds4_epu32<const FUNC: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm2!(FUNC);
+ transmute(sha1rnds4(a.as_i32x4(), b.as_i32x4(), FUNC as i8))
+}
+
+/// Performs an intermediate calculation for the next four SHA256 message values
+/// (unsigned 32-bit integers) using previous message values from `a` and `b`,
+/// and return the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sha256msg1_epu32)
+#[inline]
+#[target_feature(enable = "sha")]
+#[cfg_attr(test, assert_instr(sha256msg1))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sha256msg1_epu32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(sha256msg1(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Performs the final calculation for the next four SHA256 message values
+/// (unsigned 32-bit integers) using previous message values from `a` and `b`,
+/// and return the result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sha256msg2_epu32)
+#[inline]
+#[target_feature(enable = "sha")]
+#[cfg_attr(test, assert_instr(sha256msg2))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sha256msg2_epu32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(sha256msg2(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Performs 2 rounds of SHA256 operation using an initial SHA256 state
+/// (C,D,G,H) from `a`, an initial SHA256 state (A,B,E,F) from `b`, and a
+/// pre-computed sum of the next 2 round message values (unsigned 32-bit
+/// integers) and the corresponding round constants from `k`, and store the
+/// updated SHA256 state (A,B,E,F) in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sha256rnds2_epu32)
+#[inline]
+#[target_feature(enable = "sha")]
+#[cfg_attr(test, assert_instr(sha256rnds2))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sha256rnds2_epu32(a: __m128i, b: __m128i, k: __m128i) -> __m128i {
+ transmute(sha256rnds2(a.as_i32x4(), b.as_i32x4(), k.as_i32x4()))
+}
+
+#[cfg(test)]
+mod tests {
+ use std::{
+ f32,
+ f64::{self, NAN},
+ i32,
+ mem::{self, transmute},
+ };
+
+ use crate::{
+ core_arch::{simd::*, x86::*},
+ hint::black_box,
+ };
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "sha")]
+ #[allow(overflowing_literals)]
+ unsafe fn test_mm_sha1msg1_epu32() {
+ let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98);
+ let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b);
+ let expected = _mm_set_epi64x(0x98829f34f74ad457, 0xda2b1a44d0b5ad3c);
+ let r = _mm_sha1msg1_epu32(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "sha")]
+ #[allow(overflowing_literals)]
+ unsafe fn test_mm_sha1msg2_epu32() {
+ let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98);
+ let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b);
+ let expected = _mm_set_epi64x(0xf714b202d863d47d, 0x90c30d946b3d3b35);
+ let r = _mm_sha1msg2_epu32(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "sha")]
+ #[allow(overflowing_literals)]
+ unsafe fn test_mm_sha1nexte_epu32() {
+ let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98);
+ let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b);
+ let expected = _mm_set_epi64x(0x2589d5be923f82a4, 0x59f111f13956c25b);
+ let r = _mm_sha1nexte_epu32(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "sha")]
+ #[allow(overflowing_literals)]
+ unsafe fn test_mm_sha1rnds4_epu32() {
+ let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98);
+ let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b);
+ let expected = _mm_set_epi64x(0x32b13cd8322f5268, 0xc54420862bd9246f);
+ let r = _mm_sha1rnds4_epu32::<0>(a, b);
+ assert_eq_m128i(r, expected);
+
+ let expected = _mm_set_epi64x(0x6d4c43e56a3c25d9, 0xa7e00fb775cbd3fe);
+ let r = _mm_sha1rnds4_epu32::<1>(a, b);
+ assert_eq_m128i(r, expected);
+
+ let expected = _mm_set_epi64x(0xb304e383c01222f4, 0x66f6b3b1f89d8001);
+ let r = _mm_sha1rnds4_epu32::<2>(a, b);
+ assert_eq_m128i(r, expected);
+
+ let expected = _mm_set_epi64x(0x8189b758bfabfa79, 0xdb08f6e78cae098b);
+ let r = _mm_sha1rnds4_epu32::<3>(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "sha")]
+ #[allow(overflowing_literals)]
+ unsafe fn test_mm_sha256msg1_epu32() {
+ let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98);
+ let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b);
+ let expected = _mm_set_epi64x(0xeb84973fd5cda67d, 0x2857b88f406b09ee);
+ let r = _mm_sha256msg1_epu32(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "sha")]
+ #[allow(overflowing_literals)]
+ unsafe fn test_mm_sha256msg2_epu32() {
+ let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98);
+ let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b);
+ let expected = _mm_set_epi64x(0xb58777ce887fd851, 0x15d1ec8b73ac8450);
+ let r = _mm_sha256msg2_epu32(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "sha")]
+ #[allow(overflowing_literals)]
+ unsafe fn test_mm_sha256rnds2_epu32() {
+ let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98);
+ let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b);
+ let k = _mm_set_epi64x(0, 0x12835b01d807aa98);
+ let expected = _mm_set_epi64x(0xd3063037effb15ea, 0x187ee3db0d6d1d19);
+ let r = _mm_sha256rnds2_epu32(a, b, k);
+ assert_eq_m128i(r, expected);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/sse.rs b/library/stdarch/crates/core_arch/src/x86/sse.rs
new file mode 100644
index 000000000..2c4295ef6
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/sse.rs
@@ -0,0 +1,3276 @@
+//! Streaming SIMD Extensions (SSE)
+
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ intrinsics, mem, ptr,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Adds the first component of `a` and `b`, the other components are copied
+/// from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_add_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(addss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_add_ss(a: __m128, b: __m128) -> __m128 {
+ addss(a, b)
+}
+
+/// Adds __m128 vectors.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_add_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(addps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_add_ps(a: __m128, b: __m128) -> __m128 {
+ simd_add(a, b)
+}
+
+/// Subtracts the first component of `b` from `a`, the other components are
+/// copied from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sub_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(subss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sub_ss(a: __m128, b: __m128) -> __m128 {
+ subss(a, b)
+}
+
+/// Subtracts __m128 vectors.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sub_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(subps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sub_ps(a: __m128, b: __m128) -> __m128 {
+ simd_sub(a, b)
+}
+
+/// Multiplies the first component of `a` and `b`, the other components are
+/// copied from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mul_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(mulss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mul_ss(a: __m128, b: __m128) -> __m128 {
+ mulss(a, b)
+}
+
+/// Multiplies __m128 vectors.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mul_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(mulps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mul_ps(a: __m128, b: __m128) -> __m128 {
+ simd_mul(a, b)
+}
+
+/// Divides the first component of `b` by `a`, the other components are
+/// copied from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_div_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(divss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_div_ss(a: __m128, b: __m128) -> __m128 {
+ divss(a, b)
+}
+
+/// Divides __m128 vectors.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_div_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(divps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_div_ps(a: __m128, b: __m128) -> __m128 {
+ simd_div(a, b)
+}
+
+/// Returns the square root of the first single-precision (32-bit)
+/// floating-point element in `a`, the other elements are unchanged.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sqrt_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(sqrtss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sqrt_ss(a: __m128) -> __m128 {
+ sqrtss(a)
+}
+
+/// Returns the square root of packed single-precision (32-bit) floating-point
+/// elements in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sqrt_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(sqrtps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sqrt_ps(a: __m128) -> __m128 {
+ sqrtps(a)
+}
+
+/// Returns the approximate reciprocal of the first single-precision
+/// (32-bit) floating-point element in `a`, the other elements are unchanged.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rcp_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(rcpss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_rcp_ss(a: __m128) -> __m128 {
+ rcpss(a)
+}
+
+/// Returns the approximate reciprocal of packed single-precision (32-bit)
+/// floating-point elements in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rcp_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(rcpps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_rcp_ps(a: __m128) -> __m128 {
+ rcpps(a)
+}
+
+/// Returns the approximate reciprocal square root of the first single-precision
+/// (32-bit) floating-point element in `a`, the other elements are unchanged.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rsqrt_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(rsqrtss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_rsqrt_ss(a: __m128) -> __m128 {
+ rsqrtss(a)
+}
+
+/// Returns the approximate reciprocal square root of packed single-precision
+/// (32-bit) floating-point elements in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_rsqrt_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(rsqrtps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_rsqrt_ps(a: __m128) -> __m128 {
+ rsqrtps(a)
+}
+
+/// Compares the first single-precision (32-bit) floating-point element of `a`
+/// and `b`, and return the minimum value in the first element of the return
+/// value, the other elements are copied from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(minss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_min_ss(a: __m128, b: __m128) -> __m128 {
+ minss(a, b)
+}
+
+/// Compares packed single-precision (32-bit) floating-point elements in `a` and
+/// `b`, and return the corresponding minimum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(minps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_min_ps(a: __m128, b: __m128) -> __m128 {
+ // See the `test_mm_min_ps` test why this can't be implemented using `simd_fmin`.
+ minps(a, b)
+}
+
+/// Compares the first single-precision (32-bit) floating-point element of `a`
+/// and `b`, and return the maximum value in the first element of the return
+/// value, the other elements are copied from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(maxss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_max_ss(a: __m128, b: __m128) -> __m128 {
+ maxss(a, b)
+}
+
+/// Compares packed single-precision (32-bit) floating-point elements in `a` and
+/// `b`, and return the corresponding maximum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(maxps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_max_ps(a: __m128, b: __m128) -> __m128 {
+ // See the `test_mm_min_ps` test why this can't be implemented using `simd_fmax`.
+ maxps(a, b)
+}
+
+/// Bitwise AND of packed single-precision (32-bit) floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_and_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+// i586 only seems to generate plain `and` instructions, so ignore it.
+#[cfg_attr(
+ all(test, any(target_arch = "x86_64", target_feature = "sse2")),
+ assert_instr(andps)
+)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_and_ps(a: __m128, b: __m128) -> __m128 {
+ let a: __m128i = mem::transmute(a);
+ let b: __m128i = mem::transmute(b);
+ mem::transmute(simd_and(a, b))
+}
+
+/// Bitwise AND-NOT of packed single-precision (32-bit) floating-point
+/// elements.
+///
+/// Computes `!a & b` for each bit in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_andnot_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+// i586 only seems to generate plain `not` and `and` instructions, so ignore
+// it.
+#[cfg_attr(
+ all(test, any(target_arch = "x86_64", target_feature = "sse2")),
+ assert_instr(andnps)
+)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_andnot_ps(a: __m128, b: __m128) -> __m128 {
+ let a: __m128i = mem::transmute(a);
+ let b: __m128i = mem::transmute(b);
+ let mask: __m128i = mem::transmute(i32x4::splat(-1));
+ mem::transmute(simd_and(simd_xor(mask, a), b))
+}
+
+/// Bitwise OR of packed single-precision (32-bit) floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_or_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+// i586 only seems to generate plain `or` instructions, so we ignore it.
+#[cfg_attr(
+ all(test, any(target_arch = "x86_64", target_feature = "sse2")),
+ assert_instr(orps)
+)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_or_ps(a: __m128, b: __m128) -> __m128 {
+ let a: __m128i = mem::transmute(a);
+ let b: __m128i = mem::transmute(b);
+ mem::transmute(simd_or(a, b))
+}
+
+/// Bitwise exclusive OR of packed single-precision (32-bit) floating-point
+/// elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_xor_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+// i586 only seems to generate plain `xor` instructions, so we ignore it.
+#[cfg_attr(
+ all(test, any(target_arch = "x86_64", target_feature = "sse2")),
+ assert_instr(xorps)
+)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_xor_ps(a: __m128, b: __m128) -> __m128 {
+ let a: __m128i = mem::transmute(a);
+ let b: __m128i = mem::transmute(b);
+ mem::transmute(simd_xor(a, b))
+}
+
+/// Compares the lowest `f32` of both inputs for equality. The lowest 32 bits of
+/// the result will be `0xffffffff` if the two inputs are equal, or `0`
+/// otherwise. The upper 96 bits of the result are the upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpeqss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpeq_ss(a: __m128, b: __m128) -> __m128 {
+ cmpss(a, b, 0)
+}
+
+/// Compares the lowest `f32` of both inputs for less than. The lowest 32 bits
+/// of the result will be `0xffffffff` if `a.extract(0)` is less than
+/// `b.extract(0)`, or `0` otherwise. The upper 96 bits of the result are the
+/// upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpltss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmplt_ss(a: __m128, b: __m128) -> __m128 {
+ cmpss(a, b, 1)
+}
+
+/// Compares the lowest `f32` of both inputs for less than or equal. The lowest
+/// 32 bits of the result will be `0xffffffff` if `a.extract(0)` is less than
+/// or equal `b.extract(0)`, or `0` otherwise. The upper 96 bits of the result
+/// are the upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpless))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmple_ss(a: __m128, b: __m128) -> __m128 {
+ cmpss(a, b, 2)
+}
+
+/// Compares the lowest `f32` of both inputs for greater than. The lowest 32
+/// bits of the result will be `0xffffffff` if `a.extract(0)` is greater
+/// than `b.extract(0)`, or `0` otherwise. The upper 96 bits of the result
+/// are the upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpltss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpgt_ss(a: __m128, b: __m128) -> __m128 {
+ simd_shuffle4!(a, cmpss(b, a, 1), [4, 1, 2, 3])
+}
+
+/// Compares the lowest `f32` of both inputs for greater than or equal. The
+/// lowest 32 bits of the result will be `0xffffffff` if `a.extract(0)` is
+/// greater than or equal `b.extract(0)`, or `0` otherwise. The upper 96 bits
+/// of the result are the upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpless))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpge_ss(a: __m128, b: __m128) -> __m128 {
+ simd_shuffle4!(a, cmpss(b, a, 2), [4, 1, 2, 3])
+}
+
+/// Compares the lowest `f32` of both inputs for inequality. The lowest 32 bits
+/// of the result will be `0xffffffff` if `a.extract(0)` is not equal to
+/// `b.extract(0)`, or `0` otherwise. The upper 96 bits of the result are the
+/// upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpneqss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpneq_ss(a: __m128, b: __m128) -> __m128 {
+ cmpss(a, b, 4)
+}
+
+/// Compares the lowest `f32` of both inputs for not-less-than. The lowest 32
+/// bits of the result will be `0xffffffff` if `a.extract(0)` is not less than
+/// `b.extract(0)`, or `0` otherwise. The upper 96 bits of the result are the
+/// upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnlt_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpnltss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnlt_ss(a: __m128, b: __m128) -> __m128 {
+ cmpss(a, b, 5)
+}
+
+/// Compares the lowest `f32` of both inputs for not-less-than-or-equal. The
+/// lowest 32 bits of the result will be `0xffffffff` if `a.extract(0)` is not
+/// less than or equal to `b.extract(0)`, or `0` otherwise. The upper 96 bits
+/// of the result are the upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnle_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpnless))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnle_ss(a: __m128, b: __m128) -> __m128 {
+ cmpss(a, b, 6)
+}
+
+/// Compares the lowest `f32` of both inputs for not-greater-than. The lowest 32
+/// bits of the result will be `0xffffffff` if `a.extract(0)` is not greater
+/// than `b.extract(0)`, or `0` otherwise. The upper 96 bits of the result are
+/// the upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpngt_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpnltss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpngt_ss(a: __m128, b: __m128) -> __m128 {
+ simd_shuffle4!(a, cmpss(b, a, 5), [4, 1, 2, 3])
+}
+
+/// Compares the lowest `f32` of both inputs for not-greater-than-or-equal. The
+/// lowest 32 bits of the result will be `0xffffffff` if `a.extract(0)` is not
+/// greater than or equal to `b.extract(0)`, or `0` otherwise. The upper 96
+/// bits of the result are the upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnge_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpnless))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnge_ss(a: __m128, b: __m128) -> __m128 {
+ simd_shuffle4!(a, cmpss(b, a, 6), [4, 1, 2, 3])
+}
+
+/// Checks if the lowest `f32` of both inputs are ordered. The lowest 32 bits of
+/// the result will be `0xffffffff` if neither of `a.extract(0)` or
+/// `b.extract(0)` is a NaN, or `0` otherwise. The upper 96 bits of the result
+/// are the upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpord_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpordss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpord_ss(a: __m128, b: __m128) -> __m128 {
+ cmpss(a, b, 7)
+}
+
+/// Checks if the lowest `f32` of both inputs are unordered. The lowest 32 bits
+/// of the result will be `0xffffffff` if any of `a.extract(0)` or
+/// `b.extract(0)` is a NaN, or `0` otherwise. The upper 96 bits of the result
+/// are the upper 96 bits of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpunord_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpunordss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpunord_ss(a: __m128, b: __m128) -> __m128 {
+ cmpss(a, b, 3)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// The result in the output vector will be `0xffffffff` if the input elements
+/// were equal, or `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpeqps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpeq_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(a, b, 0)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// The result in the output vector will be `0xffffffff` if the input element
+/// in `a` is less than the corresponding element in `b`, or `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpltps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmplt_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(a, b, 1)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// The result in the output vector will be `0xffffffff` if the input element
+/// in `a` is less than or equal to the corresponding element in `b`, or `0`
+/// otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpleps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmple_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(a, b, 2)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// The result in the output vector will be `0xffffffff` if the input element
+/// in `a` is greater than the corresponding element in `b`, or `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpltps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpgt_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(b, a, 1)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// The result in the output vector will be `0xffffffff` if the input element
+/// in `a` is greater than or equal to the corresponding element in `b`, or `0`
+/// otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpleps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpge_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(b, a, 2)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// The result in the output vector will be `0xffffffff` if the input elements
+/// are **not** equal, or `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpneqps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpneq_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(a, b, 4)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// The result in the output vector will be `0xffffffff` if the input element
+/// in `a` is **not** less than the corresponding element in `b`, or `0`
+/// otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnlt_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpnltps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnlt_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(a, b, 5)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// The result in the output vector will be `0xffffffff` if the input element
+/// in `a` is **not** less than or equal to the corresponding element in `b`, or
+/// `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnle_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpnleps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnle_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(a, b, 6)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// The result in the output vector will be `0xffffffff` if the input element
+/// in `a` is **not** greater than the corresponding element in `b`, or `0`
+/// otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpngt_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpnltps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpngt_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(b, a, 5)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// The result in the output vector will be `0xffffffff` if the input element
+/// in `a` is **not** greater than or equal to the corresponding element in `b`,
+/// or `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnge_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpnleps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnge_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(b, a, 6)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// Returns four floats that have one of two possible bit patterns. The element
+/// in the output vector will be `0xffffffff` if the input elements in `a` and
+/// `b` are ordered (i.e., neither of them is a NaN), or 0 otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpord_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpordps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpord_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(b, a, 7)
+}
+
+/// Compares each of the four floats in `a` to the corresponding element in `b`.
+/// Returns four floats that have one of two possible bit patterns. The element
+/// in the output vector will be `0xffffffff` if the input elements in `a` and
+/// `b` are unordered (i.e., at least on of them is a NaN), or 0 otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpunord_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cmpunordps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpunord_ps(a: __m128, b: __m128) -> __m128 {
+ cmpps(b, a, 3)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if they are equal, or `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comieq_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(comiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comieq_ss(a: __m128, b: __m128) -> i32 {
+ comieq_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if the value from `a` is less than the one from `b`, or `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comilt_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(comiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comilt_ss(a: __m128, b: __m128) -> i32 {
+ comilt_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if the value from `a` is less than or equal to the one from `b`, or `0`
+/// otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comile_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(comiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comile_ss(a: __m128, b: __m128) -> i32 {
+ comile_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if the value from `a` is greater than the one from `b`, or `0`
+/// otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comigt_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(comiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comigt_ss(a: __m128, b: __m128) -> i32 {
+ comigt_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if the value from `a` is greater than or equal to the one from `b`, or
+/// `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comige_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(comiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comige_ss(a: __m128, b: __m128) -> i32 {
+ comige_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if they are **not** equal, or `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comineq_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(comiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comineq_ss(a: __m128, b: __m128) -> i32 {
+ comineq_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if they are equal, or `0` otherwise. This instruction will not signal
+/// an exception if either argument is a quiet NaN.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomieq_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(ucomiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomieq_ss(a: __m128, b: __m128) -> i32 {
+ ucomieq_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if the value from `a` is less than the one from `b`, or `0` otherwise.
+/// This instruction will not signal an exception if either argument is a quiet
+/// NaN.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomilt_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(ucomiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomilt_ss(a: __m128, b: __m128) -> i32 {
+ ucomilt_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if the value from `a` is less than or equal to the one from `b`, or `0`
+/// otherwise. This instruction will not signal an exception if either argument
+/// is a quiet NaN.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomile_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(ucomiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomile_ss(a: __m128, b: __m128) -> i32 {
+ ucomile_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if the value from `a` is greater than the one from `b`, or `0`
+/// otherwise. This instruction will not signal an exception if either argument
+/// is a quiet NaN.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomigt_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(ucomiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomigt_ss(a: __m128, b: __m128) -> i32 {
+ ucomigt_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if the value from `a` is greater than or equal to the one from `b`, or
+/// `0` otherwise. This instruction will not signal an exception if either
+/// argument is a quiet NaN.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomige_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(ucomiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomige_ss(a: __m128, b: __m128) -> i32 {
+ ucomige_ss(a, b)
+}
+
+/// Compares two 32-bit floats from the low-order bits of `a` and `b`. Returns
+/// `1` if they are **not** equal, or `0` otherwise. This instruction will not
+/// signal an exception if either argument is a quiet NaN.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomineq_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(ucomiss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomineq_ss(a: __m128, b: __m128) -> i32 {
+ ucomineq_ss(a, b)
+}
+
+/// Converts the lowest 32 bit float in the input vector to a 32 bit integer.
+///
+/// The result is rounded according to the current rounding mode. If the result
+/// cannot be represented as a 32 bit integer the result will be `0x8000_0000`
+/// (`i32::MIN`) or an invalid operation floating point exception if
+/// unmasked (see [`_mm_setcsr`](fn._mm_setcsr.html)).
+///
+/// This corresponds to the `CVTSS2SI` instruction (with 32 bit output).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtss_si32)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cvtss2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtss_si32(a: __m128) -> i32 {
+ cvtss2si(a)
+}
+
+/// Alias for [`_mm_cvtss_si32`](fn._mm_cvtss_si32.html).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvt_ss2si)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cvtss2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvt_ss2si(a: __m128) -> i32 {
+ _mm_cvtss_si32(a)
+}
+
+/// Converts the lowest 32 bit float in the input vector to a 32 bit integer
+/// with
+/// truncation.
+///
+/// The result is rounded always using truncation (round towards zero). If the
+/// result cannot be represented as a 32 bit integer the result will be
+/// `0x8000_0000` (`i32::MIN`) or an invalid operation floating point
+/// exception if unmasked (see [`_mm_setcsr`](fn._mm_setcsr.html)).
+///
+/// This corresponds to the `CVTTSS2SI` instruction (with 32 bit output).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttss_si32)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cvttss2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvttss_si32(a: __m128) -> i32 {
+ cvttss2si(a)
+}
+
+/// Alias for [`_mm_cvttss_si32`](fn._mm_cvttss_si32.html).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtt_ss2si)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cvttss2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtt_ss2si(a: __m128) -> i32 {
+ _mm_cvttss_si32(a)
+}
+
+/// Extracts the lowest 32 bit float from the input vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtss_f32)
+#[inline]
+#[target_feature(enable = "sse")]
+// No point in using assert_instrs. In Unix x86_64 calling convention this is a
+// no-op, and on Windows it's just a `mov`.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtss_f32(a: __m128) -> f32 {
+ simd_extract(a, 0)
+}
+
+/// Converts a 32 bit integer to a 32 bit float. The result vector is the input
+/// vector `a` with the lowest 32 bit float replaced by the converted integer.
+///
+/// This intrinsic corresponds to the `CVTSI2SS` instruction (with 32 bit
+/// input).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsi32_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cvtsi2ss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi32_ss(a: __m128, b: i32) -> __m128 {
+ cvtsi2ss(a, b)
+}
+
+/// Alias for [`_mm_cvtsi32_ss`](fn._mm_cvtsi32_ss.html).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvt_si2ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cvtsi2ss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvt_si2ss(a: __m128, b: i32) -> __m128 {
+ _mm_cvtsi32_ss(a, b)
+}
+
+/// Construct a `__m128` with the lowest element set to `a` and the rest set to
+/// zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set_ss(a: f32) -> __m128 {
+ __m128(a, 0.0, 0.0, 0.0)
+}
+
+/// Construct a `__m128` with all element set to `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set1_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(shufps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set1_ps(a: f32) -> __m128 {
+ __m128(a, a, a, a)
+}
+
+/// Alias for [`_mm_set1_ps`](fn._mm_set1_ps.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_ps1)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(shufps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set_ps1(a: f32) -> __m128 {
+ _mm_set1_ps(a)
+}
+
+/// Construct a `__m128` from four floating point values highest to lowest.
+///
+/// Note that `a` will be the highest 32 bits of the result, and `d` the
+/// lowest. This matches the standard way of writing bit patterns on x86:
+///
+/// ```text
+/// bit 127 .. 96 95 .. 64 63 .. 32 31 .. 0
+/// +---------+---------+---------+---------+
+/// | a | b | c | d | result
+/// +---------+---------+---------+---------+
+/// ```
+///
+/// Alternatively:
+///
+/// ```text
+/// let v = _mm_set_ps(d, c, b, a);
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(unpcklps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set_ps(a: f32, b: f32, c: f32, d: f32) -> __m128 {
+ __m128(d, c, b, a)
+}
+
+/// Construct a `__m128` from four floating point values lowest to highest.
+///
+/// This matches the memory order of `__m128`, i.e., `a` will be the lowest 32
+/// bits of the result, and `d` the highest.
+///
+/// ```text
+/// assert_eq!(__m128::new(a, b, c, d), _mm_setr_ps(a, b, c, d));
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_setr_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(
+ all(test, any(target_os = "windows", target_arch = "x86_64")),
+ assert_instr(unpcklps)
+)]
+// On a 32-bit architecture on non-Windows it just copies the operands from the stack.
+#[cfg_attr(
+ all(test, all(not(target_os = "windows"), target_arch = "x86")),
+ assert_instr(movaps)
+)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_setr_ps(a: f32, b: f32, c: f32, d: f32) -> __m128 {
+ __m128(a, b, c, d)
+}
+
+/// Construct a `__m128` with all elements initialized to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_setzero_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(xorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_setzero_ps() -> __m128 {
+ __m128(0.0, 0.0, 0.0, 0.0)
+}
+
+/// A utility function for creating masks to use with Intel shuffle and
+/// permute intrinsics.
+#[inline]
+#[allow(non_snake_case)]
+#[unstable(feature = "stdarch", issue = "27731")]
+pub const fn _MM_SHUFFLE(z: u32, y: u32, x: u32, w: u32) -> i32 {
+ ((z << 6) | (y << 4) | (x << 2) | w) as i32
+}
+
+/// Shuffles packed single-precision (32-bit) floating-point elements in `a` and
+/// `b` using `MASK`.
+///
+/// The lower half of result takes values from `a` and the higher half from
+/// `b`. Mask is split to 2 control bits each to index the element from inputs.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shuffle_ps)
+///
+/// Note that there appears to be a mistake within Intel's Intrinsics Guide.
+/// `_mm_shuffle_ps` is supposed to take an `i32` instead of a `u32`
+/// as is the case for [other shuffle intrinsics](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shuffle_).
+/// Performing an implicit type conversion between an unsigned integer and a signed integer
+/// does not cause a problem in C, however Rust's commitment to strong typing does not allow this.
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(shufps, MASK = 3))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_shuffle_ps<const MASK: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_imm8!(MASK);
+ simd_shuffle4!(
+ a,
+ b,
+ <const MASK: i32> [
+ MASK as u32 & 0b11,
+ (MASK as u32 >> 2) & 0b11,
+ ((MASK as u32 >> 4) & 0b11) + 4,
+ ((MASK as u32 >> 6) & 0b11) + 4,
+ ],
+ )
+}
+
+/// Unpacks and interleave single-precision (32-bit) floating-point elements
+/// from the higher half of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpackhi_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(unpckhps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpackhi_ps(a: __m128, b: __m128) -> __m128 {
+ simd_shuffle4!(a, b, [2, 6, 3, 7])
+}
+
+/// Unpacks and interleave single-precision (32-bit) floating-point elements
+/// from the lower half of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpacklo_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(unpcklps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpacklo_ps(a: __m128, b: __m128) -> __m128 {
+ simd_shuffle4!(a, b, [0, 4, 1, 5])
+}
+
+/// Combine higher half of `a` and `b`. The highwe half of `b` occupies the
+/// lower half of result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movehl_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movhlps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_movehl_ps(a: __m128, b: __m128) -> __m128 {
+ // TODO; figure why this is a different instruction on Windows?
+ simd_shuffle4!(a, b, [6, 7, 2, 3])
+}
+
+/// Combine lower half of `a` and `b`. The lower half of `b` occupies the
+/// higher half of result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movelh_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movlhps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_movelh_ps(a: __m128, b: __m128) -> __m128 {
+ simd_shuffle4!(a, b, [0, 1, 4, 5])
+}
+
+/// Returns a mask of the most significant bit of each element in `a`.
+///
+/// The mask is stored in the 4 least significant bits of the return value.
+/// All other bits are set to `0`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movemask_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+// FIXME: LLVM9 trunk has the following bug:
+// https://github.com/rust-lang/stdarch/issues/794
+// so we only temporarily test this on i686 and x86_64 but not on i586:
+#[cfg_attr(all(test, target_feature = "sse2"), assert_instr(movmskps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_movemask_ps(a: __m128) -> i32 {
+ movmskps(a)
+}
+
+/// Construct a `__m128` with the lowest element read from `p` and the other
+/// elements set to zero.
+///
+/// This corresponds to instructions `VMOVSS` / `MOVSS`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_load_ss(p: *const f32) -> __m128 {
+ __m128(*p, 0.0, 0.0, 0.0)
+}
+
+/// Construct a `__m128` by duplicating the value read from `p` into all
+/// elements.
+///
+/// This corresponds to instructions `VMOVSS` / `MOVSS` followed by some
+/// shuffling.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load1_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_load1_ps(p: *const f32) -> __m128 {
+ let a = *p;
+ __m128(a, a, a, a)
+}
+
+/// Alias for [`_mm_load1_ps`](fn._mm_load1_ps.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load_ps1)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_load_ps1(p: *const f32) -> __m128 {
+ _mm_load1_ps(p)
+}
+
+/// Loads four `f32` values from *aligned* memory into a `__m128`. If the
+/// pointer is not aligned to a 128-bit boundary (16 bytes) a general
+/// protection fault will be triggered (fatal program crash).
+///
+/// Use [`_mm_loadu_ps`](fn._mm_loadu_ps.html) for potentially unaligned
+/// memory.
+///
+/// This corresponds to instructions `VMOVAPS` / `MOVAPS`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_load_ps(p: *const f32) -> __m128 {
+ *(p as *const __m128)
+}
+
+/// Loads four `f32` values from memory into a `__m128`. There are no
+/// restrictions
+/// on memory alignment. For aligned memory
+/// [`_mm_load_ps`](fn._mm_load_ps.html)
+/// may be faster.
+///
+/// This corresponds to instructions `VMOVUPS` / `MOVUPS`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadu_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movups))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_loadu_ps(p: *const f32) -> __m128 {
+ // Note: Using `*p` would require `f32` alignment, but `movups` has no
+ // alignment restrictions.
+ let mut dst = _mm_undefined_ps();
+ ptr::copy_nonoverlapping(
+ p as *const u8,
+ &mut dst as *mut __m128 as *mut u8,
+ mem::size_of::<__m128>(),
+ );
+ dst
+}
+
+/// Loads four `f32` values from aligned memory into a `__m128` in reverse
+/// order.
+///
+/// If the pointer is not aligned to a 128-bit boundary (16 bytes) a general
+/// protection fault will be triggered (fatal program crash).
+///
+/// Functionally equivalent to the following code sequence (assuming `p`
+/// satisfies the alignment restrictions):
+///
+/// ```text
+/// let a0 = *p;
+/// let a1 = *p.offset(1);
+/// let a2 = *p.offset(2);
+/// let a3 = *p.offset(3);
+/// __m128::new(a3, a2, a1, a0)
+/// ```
+///
+/// This corresponds to instructions `VMOVAPS` / `MOVAPS` followed by some
+/// shuffling.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadr_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_loadr_ps(p: *const f32) -> __m128 {
+ let a = _mm_load_ps(p);
+ simd_shuffle4!(a, a, [3, 2, 1, 0])
+}
+
+/// Loads unaligned 64-bits of integer data from memory into new vector.
+///
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadu_si64)
+#[inline]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86_mm_loadu_si64", since = "1.46.0")]
+pub unsafe fn _mm_loadu_si64(mem_addr: *const u8) -> __m128i {
+ transmute(i64x2(ptr::read_unaligned(mem_addr as *const i64), 0))
+}
+
+/// Stores the lowest 32 bit float of `a` into memory.
+///
+/// This intrinsic corresponds to the `MOVSS` instruction.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_store_ss(p: *mut f32, a: __m128) {
+ *p = simd_extract(a, 0);
+}
+
+/// Stores the lowest 32 bit float of `a` repeated four times into *aligned*
+/// memory.
+///
+/// If the pointer is not aligned to a 128-bit boundary (16 bytes) a general
+/// protection fault will be triggered (fatal program crash).
+///
+/// Functionally equivalent to the following code sequence (assuming `p`
+/// satisfies the alignment restrictions):
+///
+/// ```text
+/// let x = a.extract(0);
+/// *p = x;
+/// *p.offset(1) = x;
+/// *p.offset(2) = x;
+/// *p.offset(3) = x;
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store1_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_store1_ps(p: *mut f32, a: __m128) {
+ let b: __m128 = simd_shuffle4!(a, a, [0, 0, 0, 0]);
+ *(p as *mut __m128) = b;
+}
+
+/// Alias for [`_mm_store1_ps`](fn._mm_store1_ps.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store_ps1)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_store_ps1(p: *mut f32, a: __m128) {
+ _mm_store1_ps(p, a);
+}
+
+/// Stores four 32-bit floats into *aligned* memory.
+///
+/// If the pointer is not aligned to a 128-bit boundary (16 bytes) a general
+/// protection fault will be triggered (fatal program crash).
+///
+/// Use [`_mm_storeu_ps`](fn._mm_storeu_ps.html) for potentially unaligned
+/// memory.
+///
+/// This corresponds to instructions `VMOVAPS` / `MOVAPS`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_store_ps(p: *mut f32, a: __m128) {
+ *(p as *mut __m128) = a;
+}
+
+/// Stores four 32-bit floats into memory. There are no restrictions on memory
+/// alignment. For aligned memory [`_mm_store_ps`](fn._mm_store_ps.html) may be
+/// faster.
+///
+/// This corresponds to instructions `VMOVUPS` / `MOVUPS`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storeu_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movups))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_storeu_ps(p: *mut f32, a: __m128) {
+ ptr::copy_nonoverlapping(
+ &a as *const __m128 as *const u8,
+ p as *mut u8,
+ mem::size_of::<__m128>(),
+ );
+}
+
+/// Stores four 32-bit floats into *aligned* memory in reverse order.
+///
+/// If the pointer is not aligned to a 128-bit boundary (16 bytes) a general
+/// protection fault will be triggered (fatal program crash).
+///
+/// Functionally equivalent to the following code sequence (assuming `p`
+/// satisfies the alignment restrictions):
+///
+/// ```text
+/// *p = a.extract(3);
+/// *p.offset(1) = a.extract(2);
+/// *p.offset(2) = a.extract(1);
+/// *p.offset(3) = a.extract(0);
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storer_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_storer_ps(p: *mut f32, a: __m128) {
+ let b: __m128 = simd_shuffle4!(a, a, [3, 2, 1, 0]);
+ *(p as *mut __m128) = b;
+}
+
+/// Returns a `__m128` with the first component from `b` and the remaining
+/// components from `a`.
+///
+/// In other words for any `a` and `b`:
+/// ```text
+/// _mm_move_ss(a, b) == a.replace(0, b.extract(0))
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_move_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_move_ss(a: __m128, b: __m128) -> __m128 {
+ simd_shuffle4!(a, b, [4, 1, 2, 3])
+}
+
+/// Performs a serializing operation on all store-to-memory instructions that
+/// were issued prior to this instruction.
+///
+/// Guarantees that every store instruction that precedes, in program order, is
+/// globally visible before any store instruction which follows the fence in
+/// program order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sfence)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(sfence))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sfence() {
+ sfence()
+}
+
+/// Gets the unsigned 32-bit value of the MXCSR control and status register.
+///
+/// For more info see [`_mm_setcsr`](fn._mm_setcsr.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_getcsr)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(stmxcsr))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_getcsr() -> u32 {
+ let mut result = 0_i32;
+ stmxcsr((&mut result) as *mut _ as *mut i8);
+ result as u32
+}
+
+/// Sets the MXCSR register with the 32-bit unsigned integer value.
+///
+/// This register constrols how SIMD instructions handle floating point
+/// operations. Modifying this register only affects the current thread.
+///
+/// It contains several groups of flags:
+///
+/// * *Exception flags* report which exceptions occurred since last they were
+/// reset.
+///
+/// * *Masking flags* can be used to mask (ignore) certain exceptions. By
+/// default
+/// these flags are all set to 1, so all exceptions are masked. When an
+/// an exception is masked, the processor simply sets the exception flag and
+/// continues the operation. If the exception is unmasked, the flag is also set
+/// but additionally an exception handler is invoked.
+///
+/// * *Rounding mode flags* control the rounding mode of floating point
+/// instructions.
+///
+/// * The *denormals-are-zero mode flag* turns all numbers which would be
+/// denormalized (exponent bits are all zeros) into zeros.
+///
+/// ## Exception Flags
+///
+/// * `_MM_EXCEPT_INVALID`: An invalid operation was performed (e.g., dividing
+/// Infinity by Infinity).
+///
+/// * `_MM_EXCEPT_DENORM`: An operation attempted to operate on a denormalized
+/// number. Mainly this can cause loss of precision.
+///
+/// * `_MM_EXCEPT_DIV_ZERO`: Division by zero occurred.
+///
+/// * `_MM_EXCEPT_OVERFLOW`: A numeric overflow exception occurred, i.e., a
+/// result was too large to be represented (e.g., an `f32` with absolute
+/// value
+/// greater than `2^128`).
+///
+/// * `_MM_EXCEPT_UNDERFLOW`: A numeric underflow exception occurred, i.e., a
+/// result was too small to be represented in a normalized way (e.g., an
+/// `f32`
+/// with absulte value smaller than `2^-126`.)
+///
+/// * `_MM_EXCEPT_INEXACT`: An inexact-result exception occurred (a.k.a.
+/// precision exception). This means some precision was lost due to rounding.
+/// For example, the fraction `1/3` cannot be represented accurately in a
+/// 32 or 64 bit float and computing it would cause this exception to be
+/// raised. Precision exceptions are very common, so they are usually masked.
+///
+/// Exception flags can be read and set using the convenience functions
+/// `_MM_GET_EXCEPTION_STATE` and `_MM_SET_EXCEPTION_STATE`. For example, to
+/// check if an operation caused some overflow:
+///
+/// ```rust,ignore
+/// _MM_SET_EXCEPTION_STATE(0); // clear all exception flags
+/// // perform calculations
+/// if _MM_GET_EXCEPTION_STATE() & _MM_EXCEPT_OVERFLOW != 0 {
+/// // handle overflow
+/// }
+/// ```
+///
+/// ## Masking Flags
+///
+/// There is one masking flag for each exception flag: `_MM_MASK_INVALID`,
+/// `_MM_MASK_DENORM`, `_MM_MASK_DIV_ZERO`, `_MM_MASK_OVERFLOW`,
+/// `_MM_MASK_UNDERFLOW`, `_MM_MASK_INEXACT`.
+///
+/// A single masking bit can be set via
+///
+/// ```rust,ignore
+/// _MM_SET_EXCEPTION_MASK(_MM_MASK_UNDERFLOW);
+/// ```
+///
+/// However, since mask bits are by default all set to 1, it is more common to
+/// want to *disable* certain bits. For example, to unmask the underflow
+/// exception, use:
+///
+/// ```rust,ignore
+/// _mm_setcsr(_mm_getcsr() & !_MM_MASK_UNDERFLOW); // unmask underflow
+/// exception
+/// ```
+///
+/// Warning: an unmasked exception will cause an exception handler to be
+/// called.
+/// The standard handler will simply terminate the process. So, in this case
+/// any underflow exception would terminate the current process with something
+/// like `signal: 8, SIGFPE: erroneous arithmetic operation`.
+///
+/// ## Rounding Mode
+///
+/// The rounding mode is describe using two bits. It can be read and set using
+/// the convenience wrappers `_MM_GET_ROUNDING_MODE()` and
+/// `_MM_SET_ROUNDING_MODE(mode)`.
+///
+/// The rounding modes are:
+///
+/// * `_MM_ROUND_NEAREST`: (default) Round to closest to the infinite precision
+/// value. If two values are equally close, round to even (i.e., least
+/// significant bit will be zero).
+///
+/// * `_MM_ROUND_DOWN`: Round toward negative Infinity.
+///
+/// * `_MM_ROUND_UP`: Round toward positive Infinity.
+///
+/// * `_MM_ROUND_TOWARD_ZERO`: Round towards zero (truncate).
+///
+/// Example:
+///
+/// ```rust,ignore
+/// _MM_SET_ROUNDING_MODE(_MM_ROUND_DOWN)
+/// ```
+///
+/// ## Denormals-are-zero/Flush-to-zero Mode
+///
+/// If this bit is set, values that would be denormalized will be set to zero
+/// instead. This is turned off by default.
+///
+/// You can read and enable/disable this mode via the helper functions
+/// `_MM_GET_FLUSH_ZERO_MODE()` and `_MM_SET_FLUSH_ZERO_MODE()`:
+///
+/// ```rust,ignore
+/// _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_OFF); // turn off (default)
+/// _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); // turn on
+/// ```
+///
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_setcsr)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(ldmxcsr))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_setcsr(val: u32) {
+ ldmxcsr(&val as *const _ as *const i8);
+}
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_EXCEPT_INVALID: u32 = 0x0001;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_EXCEPT_DENORM: u32 = 0x0002;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_EXCEPT_DIV_ZERO: u32 = 0x0004;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_EXCEPT_OVERFLOW: u32 = 0x0008;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_EXCEPT_UNDERFLOW: u32 = 0x0010;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_EXCEPT_INEXACT: u32 = 0x0020;
+/// See [`_MM_GET_EXCEPTION_STATE`](fn._MM_GET_EXCEPTION_STATE.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_EXCEPT_MASK: u32 = 0x003f;
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_MASK_INVALID: u32 = 0x0080;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_MASK_DENORM: u32 = 0x0100;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_MASK_DIV_ZERO: u32 = 0x0200;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_MASK_OVERFLOW: u32 = 0x0400;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_MASK_UNDERFLOW: u32 = 0x0800;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_MASK_INEXACT: u32 = 0x1000;
+/// See [`_MM_GET_EXCEPTION_MASK`](fn._MM_GET_EXCEPTION_MASK.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_MASK_MASK: u32 = 0x1f80;
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_ROUND_NEAREST: u32 = 0x0000;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_ROUND_DOWN: u32 = 0x2000;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_ROUND_UP: u32 = 0x4000;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_ROUND_TOWARD_ZERO: u32 = 0x6000;
+
+/// See [`_MM_GET_ROUNDING_MODE`](fn._MM_GET_ROUNDING_MODE.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_ROUND_MASK: u32 = 0x6000;
+
+/// See [`_MM_GET_FLUSH_ZERO_MODE`](fn._MM_GET_FLUSH_ZERO_MODE.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FLUSH_ZERO_MASK: u32 = 0x8000;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FLUSH_ZERO_ON: u32 = 0x8000;
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FLUSH_ZERO_OFF: u32 = 0x0000;
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_MM_GET_EXCEPTION_MASK)
+#[inline]
+#[allow(non_snake_case)]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _MM_GET_EXCEPTION_MASK() -> u32 {
+ _mm_getcsr() & _MM_MASK_MASK
+}
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_MM_GET_EXCEPTION_STATE)
+#[inline]
+#[allow(non_snake_case)]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _MM_GET_EXCEPTION_STATE() -> u32 {
+ _mm_getcsr() & _MM_EXCEPT_MASK
+}
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_MM_GET_FLUSH_ZERO_MODE)
+#[inline]
+#[allow(non_snake_case)]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _MM_GET_FLUSH_ZERO_MODE() -> u32 {
+ _mm_getcsr() & _MM_FLUSH_ZERO_MASK
+}
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_MM_GET_ROUNDING_MODE)
+#[inline]
+#[allow(non_snake_case)]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _MM_GET_ROUNDING_MODE() -> u32 {
+ _mm_getcsr() & _MM_ROUND_MASK
+}
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_MM_SET_EXCEPTION_MASK)
+#[inline]
+#[allow(non_snake_case)]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _MM_SET_EXCEPTION_MASK(x: u32) {
+ _mm_setcsr((_mm_getcsr() & !_MM_MASK_MASK) | x)
+}
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_MM_SET_EXCEPTION_STATE)
+#[inline]
+#[allow(non_snake_case)]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _MM_SET_EXCEPTION_STATE(x: u32) {
+ _mm_setcsr((_mm_getcsr() & !_MM_EXCEPT_MASK) | x)
+}
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_MM_SET_FLUSH_ZERO_MODE)
+#[inline]
+#[allow(non_snake_case)]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _MM_SET_FLUSH_ZERO_MODE(x: u32) {
+ let val = (_mm_getcsr() & !_MM_FLUSH_ZERO_MASK) | x;
+ // println!("setting csr={:x}", val);
+ _mm_setcsr(val)
+}
+
+/// See [`_mm_setcsr`](fn._mm_setcsr.html)
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_MM_SET_ROUNDING_MODE)
+#[inline]
+#[allow(non_snake_case)]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _MM_SET_ROUNDING_MODE(x: u32) {
+ _mm_setcsr((_mm_getcsr() & !_MM_ROUND_MASK) | x)
+}
+
+/// See [`_mm_prefetch`](fn._mm_prefetch.html).
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_HINT_T0: i32 = 3;
+
+/// See [`_mm_prefetch`](fn._mm_prefetch.html).
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_HINT_T1: i32 = 2;
+
+/// See [`_mm_prefetch`](fn._mm_prefetch.html).
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_HINT_T2: i32 = 1;
+
+/// See [`_mm_prefetch`](fn._mm_prefetch.html).
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_HINT_NTA: i32 = 0;
+
+/// See [`_mm_prefetch`](fn._mm_prefetch.html).
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_HINT_ET0: i32 = 7;
+
+/// See [`_mm_prefetch`](fn._mm_prefetch.html).
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_HINT_ET1: i32 = 6;
+
+/// Fetch the cache line that contains address `p` using the given `STRATEGY`.
+///
+/// The `STRATEGY` must be one of:
+///
+/// * [`_MM_HINT_T0`](constant._MM_HINT_T0.html): Fetch into all levels of the
+/// cache hierarchy.
+///
+/// * [`_MM_HINT_T1`](constant._MM_HINT_T1.html): Fetch into L2 and higher.
+///
+/// * [`_MM_HINT_T2`](constant._MM_HINT_T2.html): Fetch into L3 and higher or
+/// an implementation-specific choice (e.g., L2 if there is no L3).
+///
+/// * [`_MM_HINT_NTA`](constant._MM_HINT_NTA.html): Fetch data using the
+/// non-temporal access (NTA) hint. It may be a place closer than main memory
+/// but outside of the cache hierarchy. This is used to reduce access latency
+/// without polluting the cache.
+///
+/// * [`_MM_HINT_ET0`](constant._MM_HINT_ET0.html) and
+/// [`_MM_HINT_ET1`](constant._MM_HINT_ET1.html) are similar to `_MM_HINT_T0`
+/// and `_MM_HINT_T1` but indicate an anticipation to write to the address.
+///
+/// The actual implementation depends on the particular CPU. This instruction
+/// is considered a hint, so the CPU is also free to simply ignore the request.
+///
+/// The amount of prefetched data depends on the cache line size of the
+/// specific CPU, but it will be at least 32 bytes.
+///
+/// Common caveats:
+///
+/// * Most modern CPUs already automatically prefetch data based on predicted
+/// access patterns.
+///
+/// * Data is usually not fetched if this would cause a TLB miss or a page
+/// fault.
+///
+/// * Too much prefetching can cause unnecessary cache evictions.
+///
+/// * Prefetching may also fail if there are not enough memory-subsystem
+/// resources (e.g., request buffers).
+///
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_prefetch)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(prefetcht0, STRATEGY = _MM_HINT_T0))]
+#[cfg_attr(test, assert_instr(prefetcht1, STRATEGY = _MM_HINT_T1))]
+#[cfg_attr(test, assert_instr(prefetcht2, STRATEGY = _MM_HINT_T2))]
+#[cfg_attr(test, assert_instr(prefetchnta, STRATEGY = _MM_HINT_NTA))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_prefetch<const STRATEGY: i32>(p: *const i8) {
+ // We use the `llvm.prefetch` intrinsic with `cache type` = 1 (data cache).
+ // `locality` and `rw` are based on our `STRATEGY`.
+ prefetch(p, (STRATEGY >> 2) & 1, STRATEGY & 3, 1);
+}
+
+/// Returns vector of type __m128 with undefined elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_undefined_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_undefined_ps() -> __m128 {
+ _mm_set1_ps(0.0)
+}
+
+/// Transpose the 4x4 matrix formed by 4 rows of __m128 in place.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_MM_TRANSPOSE4_PS)
+#[inline]
+#[allow(non_snake_case)]
+#[target_feature(enable = "sse")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _MM_TRANSPOSE4_PS(
+ row0: &mut __m128,
+ row1: &mut __m128,
+ row2: &mut __m128,
+ row3: &mut __m128,
+) {
+ let tmp0 = _mm_unpacklo_ps(*row0, *row1);
+ let tmp2 = _mm_unpacklo_ps(*row2, *row3);
+ let tmp1 = _mm_unpackhi_ps(*row0, *row1);
+ let tmp3 = _mm_unpackhi_ps(*row2, *row3);
+
+ *row0 = _mm_movelh_ps(tmp0, tmp2);
+ *row1 = _mm_movehl_ps(tmp2, tmp0);
+ *row2 = _mm_movelh_ps(tmp1, tmp3);
+ *row3 = _mm_movehl_ps(tmp3, tmp1);
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.sse.add.ss"]
+ fn addss(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.sub.ss"]
+ fn subss(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.mul.ss"]
+ fn mulss(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.div.ss"]
+ fn divss(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.sqrt.ss"]
+ fn sqrtss(a: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.sqrt.ps"]
+ fn sqrtps(a: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.rcp.ss"]
+ fn rcpss(a: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.rcp.ps"]
+ fn rcpps(a: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.rsqrt.ss"]
+ fn rsqrtss(a: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.rsqrt.ps"]
+ fn rsqrtps(a: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.min.ss"]
+ fn minss(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.min.ps"]
+ fn minps(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.max.ss"]
+ fn maxss(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.max.ps"]
+ fn maxps(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse.movmsk.ps"]
+ fn movmskps(a: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.cmp.ps"]
+ fn cmpps(a: __m128, b: __m128, imm8: i8) -> __m128;
+ #[link_name = "llvm.x86.sse.comieq.ss"]
+ fn comieq_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.comilt.ss"]
+ fn comilt_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.comile.ss"]
+ fn comile_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.comigt.ss"]
+ fn comigt_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.comige.ss"]
+ fn comige_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.comineq.ss"]
+ fn comineq_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.ucomieq.ss"]
+ fn ucomieq_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.ucomilt.ss"]
+ fn ucomilt_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.ucomile.ss"]
+ fn ucomile_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.ucomigt.ss"]
+ fn ucomigt_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.ucomige.ss"]
+ fn ucomige_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.ucomineq.ss"]
+ fn ucomineq_ss(a: __m128, b: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.cvtss2si"]
+ fn cvtss2si(a: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.cvttss2si"]
+ fn cvttss2si(a: __m128) -> i32;
+ #[link_name = "llvm.x86.sse.cvtsi2ss"]
+ fn cvtsi2ss(a: __m128, b: i32) -> __m128;
+ #[link_name = "llvm.x86.sse.sfence"]
+ fn sfence();
+ #[link_name = "llvm.x86.sse.stmxcsr"]
+ fn stmxcsr(p: *mut i8);
+ #[link_name = "llvm.x86.sse.ldmxcsr"]
+ fn ldmxcsr(p: *const i8);
+ #[link_name = "llvm.prefetch"]
+ fn prefetch(p: *const i8, rw: i32, loc: i32, ty: i32);
+ #[link_name = "llvm.x86.sse.cmp.ss"]
+ fn cmpss(a: __m128, b: __m128, imm8: i8) -> __m128;
+}
+
+/// Stores `a` into the memory at `mem_addr` using a non-temporal memory hint.
+///
+/// `mem_addr` must be aligned on a 16-byte boundary or a general-protection
+/// exception _may_ be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_stream_ps)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(movntps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_stream_ps(mem_addr: *mut f32, a: __m128) {
+ intrinsics::nontemporal_store(mem_addr as *mut __m128, a);
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::{hint::black_box, mem::transmute};
+ use std::{boxed, f32::NAN};
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::{simd::*, x86::*};
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_add_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_add_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(-101.0, 25.0, 0.0, -15.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_add_ss() {
+ let a = _mm_set_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_set_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_add_ss(a, b);
+ assert_eq_m128(r, _mm_set_ps(-1.0, 5.0, 0.0, -15.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_sub_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_sub_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(99.0, -15.0, 0.0, -5.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_sub_ss() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_sub_ss(a, b);
+ assert_eq_m128(r, _mm_setr_ps(99.0, 5.0, 0.0, -10.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_mul_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_mul_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(100.0, 100.0, 0.0, 50.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_mul_ss() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_mul_ss(a, b);
+ assert_eq_m128(r, _mm_setr_ps(100.0, 5.0, 0.0, -10.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_div_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 2.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.2, -5.0);
+ let r = _mm_div_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(0.01, 0.25, 10.0, 2.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_div_ss() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_div_ss(a, b);
+ assert_eq_m128(r, _mm_setr_ps(0.01, 5.0, 0.0, -10.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_sqrt_ss() {
+ let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0);
+ let r = _mm_sqrt_ss(a);
+ let e = _mm_setr_ps(2.0, 13.0, 16.0, 100.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_sqrt_ps() {
+ let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0);
+ let r = _mm_sqrt_ps(a);
+ let e = _mm_setr_ps(2.0, 3.6055512, 4.0, 10.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_rcp_ss() {
+ let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0);
+ let r = _mm_rcp_ss(a);
+ let e = _mm_setr_ps(0.24993896, 13.0, 16.0, 100.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_rcp_ps() {
+ let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0);
+ let r = _mm_rcp_ps(a);
+ let e = _mm_setr_ps(0.24993896, 0.0769043, 0.06248474, 0.0099983215);
+ let rel_err = 0.00048828125;
+ for i in 0..4 {
+ assert_approx_eq!(get_m128(r, i), get_m128(e, i), 2. * rel_err);
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_rsqrt_ss() {
+ let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0);
+ let r = _mm_rsqrt_ss(a);
+ let e = _mm_setr_ps(0.49987793, 13.0, 16.0, 100.0);
+ let rel_err = 0.00048828125;
+ for i in 0..4 {
+ assert_approx_eq!(get_m128(r, i), get_m128(e, i), 2. * rel_err);
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_rsqrt_ps() {
+ let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0);
+ let r = _mm_rsqrt_ps(a);
+ let e = _mm_setr_ps(0.49987793, 0.2772827, 0.24993896, 0.099990845);
+ let rel_err = 0.00048828125;
+ for i in 0..4 {
+ assert_approx_eq!(get_m128(r, i), get_m128(e, i), 2. * rel_err);
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_min_ss() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_min_ss(a, b);
+ assert_eq_m128(r, _mm_setr_ps(-100.0, 5.0, 0.0, -10.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_min_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_min_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(-100.0, 5.0, 0.0, -10.0));
+
+ // `_mm_min_ps` can **not** be implemented using the `simd_min` rust intrinsic. `simd_min`
+ // is lowered by the llvm codegen backend to `llvm.minnum.v*` llvm intrinsic. This intrinsic
+ // doesn't specify how -0.0 is handled. Unfortunately it happens to behave different from
+ // the `minps` x86 instruction on x86. The `llvm.minnum.v*` llvm intrinsic equals
+ // `r1` to `a` and `r2` to `b`.
+ let a = _mm_setr_ps(-0.0, 0.0, 0.0, 0.0);
+ let b = _mm_setr_ps(0.0, 0.0, 0.0, 0.0);
+ let r1: [u8; 16] = transmute(_mm_min_ps(a, b));
+ let r2: [u8; 16] = transmute(_mm_min_ps(b, a));
+ let a: [u8; 16] = transmute(a);
+ let b: [u8; 16] = transmute(b);
+ assert_eq!(r1, b);
+ assert_eq!(r2, a);
+ assert_ne!(a, b); // sanity check that -0.0 is actually present
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_max_ss() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_max_ss(a, b);
+ assert_eq_m128(r, _mm_setr_ps(-1.0, 5.0, 0.0, -10.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_max_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_max_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(-1.0, 20.0, 0.0, -5.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_and_ps() {
+ let a = transmute(u32x4::splat(0b0011));
+ let b = transmute(u32x4::splat(0b0101));
+ let r = _mm_and_ps(*black_box(&a), *black_box(&b));
+ let e = transmute(u32x4::splat(0b0001));
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_andnot_ps() {
+ let a = transmute(u32x4::splat(0b0011));
+ let b = transmute(u32x4::splat(0b0101));
+ let r = _mm_andnot_ps(*black_box(&a), *black_box(&b));
+ let e = transmute(u32x4::splat(0b0100));
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_or_ps() {
+ let a = transmute(u32x4::splat(0b0011));
+ let b = transmute(u32x4::splat(0b0101));
+ let r = _mm_or_ps(*black_box(&a), *black_box(&b));
+ let e = transmute(u32x4::splat(0b0111));
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_xor_ps() {
+ let a = transmute(u32x4::splat(0b0011));
+ let b = transmute(u32x4::splat(0b0101));
+ let r = _mm_xor_ps(*black_box(&a), *black_box(&b));
+ let e = transmute(u32x4::splat(0b0110));
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpeq_ss() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(-1.0, 5.0, 6.0, 7.0);
+ let r: u32x4 = transmute(_mm_cmpeq_ss(a, b));
+ let e: u32x4 = transmute(_mm_setr_ps(transmute(0u32), 2.0, 3.0, 4.0));
+ assert_eq!(r, e);
+
+ let b2 = _mm_setr_ps(1.0, 5.0, 6.0, 7.0);
+ let r2: u32x4 = transmute(_mm_cmpeq_ss(a, b2));
+ let e2: u32x4 = transmute(_mm_setr_ps(transmute(0xffffffffu32), 2.0, 3.0, 4.0));
+ assert_eq!(r2, e2);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmplt_ss() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(1.0, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = 0u32; // a.extract(0) < b.extract(0)
+ let c1 = 0u32; // a.extract(0) < c.extract(0)
+ let d1 = !0u32; // a.extract(0) < d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmplt_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmplt_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmplt_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmple_ss() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(1.0, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = 0u32; // a.extract(0) <= b.extract(0)
+ let c1 = !0u32; // a.extract(0) <= c.extract(0)
+ let d1 = !0u32; // a.extract(0) <= d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmple_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmple_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmple_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpgt_ss() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(1.0, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = !0u32; // a.extract(0) > b.extract(0)
+ let c1 = 0u32; // a.extract(0) > c.extract(0)
+ let d1 = 0u32; // a.extract(0) > d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmpgt_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmpgt_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmpgt_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpge_ss() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(1.0, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = !0u32; // a.extract(0) >= b.extract(0)
+ let c1 = !0u32; // a.extract(0) >= c.extract(0)
+ let d1 = 0u32; // a.extract(0) >= d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmpge_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmpge_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmpge_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpneq_ss() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(1.0, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = !0u32; // a.extract(0) != b.extract(0)
+ let c1 = 0u32; // a.extract(0) != c.extract(0)
+ let d1 = !0u32; // a.extract(0) != d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmpneq_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmpneq_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmpneq_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpnlt_ss() {
+ // TODO: this test is exactly the same as for `_mm_cmpge_ss`, but there
+ // must be a difference. It may have to do with behavior in the
+ // presence of NaNs (signaling or quiet). If so, we should add tests
+ // for those.
+
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(1.0, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = !0u32; // a.extract(0) >= b.extract(0)
+ let c1 = !0u32; // a.extract(0) >= c.extract(0)
+ let d1 = 0u32; // a.extract(0) >= d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmpnlt_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmpnlt_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmpnlt_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpnle_ss() {
+ // TODO: this test is exactly the same as for `_mm_cmpgt_ss`, but there
+ // must be a difference. It may have to do with behavior in the
+ // presence
+ // of NaNs (signaling or quiet). If so, we should add tests for those.
+
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(1.0, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = !0u32; // a.extract(0) > b.extract(0)
+ let c1 = 0u32; // a.extract(0) > c.extract(0)
+ let d1 = 0u32; // a.extract(0) > d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmpnle_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmpnle_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmpnle_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpngt_ss() {
+ // TODO: this test is exactly the same as for `_mm_cmple_ss`, but there
+ // must be a difference. It may have to do with behavior in the
+ // presence of NaNs (signaling or quiet). If so, we should add tests
+ // for those.
+
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(1.0, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = 0u32; // a.extract(0) <= b.extract(0)
+ let c1 = !0u32; // a.extract(0) <= c.extract(0)
+ let d1 = !0u32; // a.extract(0) <= d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmpngt_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmpngt_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmpngt_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpnge_ss() {
+ // TODO: this test is exactly the same as for `_mm_cmplt_ss`, but there
+ // must be a difference. It may have to do with behavior in the
+ // presence of NaNs (signaling or quiet). If so, we should add tests
+ // for those.
+
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(1.0, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = 0u32; // a.extract(0) < b.extract(0)
+ let c1 = 0u32; // a.extract(0) < c.extract(0)
+ let d1 = !0u32; // a.extract(0) < d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmpnge_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmpnge_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmpnge_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpord_ss() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(NAN, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = !0u32; // a.extract(0) ord b.extract(0)
+ let c1 = 0u32; // a.extract(0) ord c.extract(0)
+ let d1 = !0u32; // a.extract(0) ord d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmpord_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmpord_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmpord_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpunord_ss() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(0.0, 5.0, 6.0, 7.0);
+ let c = _mm_setr_ps(NAN, 5.0, 6.0, 7.0);
+ let d = _mm_setr_ps(2.0, 5.0, 6.0, 7.0);
+
+ let b1 = 0u32; // a.extract(0) unord b.extract(0)
+ let c1 = !0u32; // a.extract(0) unord c.extract(0)
+ let d1 = 0u32; // a.extract(0) unord d.extract(0)
+
+ let rb: u32x4 = transmute(_mm_cmpunord_ss(a, b));
+ let eb: u32x4 = transmute(_mm_setr_ps(transmute(b1), 2.0, 3.0, 4.0));
+ assert_eq!(rb, eb);
+
+ let rc: u32x4 = transmute(_mm_cmpunord_ss(a, c));
+ let ec: u32x4 = transmute(_mm_setr_ps(transmute(c1), 2.0, 3.0, 4.0));
+ assert_eq!(rc, ec);
+
+ let rd: u32x4 = transmute(_mm_cmpunord_ss(a, d));
+ let ed: u32x4 = transmute(_mm_setr_ps(transmute(d1), 2.0, 3.0, 4.0));
+ assert_eq!(rd, ed);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpeq_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, 1.0, NAN);
+ let b = _mm_setr_ps(15.0, 20.0, 1.0, NAN);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(fls, fls, tru, fls);
+ let r: u32x4 = transmute(_mm_cmpeq_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmplt_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, 1.0, NAN);
+ let b = _mm_setr_ps(15.0, 20.0, 1.0, NAN);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(tru, fls, fls, fls);
+ let r: u32x4 = transmute(_mm_cmplt_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmple_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, 1.0, 4.0);
+ let b = _mm_setr_ps(15.0, 20.0, 1.0, NAN);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(tru, fls, tru, fls);
+ let r: u32x4 = transmute(_mm_cmple_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpgt_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, 1.0, NAN);
+ let b = _mm_setr_ps(15.0, 20.0, 1.0, 42.0);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(fls, tru, fls, fls);
+ let r: u32x4 = transmute(_mm_cmpgt_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpge_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, 1.0, NAN);
+ let b = _mm_setr_ps(15.0, 20.0, 1.0, 42.0);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(fls, tru, tru, fls);
+ let r: u32x4 = transmute(_mm_cmpge_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpneq_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, 1.0, NAN);
+ let b = _mm_setr_ps(15.0, 20.0, 1.0, NAN);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(tru, tru, fls, tru);
+ let r: u32x4 = transmute(_mm_cmpneq_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpnlt_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, 1.0, NAN);
+ let b = _mm_setr_ps(15.0, 20.0, 1.0, 5.0);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(fls, tru, tru, tru);
+ let r: u32x4 = transmute(_mm_cmpnlt_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpnle_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, 1.0, NAN);
+ let b = _mm_setr_ps(15.0, 20.0, 1.0, 5.0);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(fls, tru, fls, tru);
+ let r: u32x4 = transmute(_mm_cmpnle_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpngt_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, 1.0, NAN);
+ let b = _mm_setr_ps(15.0, 20.0, 1.0, 5.0);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(tru, fls, tru, tru);
+ let r: u32x4 = transmute(_mm_cmpngt_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpnge_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, 1.0, NAN);
+ let b = _mm_setr_ps(15.0, 20.0, 1.0, 5.0);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(tru, fls, fls, tru);
+ let r: u32x4 = transmute(_mm_cmpnge_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpord_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, NAN, NAN);
+ let b = _mm_setr_ps(15.0, NAN, 1.0, NAN);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(tru, fls, fls, fls);
+ let r: u32x4 = transmute(_mm_cmpord_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cmpunord_ps() {
+ let a = _mm_setr_ps(10.0, 50.0, NAN, NAN);
+ let b = _mm_setr_ps(15.0, NAN, 1.0, NAN);
+ let tru = !0u32;
+ let fls = 0u32;
+
+ let e = u32x4::new(fls, tru, tru, tru);
+ let r: u32x4 = transmute(_mm_cmpunord_ps(a, b));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_comieq_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[1i32, 0, 0, 0];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_comieq_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_comieq_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_comilt_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[0i32, 1, 0, 0];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_comilt_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_comilt_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_comile_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[1i32, 1, 0, 0];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_comile_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_comile_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_comigt_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[1i32, 0, 1, 0];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_comige_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_comige_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_comineq_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[0i32, 1, 1, 1];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_comineq_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_comineq_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_ucomieq_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[1i32, 0, 0, 0];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_ucomieq_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_ucomieq_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_ucomilt_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[0i32, 1, 0, 0];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_ucomilt_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_ucomilt_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_ucomile_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[1i32, 1, 0, 0];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_ucomile_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_ucomile_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_ucomigt_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[0i32, 0, 1, 0];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_ucomigt_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_ucomigt_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_ucomige_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[1i32, 0, 1, 0];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_ucomige_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_ucomige_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_ucomineq_ss() {
+ let aa = &[3.0f32, 12.0, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, 1.5, NAN];
+
+ let ee = &[0i32, 1, 1, 1];
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ let r = _mm_ucomineq_ss(a, b);
+
+ assert_eq!(
+ ee[i], r,
+ "_mm_ucomineq_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r, ee[i], i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_comieq_ss_vs_ucomieq_ss() {
+ // If one of the arguments is a quiet NaN `comieq_ss` should signal an
+ // Invalid Operation Exception while `ucomieq_ss` should not.
+ let aa = &[3.0f32, NAN, 23.0, NAN];
+ let bb = &[3.0f32, 47.5, NAN, NAN];
+
+ let ee = &[1i32, 0, 0, 0];
+ let exc = &[0u32, 1, 1, 1]; // Should comieq_ss signal an exception?
+
+ for i in 0..4 {
+ let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0);
+ let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0);
+
+ _MM_SET_EXCEPTION_STATE(0);
+ let r1 = _mm_comieq_ss(*black_box(&a), b);
+ let s1 = _MM_GET_EXCEPTION_STATE();
+
+ _MM_SET_EXCEPTION_STATE(0);
+ let r2 = _mm_ucomieq_ss(*black_box(&a), b);
+ let s2 = _MM_GET_EXCEPTION_STATE();
+
+ assert_eq!(
+ ee[i], r1,
+ "_mm_comeq_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r1, ee[i], i
+ );
+ assert_eq!(
+ ee[i], r2,
+ "_mm_ucomeq_ss({:?}, {:?}) = {}, expected: {} (i={})",
+ a, b, r2, ee[i], i
+ );
+ assert_eq!(
+ s1,
+ exc[i] * _MM_EXCEPT_INVALID,
+ "_mm_comieq_ss() set exception flags: {} (i={})",
+ s1,
+ i
+ );
+ assert_eq!(
+ s2,
+ 0, // ucomieq_ss should not signal an exception
+ "_mm_ucomieq_ss() set exception flags: {} (i={})",
+ s2,
+ i
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cvtss_si32() {
+ let inputs = &[42.0f32, -3.1, 4.0e10, 4.0e-20, NAN, 2147483500.1];
+ let result = &[42i32, -3, i32::MIN, 0, i32::MIN, 2147483520];
+ for i in 0..inputs.len() {
+ let x = _mm_setr_ps(inputs[i], 1.0, 3.0, 4.0);
+ let e = result[i];
+ let r = _mm_cvtss_si32(x);
+ assert_eq!(
+ e, r,
+ "TestCase #{} _mm_cvtss_si32({:?}) = {}, expected: {}",
+ i, x, r, e
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cvttss_si32() {
+ let inputs = &[
+ (42.0f32, 42i32),
+ (-31.4, -31),
+ (-33.5, -33),
+ (-34.5, -34),
+ (10.999, 10),
+ (-5.99, -5),
+ (4.0e10, i32::MIN),
+ (4.0e-10, 0),
+ (NAN, i32::MIN),
+ (2147483500.1, 2147483520),
+ ];
+ for i in 0..inputs.len() {
+ let (xi, e) = inputs[i];
+ let x = _mm_setr_ps(xi, 1.0, 3.0, 4.0);
+ let r = _mm_cvttss_si32(x);
+ assert_eq!(
+ e, r,
+ "TestCase #{} _mm_cvttss_si32({:?}) = {}, expected: {}",
+ i, x, r, e
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cvtsi32_ss() {
+ let inputs = &[
+ (4555i32, 4555.0f32),
+ (322223333, 322223330.0),
+ (-432, -432.0),
+ (-322223333, -322223330.0),
+ ];
+
+ for i in 0..inputs.len() {
+ let (x, f) = inputs[i];
+ let a = _mm_setr_ps(5.0, 6.0, 7.0, 8.0);
+ let r = _mm_cvtsi32_ss(a, x);
+ let e = _mm_setr_ps(f, 6.0, 7.0, 8.0);
+ assert_eq_m128(e, r);
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cvtss_f32() {
+ let a = _mm_setr_ps(312.0134, 5.0, 6.0, 7.0);
+ assert_eq!(_mm_cvtss_f32(a), 312.0134);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_set_ss() {
+ let r = _mm_set_ss(black_box(4.25));
+ assert_eq_m128(r, _mm_setr_ps(4.25, 0.0, 0.0, 0.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_set1_ps() {
+ let r1 = _mm_set1_ps(black_box(4.25));
+ let r2 = _mm_set_ps1(black_box(4.25));
+ assert_eq!(get_m128(r1, 0), 4.25);
+ assert_eq!(get_m128(r1, 1), 4.25);
+ assert_eq!(get_m128(r1, 2), 4.25);
+ assert_eq!(get_m128(r1, 3), 4.25);
+ assert_eq!(get_m128(r2, 0), 4.25);
+ assert_eq!(get_m128(r2, 1), 4.25);
+ assert_eq!(get_m128(r2, 2), 4.25);
+ assert_eq!(get_m128(r2, 3), 4.25);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_set_ps() {
+ let r = _mm_set_ps(
+ black_box(1.0),
+ black_box(2.0),
+ black_box(3.0),
+ black_box(4.0),
+ );
+ assert_eq!(get_m128(r, 0), 4.0);
+ assert_eq!(get_m128(r, 1), 3.0);
+ assert_eq!(get_m128(r, 2), 2.0);
+ assert_eq!(get_m128(r, 3), 1.0);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_setr_ps() {
+ let r = _mm_setr_ps(
+ black_box(1.0),
+ black_box(2.0),
+ black_box(3.0),
+ black_box(4.0),
+ );
+ assert_eq_m128(r, _mm_setr_ps(1.0, 2.0, 3.0, 4.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_setzero_ps() {
+ let r = *black_box(&_mm_setzero_ps());
+ assert_eq_m128(r, _mm_set1_ps(0.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_shuffle() {
+ assert_eq!(_MM_SHUFFLE(0, 1, 1, 3), 0b00_01_01_11);
+ assert_eq!(_MM_SHUFFLE(3, 1, 1, 0), 0b11_01_01_00);
+ assert_eq!(_MM_SHUFFLE(1, 2, 2, 1), 0b01_10_10_01);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_shuffle_ps() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0);
+ let r = _mm_shuffle_ps::<0b00_01_01_11>(a, b);
+ assert_eq_m128(r, _mm_setr_ps(4.0, 2.0, 6.0, 5.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_unpackhi_ps() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0);
+ let r = _mm_unpackhi_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(3.0, 7.0, 4.0, 8.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_unpacklo_ps() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0);
+ let r = _mm_unpacklo_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(1.0, 5.0, 2.0, 6.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_movehl_ps() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0);
+ let r = _mm_movehl_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(7.0, 8.0, 3.0, 4.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_movelh_ps() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0);
+ let r = _mm_movelh_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(1.0, 2.0, 5.0, 6.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_load_ss() {
+ let a = 42.0f32;
+ let r = _mm_load_ss(&a as *const f32);
+ assert_eq_m128(r, _mm_setr_ps(42.0, 0.0, 0.0, 0.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_load1_ps() {
+ let a = 42.0f32;
+ let r = _mm_load1_ps(&a as *const f32);
+ assert_eq_m128(r, _mm_setr_ps(42.0, 42.0, 42.0, 42.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_load_ps() {
+ let vals = &[1.0f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0];
+
+ let mut p = vals.as_ptr();
+ let mut fixup = 0.0f32;
+
+ // Make sure p is aligned, otherwise we might get a
+ // (signal: 11, SIGSEGV: invalid memory reference)
+
+ let unalignment = (p as usize) & 0xf;
+ if unalignment != 0 {
+ let delta = ((16 - unalignment) >> 2) as isize;
+ fixup = delta as f32;
+ p = p.offset(delta);
+ }
+
+ let r = _mm_load_ps(p);
+ let e = _mm_add_ps(_mm_setr_ps(1.0, 2.0, 3.0, 4.0), _mm_set1_ps(fixup));
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_loadu_ps() {
+ let vals = &[1.0f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0];
+ let p = vals.as_ptr().offset(3);
+ let r = _mm_loadu_ps(black_box(p));
+ assert_eq_m128(r, _mm_setr_ps(4.0, 5.0, 6.0, 7.0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_loadr_ps() {
+ let vals = &[1.0f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0];
+
+ let mut p = vals.as_ptr();
+ let mut fixup = 0.0f32;
+
+ // Make sure p is aligned, otherwise we might get a
+ // (signal: 11, SIGSEGV: invalid memory reference)
+
+ let unalignment = (p as usize) & 0xf;
+ if unalignment != 0 {
+ let delta = ((16 - unalignment) >> 2) as isize;
+ fixup = delta as f32;
+ p = p.offset(delta);
+ }
+
+ let r = _mm_loadr_ps(p);
+ let e = _mm_add_ps(_mm_setr_ps(4.0, 3.0, 2.0, 1.0), _mm_set1_ps(fixup));
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_loadu_si64() {
+ let a = _mm_setr_epi64x(5, 6);
+ let r = _mm_loadu_si64(&a as *const _ as *const _);
+ assert_eq_m128i(r, _mm_setr_epi64x(5, 0));
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_store_ss() {
+ let mut vals = [0.0f32; 8];
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ _mm_store_ss(vals.as_mut_ptr().offset(1), a);
+
+ assert_eq!(vals[0], 0.0);
+ assert_eq!(vals[1], 1.0);
+ assert_eq!(vals[2], 0.0);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_store1_ps() {
+ let mut vals = [0.0f32; 8];
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+
+ let mut ofs = 0;
+ let mut p = vals.as_mut_ptr();
+
+ if (p as usize) & 0xf != 0 {
+ ofs = ((16 - (p as usize)) & 0xf) >> 2;
+ p = p.add(ofs);
+ }
+
+ _mm_store1_ps(p, *black_box(&a));
+
+ if ofs > 0 {
+ assert_eq!(vals[ofs - 1], 0.0);
+ }
+ assert_eq!(vals[ofs + 0], 1.0);
+ assert_eq!(vals[ofs + 1], 1.0);
+ assert_eq!(vals[ofs + 2], 1.0);
+ assert_eq!(vals[ofs + 3], 1.0);
+ assert_eq!(vals[ofs + 4], 0.0);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_store_ps() {
+ let mut vals = [0.0f32; 8];
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+
+ let mut ofs = 0;
+ let mut p = vals.as_mut_ptr();
+
+ // Align p to 16-byte boundary
+ if (p as usize) & 0xf != 0 {
+ ofs = ((16 - (p as usize)) & 0xf) >> 2;
+ p = p.add(ofs);
+ }
+
+ _mm_store_ps(p, *black_box(&a));
+
+ if ofs > 0 {
+ assert_eq!(vals[ofs - 1], 0.0);
+ }
+ assert_eq!(vals[ofs + 0], 1.0);
+ assert_eq!(vals[ofs + 1], 2.0);
+ assert_eq!(vals[ofs + 2], 3.0);
+ assert_eq!(vals[ofs + 3], 4.0);
+ assert_eq!(vals[ofs + 4], 0.0);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_storer_ps() {
+ let mut vals = [0.0f32; 8];
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+
+ let mut ofs = 0;
+ let mut p = vals.as_mut_ptr();
+
+ // Align p to 16-byte boundary
+ if (p as usize) & 0xf != 0 {
+ ofs = ((16 - (p as usize)) & 0xf) >> 2;
+ p = p.add(ofs);
+ }
+
+ _mm_storer_ps(p, *black_box(&a));
+
+ if ofs > 0 {
+ assert_eq!(vals[ofs - 1], 0.0);
+ }
+ assert_eq!(vals[ofs + 0], 4.0);
+ assert_eq!(vals[ofs + 1], 3.0);
+ assert_eq!(vals[ofs + 2], 2.0);
+ assert_eq!(vals[ofs + 3], 1.0);
+ assert_eq!(vals[ofs + 4], 0.0);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_storeu_ps() {
+ let mut vals = [0.0f32; 8];
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+
+ let mut ofs = 0;
+ let mut p = vals.as_mut_ptr();
+
+ // Make sure p is **not** aligned to 16-byte boundary
+ if (p as usize) & 0xf == 0 {
+ ofs = 1;
+ p = p.offset(1);
+ }
+
+ _mm_storeu_ps(p, *black_box(&a));
+
+ if ofs > 0 {
+ assert_eq!(vals[ofs - 1], 0.0);
+ }
+ assert_eq!(vals[ofs + 0], 1.0);
+ assert_eq!(vals[ofs + 1], 2.0);
+ assert_eq!(vals[ofs + 2], 3.0);
+ assert_eq!(vals[ofs + 3], 4.0);
+ assert_eq!(vals[ofs + 4], 0.0);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_move_ss() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0);
+
+ let r = _mm_move_ss(a, b);
+ let e = _mm_setr_ps(5.0, 2.0, 3.0, 4.0);
+ assert_eq_m128(e, r);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_movemask_ps() {
+ let r = _mm_movemask_ps(_mm_setr_ps(-1.0, 5.0, -5.0, 0.0));
+ assert_eq!(r, 0b0101);
+
+ let r = _mm_movemask_ps(_mm_setr_ps(-1.0, -5.0, -5.0, 0.0));
+ assert_eq!(r, 0b0111);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_sfence() {
+ _mm_sfence();
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_getcsr_setcsr_1() {
+ let saved_csr = _mm_getcsr();
+
+ let a = _mm_setr_ps(1.1e-36, 0.0, 0.0, 1.0);
+ let b = _mm_setr_ps(0.001, 0.0, 0.0, 1.0);
+
+ _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
+ let r = _mm_mul_ps(*black_box(&a), *black_box(&b));
+
+ _mm_setcsr(saved_csr);
+
+ let exp = _mm_setr_ps(0.0, 0.0, 0.0, 1.0);
+ assert_eq_m128(r, exp); // first component is a denormalized f32
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_getcsr_setcsr_2() {
+ // Same as _mm_setcsr_1 test, but with opposite flag value.
+
+ let saved_csr = _mm_getcsr();
+
+ let a = _mm_setr_ps(1.1e-36, 0.0, 0.0, 1.0);
+ let b = _mm_setr_ps(0.001, 0.0, 0.0, 1.0);
+
+ _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_OFF);
+ let r = _mm_mul_ps(*black_box(&a), *black_box(&b));
+
+ _mm_setcsr(saved_csr);
+
+ let exp = _mm_setr_ps(1.1e-39, 0.0, 0.0, 1.0);
+ assert_eq_m128(r, exp); // first component is a denormalized f32
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_getcsr_setcsr_underflow() {
+ _MM_SET_EXCEPTION_STATE(0);
+
+ let a = _mm_setr_ps(1.1e-36, 0.0, 0.0, 1.0);
+ let b = _mm_setr_ps(1e-5, 0.0, 0.0, 1.0);
+
+ assert_eq!(_MM_GET_EXCEPTION_STATE(), 0); // just to be sure
+
+ let r = _mm_mul_ps(*black_box(&a), *black_box(&b));
+
+ let exp = _mm_setr_ps(1.1e-41, 0.0, 0.0, 1.0);
+ assert_eq_m128(r, exp);
+
+ let underflow = _MM_GET_EXCEPTION_STATE() & _MM_EXCEPT_UNDERFLOW != 0;
+ assert_eq!(underflow, true);
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_MM_TRANSPOSE4_PS() {
+ let mut a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let mut b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0);
+ let mut c = _mm_setr_ps(9.0, 10.0, 11.0, 12.0);
+ let mut d = _mm_setr_ps(13.0, 14.0, 15.0, 16.0);
+
+ _MM_TRANSPOSE4_PS(&mut a, &mut b, &mut c, &mut d);
+
+ assert_eq_m128(a, _mm_setr_ps(1.0, 5.0, 9.0, 13.0));
+ assert_eq_m128(b, _mm_setr_ps(2.0, 6.0, 10.0, 14.0));
+ assert_eq_m128(c, _mm_setr_ps(3.0, 7.0, 11.0, 15.0));
+ assert_eq_m128(d, _mm_setr_ps(4.0, 8.0, 12.0, 16.0));
+ }
+
+ #[repr(align(16))]
+ struct Memory {
+ pub data: [f32; 4],
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_stream_ps() {
+ let a = _mm_set1_ps(7.0);
+ let mut mem = Memory { data: [-1.0; 4] };
+
+ _mm_stream_ps(&mut mem.data[0] as *mut f32, a);
+ for i in 0..4 {
+ assert_eq!(mem.data[i], get_m128(a, i));
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/sse2.rs b/library/stdarch/crates/core_arch/src/x86/sse2.rs
new file mode 100644
index 000000000..5a9120042
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/sse2.rs
@@ -0,0 +1,4886 @@
+//! Streaming SIMD Extensions 2 (SSE2)
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ intrinsics,
+ mem::{self, transmute},
+ ptr,
+};
+
+/// Provides a hint to the processor that the code sequence is a spin-wait loop.
+///
+/// This can help improve the performance and power consumption of spin-wait
+/// loops.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_pause)
+#[inline]
+#[cfg_attr(all(test, target_feature = "sse2"), assert_instr(pause))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_pause() {
+ // note: `pause` is guaranteed to be interpreted as a `nop` by CPUs without
+ // the SSE2 target-feature - therefore it does not require any target features
+ pause()
+}
+
+/// Invalidates and flushes the cache line that contains `p` from all levels of
+/// the cache hierarchy.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_clflush)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(clflush))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_clflush(p: *const u8) {
+ clflush(p)
+}
+
+/// Performs a serializing operation on all load-from-memory instructions
+/// that were issued prior to this instruction.
+///
+/// Guarantees that every load instruction that precedes, in program order, is
+/// globally visible before any load instruction which follows the fence in
+/// program order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_lfence)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(lfence))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_lfence() {
+ lfence()
+}
+
+/// Performs a serializing operation on all load-from-memory and store-to-memory
+/// instructions that were issued prior to this instruction.
+///
+/// Guarantees that every memory access that precedes, in program order, the
+/// memory fence instruction is globally visible before any memory instruction
+/// which follows the fence in program order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mfence)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(mfence))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mfence() {
+ mfence()
+}
+
+/// Adds packed 8-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_add_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(paddb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_add_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_add(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Adds packed 16-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_add_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(paddw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_add_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_add(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Adds packed 32-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_add_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(paddd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_add_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_add(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Adds packed 64-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_add_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(paddq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_add_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_add(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Adds packed 8-bit integers in `a` and `b` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_adds_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(paddsb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_adds_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_saturating_add(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Adds packed 16-bit integers in `a` and `b` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_adds_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(paddsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_adds_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_saturating_add(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Adds packed unsigned 8-bit integers in `a` and `b` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_adds_epu8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(paddusb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_adds_epu8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_saturating_add(a.as_u8x16(), b.as_u8x16()))
+}
+
+/// Adds packed unsigned 16-bit integers in `a` and `b` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_adds_epu16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(paddusw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_adds_epu16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_saturating_add(a.as_u16x8(), b.as_u16x8()))
+}
+
+/// Averages packed unsigned 8-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_avg_epu8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pavgb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_avg_epu8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pavgb(a.as_u8x16(), b.as_u8x16()))
+}
+
+/// Averages packed unsigned 16-bit integers in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_avg_epu16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pavgw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_avg_epu16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pavgw(a.as_u16x8(), b.as_u16x8()))
+}
+
+/// Multiplies and then horizontally add signed 16 bit integers in `a` and `b`.
+///
+/// Multiplies packed signed 16-bit integers in `a` and `b`, producing
+/// intermediate signed 32-bit integers. Horizontally add adjacent pairs of
+/// intermediate 32-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_madd_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pmaddwd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_madd_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmaddwd(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Compares packed 16-bit integers in `a` and `b`, and returns the packed
+/// maximum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pmaxsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_max_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmaxsw(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Compares packed unsigned 8-bit integers in `a` and `b`, and returns the
+/// packed maximum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_epu8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pmaxub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_max_epu8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmaxub(a.as_u8x16(), b.as_u8x16()))
+}
+
+/// Compares packed 16-bit integers in `a` and `b`, and returns the packed
+/// minimum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pminsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_min_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pminsw(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Compares packed unsigned 8-bit integers in `a` and `b`, and returns the
+/// packed minimum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_epu8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pminub))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_min_epu8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pminub(a.as_u8x16(), b.as_u8x16()))
+}
+
+/// Multiplies the packed 16-bit integers in `a` and `b`.
+///
+/// The multiplication produces intermediate 32-bit integers, and returns the
+/// high 16 bits of the intermediate integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mulhi_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pmulhw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mulhi_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmulhw(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Multiplies the packed unsigned 16-bit integers in `a` and `b`.
+///
+/// The multiplication produces intermediate 32-bit integers, and returns the
+/// high 16 bits of the intermediate integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mulhi_epu16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pmulhuw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mulhi_epu16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmulhuw(a.as_u16x8(), b.as_u16x8()))
+}
+
+/// Multiplies the packed 16-bit integers in `a` and `b`.
+///
+/// The multiplication produces intermediate 32-bit integers, and returns the
+/// low 16 bits of the intermediate integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mullo_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pmullw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mullo_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_mul(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Multiplies the low unsigned 32-bit integers from each packed 64-bit element
+/// in `a` and `b`.
+///
+/// Returns the unsigned 64-bit results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mul_epu32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pmuludq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mul_epu32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmuludq(a.as_u32x4(), b.as_u32x4()))
+}
+
+/// Sum the absolute differences of packed unsigned 8-bit integers.
+///
+/// Computes the absolute differences of packed unsigned 8-bit integers in `a`
+/// and `b`, then horizontally sum each consecutive 8 differences to produce
+/// two unsigned 16-bit integers, and pack these unsigned 16-bit integers in
+/// the low 16 bits of 64-bit elements returned.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sad_epu8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psadbw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sad_epu8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(psadbw(a.as_u8x16(), b.as_u8x16()))
+}
+
+/// Subtracts packed 8-bit integers in `b` from packed 8-bit integers in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sub_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psubb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sub_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_sub(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Subtracts packed 16-bit integers in `b` from packed 16-bit integers in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sub_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psubw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sub_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_sub(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Subtract packed 32-bit integers in `b` from packed 32-bit integers in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sub_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psubd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sub_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_sub(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Subtract packed 64-bit integers in `b` from packed 64-bit integers in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sub_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psubq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sub_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_sub(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Subtract packed 8-bit integers in `b` from packed 8-bit integers in `a`
+/// using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_subs_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psubsb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_subs_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_saturating_sub(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Subtract packed 16-bit integers in `b` from packed 16-bit integers in `a`
+/// using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_subs_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psubsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_subs_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_saturating_sub(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Subtract packed unsigned 8-bit integers in `b` from packed unsigned 8-bit
+/// integers in `a` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_subs_epu8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psubusb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_subs_epu8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_saturating_sub(a.as_u8x16(), b.as_u8x16()))
+}
+
+/// Subtract packed unsigned 16-bit integers in `b` from packed unsigned 16-bit
+/// integers in `a` using saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_subs_epu16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psubusw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_subs_epu16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_saturating_sub(a.as_u16x8(), b.as_u16x8()))
+}
+
+/// Shifts `a` left by `IMM8` bytes while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_slli_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pslldq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_slli_si128<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ _mm_slli_si128_impl::<IMM8>(a)
+}
+
+/// Implementation detail: converts the immediate argument of the
+/// `_mm_slli_si128` intrinsic into a compile-time constant.
+#[inline]
+#[target_feature(enable = "sse2")]
+unsafe fn _mm_slli_si128_impl<const IMM8: i32>(a: __m128i) -> __m128i {
+ const fn mask(shift: i32, i: u32) -> u32 {
+ let shift = shift as u32 & 0xff;
+ if shift > 15 {
+ i
+ } else {
+ 16 - shift + i
+ }
+ }
+ let zero = _mm_set1_epi8(0).as_i8x16();
+ transmute::<i8x16, _>(simd_shuffle16!(
+ zero,
+ a.as_i8x16(),
+ <const IMM8: i32> [
+ 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),
+ ],
+ ))
+}
+
+/// Shifts `a` left by `IMM8` bytes while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_bslli_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pslldq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_bslli_si128<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ _mm_slli_si128_impl::<IMM8>(a)
+}
+
+/// Shifts `a` right by `IMM8` bytes while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_bsrli_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psrldq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_bsrli_si128<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ _mm_srli_si128_impl::<IMM8>(a)
+}
+
+/// Shifts packed 16-bit integers in `a` left by `IMM8` while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_slli_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psllw, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_slli_epi16<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(pslliw(a.as_i16x8(), IMM8))
+}
+
+/// Shifts packed 16-bit integers in `a` left by `count` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sll_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psllw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sll_epi16(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psllw(a.as_i16x8(), count.as_i16x8()))
+}
+
+/// Shifts packed 32-bit integers in `a` left by `IMM8` while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_slli_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pslld, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_slli_epi32<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(psllid(a.as_i32x4(), IMM8))
+}
+
+/// Shifts packed 32-bit integers in `a` left by `count` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sll_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pslld))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sll_epi32(a: __m128i, count: __m128i) -> __m128i {
+ transmute(pslld(a.as_i32x4(), count.as_i32x4()))
+}
+
+/// Shifts packed 64-bit integers in `a` left by `IMM8` while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_slli_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psllq, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_slli_epi64<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(pslliq(a.as_i64x2(), IMM8))
+}
+
+/// Shifts packed 64-bit integers in `a` left by `count` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sll_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psllq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sll_epi64(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psllq(a.as_i64x2(), count.as_i64x2()))
+}
+
+/// Shifts packed 16-bit integers in `a` right by `IMM8` while shifting in sign
+/// bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srai_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psraw, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srai_epi16<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(psraiw(a.as_i16x8(), IMM8))
+}
+
+/// Shifts packed 16-bit integers in `a` right by `count` while shifting in sign
+/// bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sra_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psraw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sra_epi16(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psraw(a.as_i16x8(), count.as_i16x8()))
+}
+
+/// Shifts packed 32-bit integers in `a` right by `IMM8` while shifting in sign
+/// bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srai_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psrad, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srai_epi32<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(psraid(a.as_i32x4(), IMM8))
+}
+
+/// Shifts packed 32-bit integers in `a` right by `count` while shifting in sign
+/// bits.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sra_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psrad))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sra_epi32(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psrad(a.as_i32x4(), count.as_i32x4()))
+}
+
+/// Shifts `a` right by `IMM8` bytes while shifting in zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srli_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psrldq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srli_si128<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ _mm_srli_si128_impl::<IMM8>(a)
+}
+
+/// Implementation detail: converts the immediate argument of the
+/// `_mm_srli_si128` intrinsic into a compile-time constant.
+#[inline]
+#[target_feature(enable = "sse2")]
+unsafe fn _mm_srli_si128_impl<const IMM8: i32>(a: __m128i) -> __m128i {
+ const fn mask(shift: i32, i: u32) -> u32 {
+ if (shift as u32) > 15 {
+ i + 16
+ } else {
+ i + (shift as u32)
+ }
+ }
+ let zero = _mm_set1_epi8(0).as_i8x16();
+ let x: i8x16 = simd_shuffle16!(
+ a.as_i8x16(),
+ zero,
+ <const IMM8: i32> [
+ 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),
+ ],
+ );
+ transmute(x)
+}
+
+/// Shifts packed 16-bit integers in `a` right by `IMM8` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srli_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psrlw, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srli_epi16<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(psrliw(a.as_i16x8(), IMM8))
+}
+
+/// Shifts packed 16-bit integers in `a` right by `count` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srl_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psrlw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srl_epi16(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psrlw(a.as_i16x8(), count.as_i16x8()))
+}
+
+/// Shifts packed 32-bit integers in `a` right by `IMM8` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srli_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psrld, IMM8 = 8))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srli_epi32<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(psrlid(a.as_i32x4(), IMM8))
+}
+
+/// Shifts packed 32-bit integers in `a` right by `count` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srl_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psrld))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srl_epi32(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psrld(a.as_i32x4(), count.as_i32x4()))
+}
+
+/// Shifts packed 64-bit integers in `a` right by `IMM8` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srli_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psrlq, IMM8 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srli_epi64<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(psrliq(a.as_i64x2(), IMM8))
+}
+
+/// Shifts packed 64-bit integers in `a` right by `count` while shifting in
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_srl_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(psrlq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_srl_epi64(a: __m128i, count: __m128i) -> __m128i {
+ transmute(psrlq(a.as_i64x2(), count.as_i64x2()))
+}
+
+/// Computes the bitwise AND of 128 bits (representing integer data) in `a` and
+/// `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_and_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(andps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_and_si128(a: __m128i, b: __m128i) -> __m128i {
+ simd_and(a, b)
+}
+
+/// Computes the bitwise NOT of 128 bits (representing integer data) in `a` and
+/// then AND with `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_andnot_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(andnps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_andnot_si128(a: __m128i, b: __m128i) -> __m128i {
+ simd_and(simd_xor(_mm_set1_epi8(-1), a), b)
+}
+
+/// Computes the bitwise OR of 128 bits (representing integer data) in `a` and
+/// `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_or_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(orps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_or_si128(a: __m128i, b: __m128i) -> __m128i {
+ simd_or(a, b)
+}
+
+/// Computes the bitwise XOR of 128 bits (representing integer data) in `a` and
+/// `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_xor_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(xorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_xor_si128(a: __m128i, b: __m128i) -> __m128i {
+ simd_xor(a, b)
+}
+
+/// Compares packed 8-bit integers in `a` and `b` for equality.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pcmpeqb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpeq_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i8x16, _>(simd_eq(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Compares packed 16-bit integers in `a` and `b` for equality.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pcmpeqw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpeq_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i16x8, _>(simd_eq(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Compares packed 32-bit integers in `a` and `b` for equality.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pcmpeqd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpeq_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i32x4, _>(simd_eq(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compares packed 8-bit integers in `a` and `b` for greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pcmpgtb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpgt_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i8x16, _>(simd_gt(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Compares packed 16-bit integers in `a` and `b` for greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pcmpgtw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpgt_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i16x8, _>(simd_gt(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Compares packed 32-bit integers in `a` and `b` for greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pcmpgtd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpgt_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i32x4, _>(simd_gt(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compares packed 8-bit integers in `a` and `b` for less-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pcmpgtb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmplt_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i8x16, _>(simd_lt(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Compares packed 16-bit integers in `a` and `b` for less-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pcmpgtw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmplt_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i16x8, _>(simd_lt(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Compares packed 32-bit integers in `a` and `b` for less-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pcmpgtd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmplt_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i32x4, _>(simd_lt(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Converts the lower two packed 32-bit integers in `a` to packed
+/// double-precision (64-bit) floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi32_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtdq2pd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepi32_pd(a: __m128i) -> __m128d {
+ let a = a.as_i32x4();
+ simd_cast::<i32x2, __m128d>(simd_shuffle2!(a, a, [0, 1]))
+}
+
+/// Returns `a` with its lower element replaced by `b` after converting it to
+/// an `f64`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsi32_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtsi2sd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi32_sd(a: __m128d, b: i32) -> __m128d {
+ simd_insert(a, 0, b as f64)
+}
+
+/// Converts packed 32-bit integers in `a` to packed single-precision (32-bit)
+/// floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi32_ps)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtdq2ps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepi32_ps(a: __m128i) -> __m128 {
+ cvtdq2ps(a.as_i32x4())
+}
+
+/// Converts packed single-precision (32-bit) floating-point elements in `a`
+/// to packed 32-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtps_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtps2dq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtps_epi32(a: __m128) -> __m128i {
+ transmute(cvtps2dq(a))
+}
+
+/// Returns a vector whose lowest element is `a` and all higher elements are
+/// `0`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsi32_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, target_arch = "x86_64"), assert_instr(movd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi32_si128(a: i32) -> __m128i {
+ transmute(i32x4::new(a, 0, 0, 0))
+}
+
+/// Returns the lowest element of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsi128_si32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi128_si32(a: __m128i) -> i32 {
+ simd_extract(a.as_i32x4(), 0)
+}
+
+/// Sets packed 64-bit integers with the supplied values, from highest to
+/// lowest.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_epi64x)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set_epi64x(e1: i64, e0: i64) -> __m128i {
+ transmute(i64x2::new(e0, e1))
+}
+
+/// Sets packed 32-bit integers with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set_epi32(e3: i32, e2: i32, e1: i32, e0: i32) -> __m128i {
+ transmute(i32x4::new(e0, e1, e2, e3))
+}
+
+/// Sets packed 16-bit integers with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set_epi16(
+ e7: i16,
+ e6: i16,
+ e5: i16,
+ e4: i16,
+ e3: i16,
+ e2: i16,
+ e1: i16,
+ e0: i16,
+) -> __m128i {
+ transmute(i16x8::new(e0, e1, e2, e3, e4, e5, e6, e7))
+}
+
+/// Sets packed 8-bit integers with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set_epi8(
+ e15: i8,
+ e14: i8,
+ e13: i8,
+ e12: i8,
+ e11: i8,
+ e10: i8,
+ e9: i8,
+ e8: i8,
+ e7: i8,
+ e6: i8,
+ e5: i8,
+ e4: i8,
+ e3: i8,
+ e2: i8,
+ e1: i8,
+ e0: i8,
+) -> __m128i {
+ #[rustfmt::skip]
+ transmute(i8x16::new(
+ e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15,
+ ))
+}
+
+/// Broadcasts 64-bit integer `a` to all elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set1_epi64x)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set1_epi64x(a: i64) -> __m128i {
+ _mm_set_epi64x(a, a)
+}
+
+/// Broadcasts 32-bit integer `a` to all elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set1_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set1_epi32(a: i32) -> __m128i {
+ _mm_set_epi32(a, a, a, a)
+}
+
+/// Broadcasts 16-bit integer `a` to all elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set1_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set1_epi16(a: i16) -> __m128i {
+ _mm_set_epi16(a, a, a, a, a, a, a, a)
+}
+
+/// Broadcasts 8-bit integer `a` to all elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set1_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set1_epi8(a: i8) -> __m128i {
+ _mm_set_epi8(a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a)
+}
+
+/// Sets packed 32-bit integers with the supplied values in reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_setr_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_setr_epi32(e3: i32, e2: i32, e1: i32, e0: i32) -> __m128i {
+ _mm_set_epi32(e0, e1, e2, e3)
+}
+
+/// Sets packed 16-bit integers with the supplied values in reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_setr_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_setr_epi16(
+ e7: i16,
+ e6: i16,
+ e5: i16,
+ e4: i16,
+ e3: i16,
+ e2: i16,
+ e1: i16,
+ e0: i16,
+) -> __m128i {
+ _mm_set_epi16(e0, e1, e2, e3, e4, e5, e6, e7)
+}
+
+/// Sets packed 8-bit integers with the supplied values in reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_setr_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+// no particular instruction to test
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_setr_epi8(
+ e15: i8,
+ e14: i8,
+ e13: i8,
+ e12: i8,
+ e11: i8,
+ e10: i8,
+ e9: i8,
+ e8: i8,
+ e7: i8,
+ e6: i8,
+ e5: i8,
+ e4: i8,
+ e3: i8,
+ e2: i8,
+ e1: i8,
+ e0: i8,
+) -> __m128i {
+ #[rustfmt::skip]
+ _mm_set_epi8(
+ e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15,
+ )
+}
+
+/// Returns a vector with all elements set to zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_setzero_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(xorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_setzero_si128() -> __m128i {
+ _mm_set1_epi64x(0)
+}
+
+/// Loads 64-bit integer from memory into first element of returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadl_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+// FIXME movsd on windows
+#[cfg_attr(
+ all(
+ test,
+ not(windows),
+ not(all(target_os = "linux", target_arch = "x86_64")),
+ target_arch = "x86_64"
+ ),
+ assert_instr(movq)
+)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_loadl_epi64(mem_addr: *const __m128i) -> __m128i {
+ _mm_set_epi64x(0, ptr::read_unaligned(mem_addr as *const i64))
+}
+
+/// Loads 128-bits of integer data from memory into a new vector.
+///
+/// `mem_addr` must be aligned on a 16-byte boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_load_si128(mem_addr: *const __m128i) -> __m128i {
+ *mem_addr
+}
+
+/// Loads 128-bits of integer data from memory into a new vector.
+///
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadu_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movups))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_loadu_si128(mem_addr: *const __m128i) -> __m128i {
+ let mut dst: __m128i = _mm_undefined_si128();
+ ptr::copy_nonoverlapping(
+ mem_addr as *const u8,
+ &mut dst as *mut __m128i as *mut u8,
+ mem::size_of::<__m128i>(),
+ );
+ dst
+}
+
+/// Conditionally store 8-bit integer elements from `a` into memory using
+/// `mask`.
+///
+/// Elements are not stored when the highest bit is not set in the
+/// corresponding element.
+///
+/// `mem_addr` should correspond to a 128-bit memory location and does not need
+/// to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskmoveu_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(maskmovdqu))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_maskmoveu_si128(a: __m128i, mask: __m128i, mem_addr: *mut i8) {
+ maskmovdqu(a.as_i8x16(), mask.as_i8x16(), mem_addr)
+}
+
+/// Stores 128-bits of integer data from `a` into memory.
+///
+/// `mem_addr` must be aligned on a 16-byte boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_store_si128(mem_addr: *mut __m128i, a: __m128i) {
+ *mem_addr = a;
+}
+
+/// Stores 128-bits of integer data from `a` into memory.
+///
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storeu_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movups))] // FIXME movdqu expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_storeu_si128(mem_addr: *mut __m128i, a: __m128i) {
+ storeudq(mem_addr as *mut i8, a);
+}
+
+/// Stores the lower 64-bit integer `a` to a memory location.
+///
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storel_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+// FIXME mov on windows, movlps on i686
+#[cfg_attr(
+ all(
+ test,
+ not(windows),
+ not(all(target_os = "linux", target_arch = "x86_64")),
+ target_arch = "x86_64"
+ ),
+ assert_instr(movq)
+)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_storel_epi64(mem_addr: *mut __m128i, a: __m128i) {
+ ptr::copy_nonoverlapping(&a as *const _ as *const u8, mem_addr as *mut u8, 8);
+}
+
+/// Stores a 128-bit integer vector to a 128-bit aligned memory location.
+/// To minimize caching, the data is flagged as non-temporal (unlikely to be
+/// used again soon).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_stream_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movntps))] // FIXME movntdq
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_stream_si128(mem_addr: *mut __m128i, a: __m128i) {
+ intrinsics::nontemporal_store(mem_addr, a);
+}
+
+/// Stores a 32-bit integer value in the specified memory location.
+/// To minimize caching, the data is flagged as non-temporal (unlikely to be
+/// used again soon).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_stream_si32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movnti))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_stream_si32(mem_addr: *mut i32, a: i32) {
+ intrinsics::nontemporal_store(mem_addr, a);
+}
+
+/// Returns a vector where the low element is extracted from `a` and its upper
+/// element is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_move_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+// FIXME movd on windows, movd on i686
+#[cfg_attr(all(test, not(windows), target_arch = "x86_64"), assert_instr(movq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_move_epi64(a: __m128i) -> __m128i {
+ let zero = _mm_setzero_si128();
+ let r: i64x2 = simd_shuffle2!(a.as_i64x2(), zero.as_i64x2(), [0, 2]);
+ transmute(r)
+}
+
+/// Converts packed 16-bit integers from `a` and `b` to packed 8-bit integers
+/// using signed saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_packs_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(packsswb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_packs_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(packsswb(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Converts packed 32-bit integers from `a` and `b` to packed 16-bit integers
+/// using signed saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_packs_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(packssdw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_packs_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(packssdw(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Converts packed 16-bit integers from `a` and `b` to packed 8-bit integers
+/// using unsigned saturation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_packus_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(packuswb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_packus_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(packuswb(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Returns the `imm8` element of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_extract_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pextrw, IMM8 = 7))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_extract_epi16<const IMM8: i32>(a: __m128i) -> i32 {
+ static_assert_imm3!(IMM8);
+ simd_extract::<_, u16>(a.as_u16x8(), IMM8 as u32) as i32
+}
+
+/// Returns a new vector where the `imm8` element of `a` is replaced with `i`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_insert_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pinsrw, IMM8 = 7))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_insert_epi16<const IMM8: i32>(a: __m128i, i: i32) -> __m128i {
+ static_assert_imm3!(IMM8);
+ transmute(simd_insert(a.as_i16x8(), IMM8 as u32, i as i16))
+}
+
+/// Returns a mask of the most significant bit of each element in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movemask_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pmovmskb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_movemask_epi8(a: __m128i) -> i32 {
+ pmovmskb(a.as_i8x16())
+}
+
+/// Shuffles 32-bit integers in `a` using the control in `IMM8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shuffle_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pshufd, IMM8 = 9))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_shuffle_epi32<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i32x4();
+ let x: i32x4 = simd_shuffle4!(
+ a,
+ a,
+ <const IMM8: i32> [
+ IMM8 as u32 & 0b11,
+ (IMM8 as u32 >> 2) & 0b11,
+ (IMM8 as u32 >> 4) & 0b11,
+ (IMM8 as u32 >> 6) & 0b11,
+ ],
+ );
+ transmute(x)
+}
+
+/// Shuffles 16-bit integers in the high 64 bits of `a` using the control in
+/// `IMM8`.
+///
+/// Put the results in the high 64 bits of the returned vector, with the low 64
+/// bits being copied from from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shufflehi_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pshufhw, IMM8 = 9))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_shufflehi_epi16<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i16x8();
+ let x: i16x8 = simd_shuffle8!(
+ a,
+ a,
+ <const IMM8: i32> [
+ 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,
+ ],
+ );
+ transmute(x)
+}
+
+/// Shuffles 16-bit integers in the low 64 bits of `a` using the control in
+/// `IMM8`.
+///
+/// Put the results in the low 64 bits of the returned vector, with the high 64
+/// bits being copied from from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shufflelo_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(pshuflw, IMM8 = 9))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_shufflelo_epi16<const IMM8: i32>(a: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ let a = a.as_i16x8();
+ let x: i16x8 = simd_shuffle8!(
+ a,
+ a,
+ <const IMM8: i32> [
+ IMM8 as u32 & 0b11,
+ (IMM8 as u32 >> 2) & 0b11,
+ (IMM8 as u32 >> 4) & 0b11,
+ (IMM8 as u32 >> 6) & 0b11,
+ 4,
+ 5,
+ 6,
+ 7,
+ ],
+ );
+ transmute(x)
+}
+
+/// Unpacks and interleave 8-bit integers from the high half of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpackhi_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(punpckhbw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpackhi_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i8x16, _>(simd_shuffle16!(
+ a.as_i8x16(),
+ b.as_i8x16(),
+ [8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31],
+ ))
+}
+
+/// Unpacks and interleave 16-bit integers from the high half of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpackhi_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(punpckhwd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpackhi_epi16(a: __m128i, b: __m128i) -> __m128i {
+ let x = simd_shuffle8!(a.as_i16x8(), b.as_i16x8(), [4, 12, 5, 13, 6, 14, 7, 15]);
+ transmute::<i16x8, _>(x)
+}
+
+/// Unpacks and interleave 32-bit integers from the high half of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpackhi_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(unpckhps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpackhi_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i32x4, _>(simd_shuffle4!(a.as_i32x4(), b.as_i32x4(), [2, 6, 3, 7]))
+}
+
+/// Unpacks and interleave 64-bit integers from the high half of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpackhi_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(unpckhpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpackhi_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i64x2, _>(simd_shuffle2!(a.as_i64x2(), b.as_i64x2(), [1, 3]))
+}
+
+/// Unpacks and interleave 8-bit integers from the low half of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpacklo_epi8)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(punpcklbw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpacklo_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i8x16, _>(simd_shuffle16!(
+ a.as_i8x16(),
+ b.as_i8x16(),
+ [0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23],
+ ))
+}
+
+/// Unpacks and interleave 16-bit integers from the low half of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpacklo_epi16)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(punpcklwd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpacklo_epi16(a: __m128i, b: __m128i) -> __m128i {
+ let x = simd_shuffle8!(a.as_i16x8(), b.as_i16x8(), [0, 8, 1, 9, 2, 10, 3, 11]);
+ transmute::<i16x8, _>(x)
+}
+
+/// Unpacks and interleave 32-bit integers from the low half of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpacklo_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(unpcklps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpacklo_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i32x4, _>(simd_shuffle4!(a.as_i32x4(), b.as_i32x4(), [0, 4, 1, 5]))
+}
+
+/// Unpacks and interleave 64-bit integers from the low half of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpacklo_epi64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movlhps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpacklo_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute::<i64x2, _>(simd_shuffle2!(a.as_i64x2(), b.as_i64x2(), [0, 2]))
+}
+
+/// Returns a new vector with the low element of `a` replaced by the sum of the
+/// low elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_add_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(addsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_add_sd(a: __m128d, b: __m128d) -> __m128d {
+ simd_insert(a, 0, _mm_cvtsd_f64(a) + _mm_cvtsd_f64(b))
+}
+
+/// Adds packed double-precision (64-bit) floating-point elements in `a` and
+/// `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_add_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(addpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_add_pd(a: __m128d, b: __m128d) -> __m128d {
+ simd_add(a, b)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the result of
+/// diving the lower element of `a` by the lower element of `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_div_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(divsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_div_sd(a: __m128d, b: __m128d) -> __m128d {
+ simd_insert(a, 0, _mm_cvtsd_f64(a) / _mm_cvtsd_f64(b))
+}
+
+/// Divide packed double-precision (64-bit) floating-point elements in `a` by
+/// packed elements in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_div_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(divpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_div_pd(a: __m128d, b: __m128d) -> __m128d {
+ simd_div(a, b)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the maximum
+/// of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(maxsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_max_sd(a: __m128d, b: __m128d) -> __m128d {
+ maxsd(a, b)
+}
+
+/// Returns a new vector with the maximum values from corresponding elements in
+/// `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(maxpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_max_pd(a: __m128d, b: __m128d) -> __m128d {
+ maxpd(a, b)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the minimum
+/// of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(minsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_min_sd(a: __m128d, b: __m128d) -> __m128d {
+ minsd(a, b)
+}
+
+/// Returns a new vector with the minimum values from corresponding elements in
+/// `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(minpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_min_pd(a: __m128d, b: __m128d) -> __m128d {
+ minpd(a, b)
+}
+
+/// Returns a new vector with the low element of `a` replaced by multiplying the
+/// low elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mul_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(mulsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mul_sd(a: __m128d, b: __m128d) -> __m128d {
+ simd_insert(a, 0, _mm_cvtsd_f64(a) * _mm_cvtsd_f64(b))
+}
+
+/// Multiplies packed double-precision (64-bit) floating-point elements in `a`
+/// and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mul_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(mulpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mul_pd(a: __m128d, b: __m128d) -> __m128d {
+ simd_mul(a, b)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the square
+/// root of the lower element `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sqrt_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(sqrtsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sqrt_sd(a: __m128d, b: __m128d) -> __m128d {
+ simd_insert(a, 0, _mm_cvtsd_f64(sqrtsd(b)))
+}
+
+/// Returns a new vector with the square root of each of the values in `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sqrt_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(sqrtpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sqrt_pd(a: __m128d) -> __m128d {
+ simd_fsqrt(a)
+}
+
+/// Returns a new vector with the low element of `a` replaced by subtracting the
+/// low element by `b` from the low element of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sub_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(subsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sub_sd(a: __m128d, b: __m128d) -> __m128d {
+ simd_insert(a, 0, _mm_cvtsd_f64(a) - _mm_cvtsd_f64(b))
+}
+
+/// Subtract packed double-precision (64-bit) floating-point elements in `b`
+/// from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sub_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(subpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sub_pd(a: __m128d, b: __m128d) -> __m128d {
+ simd_sub(a, b)
+}
+
+/// Computes the bitwise AND of packed double-precision (64-bit) floating-point
+/// elements in `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_and_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(andps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_and_pd(a: __m128d, b: __m128d) -> __m128d {
+ let a: __m128i = transmute(a);
+ let b: __m128i = transmute(b);
+ transmute(_mm_and_si128(a, b))
+}
+
+/// Computes the bitwise NOT of `a` and then AND with `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_andnot_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(andnps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_andnot_pd(a: __m128d, b: __m128d) -> __m128d {
+ let a: __m128i = transmute(a);
+ let b: __m128i = transmute(b);
+ transmute(_mm_andnot_si128(a, b))
+}
+
+/// Computes the bitwise OR of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_or_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(orps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_or_pd(a: __m128d, b: __m128d) -> __m128d {
+ let a: __m128i = transmute(a);
+ let b: __m128i = transmute(b);
+ transmute(_mm_or_si128(a, b))
+}
+
+/// Computes the bitwise XOR of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_xor_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(xorps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_xor_pd(a: __m128d, b: __m128d) -> __m128d {
+ let a: __m128i = transmute(a);
+ let b: __m128i = transmute(b);
+ transmute(_mm_xor_si128(a, b))
+}
+
+/// Returns a new vector with the low element of `a` replaced by the equality
+/// comparison of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpeqsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpeq_sd(a: __m128d, b: __m128d) -> __m128d {
+ cmpsd(a, b, 0)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the less-than
+/// comparison of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpltsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmplt_sd(a: __m128d, b: __m128d) -> __m128d {
+ cmpsd(a, b, 1)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the
+/// less-than-or-equal comparison of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmplesd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmple_sd(a: __m128d, b: __m128d) -> __m128d {
+ cmpsd(a, b, 2)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the
+/// greater-than comparison of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpltsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpgt_sd(a: __m128d, b: __m128d) -> __m128d {
+ simd_insert(_mm_cmplt_sd(b, a), 1, simd_extract::<_, f64>(a, 1))
+}
+
+/// Returns a new vector with the low element of `a` replaced by the
+/// greater-than-or-equal comparison of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmplesd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpge_sd(a: __m128d, b: __m128d) -> __m128d {
+ simd_insert(_mm_cmple_sd(b, a), 1, simd_extract::<_, f64>(a, 1))
+}
+
+/// Returns a new vector with the low element of `a` replaced by the result
+/// of comparing both of the lower elements of `a` and `b` to `NaN`. If
+/// neither are equal to `NaN` then `0xFFFFFFFFFFFFFFFF` is used and `0`
+/// otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpord_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpordsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpord_sd(a: __m128d, b: __m128d) -> __m128d {
+ cmpsd(a, b, 7)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the result of
+/// comparing both of the lower elements of `a` and `b` to `NaN`. If either is
+/// equal to `NaN` then `0xFFFFFFFFFFFFFFFF` is used and `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpunord_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpunordsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpunord_sd(a: __m128d, b: __m128d) -> __m128d {
+ cmpsd(a, b, 3)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the not-equal
+/// comparison of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpneqsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpneq_sd(a: __m128d, b: __m128d) -> __m128d {
+ cmpsd(a, b, 4)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the
+/// not-less-than comparison of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnlt_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpnltsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnlt_sd(a: __m128d, b: __m128d) -> __m128d {
+ cmpsd(a, b, 5)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the
+/// not-less-than-or-equal comparison of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnle_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpnlesd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnle_sd(a: __m128d, b: __m128d) -> __m128d {
+ cmpsd(a, b, 6)
+}
+
+/// Returns a new vector with the low element of `a` replaced by the
+/// not-greater-than comparison of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpngt_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpnltsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpngt_sd(a: __m128d, b: __m128d) -> __m128d {
+ simd_insert(_mm_cmpnlt_sd(b, a), 1, simd_extract::<_, f64>(a, 1))
+}
+
+/// Returns a new vector with the low element of `a` replaced by the
+/// not-greater-than-or-equal comparison of the lower elements of `a` and `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnge_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpnlesd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnge_sd(a: __m128d, b: __m128d) -> __m128d {
+ simd_insert(_mm_cmpnle_sd(b, a), 1, simd_extract::<_, f64>(a, 1))
+}
+
+/// Compares corresponding elements in `a` and `b` for equality.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpeqpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpeq_pd(a: __m128d, b: __m128d) -> __m128d {
+ cmppd(a, b, 0)
+}
+
+/// Compares corresponding elements in `a` and `b` for less-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmplt_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpltpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmplt_pd(a: __m128d, b: __m128d) -> __m128d {
+ cmppd(a, b, 1)
+}
+
+/// Compares corresponding elements in `a` and `b` for less-than-or-equal
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmple_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmplepd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmple_pd(a: __m128d, b: __m128d) -> __m128d {
+ cmppd(a, b, 2)
+}
+
+/// Compares corresponding elements in `a` and `b` for greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpltpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpgt_pd(a: __m128d, b: __m128d) -> __m128d {
+ _mm_cmplt_pd(b, a)
+}
+
+/// Compares corresponding elements in `a` and `b` for greater-than-or-equal.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpge_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmplepd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpge_pd(a: __m128d, b: __m128d) -> __m128d {
+ _mm_cmple_pd(b, a)
+}
+
+/// Compares corresponding elements in `a` and `b` to see if neither is `NaN`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpord_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpordpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpord_pd(a: __m128d, b: __m128d) -> __m128d {
+ cmppd(a, b, 7)
+}
+
+/// Compares corresponding elements in `a` and `b` to see if either is `NaN`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpunord_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpunordpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpunord_pd(a: __m128d, b: __m128d) -> __m128d {
+ cmppd(a, b, 3)
+}
+
+/// Compares corresponding elements in `a` and `b` for not-equal.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpneq_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpneqpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpneq_pd(a: __m128d, b: __m128d) -> __m128d {
+ cmppd(a, b, 4)
+}
+
+/// Compares corresponding elements in `a` and `b` for not-less-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnlt_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpnltpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnlt_pd(a: __m128d, b: __m128d) -> __m128d {
+ cmppd(a, b, 5)
+}
+
+/// Compares corresponding elements in `a` and `b` for not-less-than-or-equal.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnle_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpnlepd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnle_pd(a: __m128d, b: __m128d) -> __m128d {
+ cmppd(a, b, 6)
+}
+
+/// Compares corresponding elements in `a` and `b` for not-greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpngt_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpnltpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpngt_pd(a: __m128d, b: __m128d) -> __m128d {
+ _mm_cmpnlt_pd(b, a)
+}
+
+/// Compares corresponding elements in `a` and `b` for
+/// not-greater-than-or-equal.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpnge_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cmpnlepd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpnge_pd(a: __m128d, b: __m128d) -> __m128d {
+ _mm_cmpnle_pd(b, a)
+}
+
+/// Compares the lower element of `a` and `b` for equality.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comieq_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(comisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comieq_sd(a: __m128d, b: __m128d) -> i32 {
+ comieqsd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for less-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comilt_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(comisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comilt_sd(a: __m128d, b: __m128d) -> i32 {
+ comiltsd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for less-than-or-equal.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comile_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(comisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comile_sd(a: __m128d, b: __m128d) -> i32 {
+ comilesd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comigt_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(comisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comigt_sd(a: __m128d, b: __m128d) -> i32 {
+ comigtsd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for greater-than-or-equal.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comige_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(comisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comige_sd(a: __m128d, b: __m128d) -> i32 {
+ comigesd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for not-equal.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comineq_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(comisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_comineq_sd(a: __m128d, b: __m128d) -> i32 {
+ comineqsd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for equality.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomieq_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(ucomisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomieq_sd(a: __m128d, b: __m128d) -> i32 {
+ ucomieqsd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for less-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomilt_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(ucomisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomilt_sd(a: __m128d, b: __m128d) -> i32 {
+ ucomiltsd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for less-than-or-equal.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomile_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(ucomisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomile_sd(a: __m128d, b: __m128d) -> i32 {
+ ucomilesd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for greater-than.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomigt_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(ucomisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomigt_sd(a: __m128d, b: __m128d) -> i32 {
+ ucomigtsd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for greater-than-or-equal.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomige_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(ucomisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomige_sd(a: __m128d, b: __m128d) -> i32 {
+ ucomigesd(a, b)
+}
+
+/// Compares the lower element of `a` and `b` for not-equal.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomineq_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(ucomisd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ucomineq_sd(a: __m128d, b: __m128d) -> i32 {
+ ucomineqsd(a, b)
+}
+
+/// Converts packed double-precision (64-bit) floating-point elements in `a` to
+/// packed single-precision (32-bit) floating-point elements
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtpd_ps)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtpd2ps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtpd_ps(a: __m128d) -> __m128 {
+ cvtpd2ps(a)
+}
+
+/// Converts packed single-precision (32-bit) floating-point elements in `a` to
+/// packed
+/// double-precision (64-bit) floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtps_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtps2pd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtps_pd(a: __m128) -> __m128d {
+ cvtps2pd(a)
+}
+
+/// Converts packed double-precision (64-bit) floating-point elements in `a` to
+/// packed 32-bit integers.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtpd_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtpd2dq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtpd_epi32(a: __m128d) -> __m128i {
+ transmute(cvtpd2dq(a))
+}
+
+/// Converts the lower double-precision (64-bit) floating-point element in a to
+/// a 32-bit integer.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsd_si32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtsd2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsd_si32(a: __m128d) -> i32 {
+ cvtsd2si(a)
+}
+
+/// Converts the lower double-precision (64-bit) floating-point element in `b`
+/// to a single-precision (32-bit) floating-point element, store the result in
+/// the lower element of the return value, and copies the upper element from `a`
+/// to the upper element the return value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsd_ss)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtsd2ss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsd_ss(a: __m128, b: __m128d) -> __m128 {
+ cvtsd2ss(a, b)
+}
+
+/// Returns the lower double-precision (64-bit) floating-point element of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsd_f64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsd_f64(a: __m128d) -> f64 {
+ simd_extract(a, 0)
+}
+
+/// Converts the lower single-precision (32-bit) floating-point element in `b`
+/// to a double-precision (64-bit) floating-point element, store the result in
+/// the lower element of the return value, and copies the upper element from `a`
+/// to the upper element the return value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtss_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtss2sd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtss_sd(a: __m128d, b: __m128) -> __m128d {
+ cvtss2sd(a, b)
+}
+
+/// Converts packed double-precision (64-bit) floating-point elements in `a` to
+/// packed 32-bit integers with truncation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttpd_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvttpd2dq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvttpd_epi32(a: __m128d) -> __m128i {
+ transmute(cvttpd2dq(a))
+}
+
+/// Converts the lower double-precision (64-bit) floating-point element in `a`
+/// to a 32-bit integer with truncation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttsd_si32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvttsd2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvttsd_si32(a: __m128d) -> i32 {
+ cvttsd2si(a)
+}
+
+/// Converts packed single-precision (32-bit) floating-point elements in `a` to
+/// packed 32-bit integers with truncation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttps_epi32)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvttps2dq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvttps_epi32(a: __m128) -> __m128i {
+ transmute(cvttps2dq(a))
+}
+
+/// Copies double-precision (64-bit) floating-point element `a` to the lower
+/// element of the packed 64-bit return value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set_sd(a: f64) -> __m128d {
+ _mm_set_pd(0.0, a)
+}
+
+/// Broadcasts double-precision (64-bit) floating-point value a to all elements
+/// of the return value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set1_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set1_pd(a: f64) -> __m128d {
+ _mm_set_pd(a, a)
+}
+
+/// Broadcasts double-precision (64-bit) floating-point value a to all elements
+/// of the return value.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_pd1)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set_pd1(a: f64) -> __m128d {
+ _mm_set_pd(a, a)
+}
+
+/// Sets packed double-precision (64-bit) floating-point elements in the return
+/// value with the supplied values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_set_pd(a: f64, b: f64) -> __m128d {
+ __m128d(b, a)
+}
+
+/// Sets packed double-precision (64-bit) floating-point elements in the return
+/// value with the supplied values in reverse order.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_setr_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_setr_pd(a: f64, b: f64) -> __m128d {
+ _mm_set_pd(b, a)
+}
+
+/// Returns packed double-precision (64-bit) floating-point elements with all
+/// zeros.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_setzero_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(xorps))] // FIXME xorpd expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_setzero_pd() -> __m128d {
+ _mm_set_pd(0.0, 0.0)
+}
+
+/// Returns a mask of the most significant bit of each element in `a`.
+///
+/// The mask is stored in the 2 least significant bits of the return value.
+/// All other bits are set to `0`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movemask_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movmskpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_movemask_pd(a: __m128d) -> i32 {
+ movmskpd(a)
+}
+
+/// Loads 128-bits (composed of 2 packed double-precision (64-bit)
+/// floating-point elements) from memory into the returned vector.
+/// `mem_addr` must be aligned on a 16-byte boundary or a general-protection
+/// exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_load_pd(mem_addr: *const f64) -> __m128d {
+ *(mem_addr as *const __m128d)
+}
+
+/// Loads a 64-bit double-precision value to the low element of a
+/// 128-bit integer vector and clears the upper element.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_load_sd(mem_addr: *const f64) -> __m128d {
+ _mm_setr_pd(*mem_addr, 0.)
+}
+
+/// Loads a double-precision value into the high-order bits of a 128-bit
+/// vector of `[2 x double]`. The low-order bits are copied from the low-order
+/// bits of the first operand.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadh_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movhps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_loadh_pd(a: __m128d, mem_addr: *const f64) -> __m128d {
+ _mm_setr_pd(simd_extract(a, 0), *mem_addr)
+}
+
+/// Loads a double-precision value into the low-order bits of a 128-bit
+/// vector of `[2 x double]`. The high-order bits are copied from the
+/// high-order bits of the first operand.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadl_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movlps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_loadl_pd(a: __m128d, mem_addr: *const f64) -> __m128d {
+ _mm_setr_pd(*mem_addr, simd_extract(a, 1))
+}
+
+/// Stores a 128-bit floating point vector of `[2 x double]` to a 128-bit
+/// aligned memory location.
+/// To minimize caching, the data is flagged as non-temporal (unlikely to be
+/// used again soon).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_stream_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movntps))] // FIXME movntpd
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_stream_pd(mem_addr: *mut f64, a: __m128d) {
+ intrinsics::nontemporal_store(mem_addr as *mut __m128d, a);
+}
+
+/// Stores the lower 64 bits of a 128-bit vector of `[2 x double]` to a
+/// memory location.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movlps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_store_sd(mem_addr: *mut f64, a: __m128d) {
+ *mem_addr = simd_extract(a, 0)
+}
+
+/// Stores 128-bits (composed of 2 packed double-precision (64-bit)
+/// floating-point elements) from `a` into memory. `mem_addr` must be aligned
+/// on a 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_store_pd(mem_addr: *mut f64, a: __m128d) {
+ *(mem_addr as *mut __m128d) = a;
+}
+
+/// Stores 128-bits (composed of 2 packed double-precision (64-bit)
+/// floating-point elements) from `a` into memory.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storeu_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movups))] // FIXME movupd expected
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_storeu_pd(mem_addr: *mut f64, a: __m128d) {
+ storeupd(mem_addr as *mut i8, a);
+}
+
+/// Stores the lower double-precision (64-bit) floating-point element from `a`
+/// into 2 contiguous elements in memory. `mem_addr` must be aligned on a
+/// 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store1_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_store1_pd(mem_addr: *mut f64, a: __m128d) {
+ let b: __m128d = simd_shuffle2!(a, a, [0, 0]);
+ *(mem_addr as *mut __m128d) = b;
+}
+
+/// Stores the lower double-precision (64-bit) floating-point element from `a`
+/// into 2 contiguous elements in memory. `mem_addr` must be aligned on a
+/// 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store_pd1)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_store_pd1(mem_addr: *mut f64, a: __m128d) {
+ let b: __m128d = simd_shuffle2!(a, a, [0, 0]);
+ *(mem_addr as *mut __m128d) = b;
+}
+
+/// Stores 2 double-precision (64-bit) floating-point elements from `a` into
+/// memory in reverse order.
+/// `mem_addr` must be aligned on a 16-byte boundary or a general-protection
+/// exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storer_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+#[allow(clippy::cast_ptr_alignment)]
+pub unsafe fn _mm_storer_pd(mem_addr: *mut f64, a: __m128d) {
+ let b: __m128d = simd_shuffle2!(a, a, [1, 0]);
+ *(mem_addr as *mut __m128d) = b;
+}
+
+/// Stores the upper 64 bits of a 128-bit vector of `[2 x double]` to a
+/// memory location.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storeh_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movhps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_storeh_pd(mem_addr: *mut f64, a: __m128d) {
+ *mem_addr = simd_extract(a, 1);
+}
+
+/// Stores the lower 64 bits of a 128-bit vector of `[2 x double]` to a
+/// memory location.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storel_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movlps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_storel_pd(mem_addr: *mut f64, a: __m128d) {
+ *mem_addr = simd_extract(a, 0);
+}
+
+/// Loads a double-precision (64-bit) floating-point element from memory
+/// into both elements of returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load1_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+// #[cfg_attr(test, assert_instr(movapd))] // FIXME LLVM uses different codegen
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_load1_pd(mem_addr: *const f64) -> __m128d {
+ let d = *mem_addr;
+ _mm_setr_pd(d, d)
+}
+
+/// Loads a double-precision (64-bit) floating-point element from memory
+/// into both elements of returned vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load_pd1)
+#[inline]
+#[target_feature(enable = "sse2")]
+// #[cfg_attr(test, assert_instr(movapd))] // FIXME same as _mm_load1_pd
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_load_pd1(mem_addr: *const f64) -> __m128d {
+ _mm_load1_pd(mem_addr)
+}
+
+/// Loads 2 double-precision (64-bit) floating-point elements from memory into
+/// the returned vector in reverse order. `mem_addr` must be aligned on a
+/// 16-byte boundary or a general-protection exception may be generated.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadr_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movaps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_loadr_pd(mem_addr: *const f64) -> __m128d {
+ let a = _mm_load_pd(mem_addr);
+ simd_shuffle2!(a, a, [1, 0])
+}
+
+/// Loads 128-bits (composed of 2 packed double-precision (64-bit)
+/// floating-point elements) from memory into the returned vector.
+/// `mem_addr` does not need to be aligned on any particular boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loadu_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movups))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_loadu_pd(mem_addr: *const f64) -> __m128d {
+ let mut dst = _mm_undefined_pd();
+ ptr::copy_nonoverlapping(
+ mem_addr as *const u8,
+ &mut dst as *mut __m128d as *mut u8,
+ mem::size_of::<__m128d>(),
+ );
+ dst
+}
+
+/// Constructs a 128-bit floating-point vector of `[2 x double]` from two
+/// 128-bit vector parameters of `[2 x double]`, using the immediate-value
+/// parameter as a specifier.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shuffle_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(shufps, MASK = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_shuffle_pd<const MASK: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_imm8!(MASK);
+ simd_shuffle2!(a, b, <const MASK: i32> [MASK as u32 & 0b1, ((MASK as u32 >> 1) & 0b1) + 2])
+}
+
+/// Constructs a 128-bit floating-point vector of `[2 x double]`. The lower
+/// 64 bits are set to the lower 64 bits of the second parameter. The upper
+/// 64 bits are set to the upper 64 bits of the first parameter.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_move_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_move_sd(a: __m128d, b: __m128d) -> __m128d {
+ _mm_setr_pd(simd_extract(b, 0), simd_extract(a, 1))
+}
+
+/// Casts a 128-bit floating-point vector of `[2 x double]` into a 128-bit
+/// floating-point vector of `[4 x float]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castpd_ps)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_castpd_ps(a: __m128d) -> __m128 {
+ transmute(a)
+}
+
+/// Casts a 128-bit floating-point vector of `[2 x double]` into a 128-bit
+/// integer vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castpd_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_castpd_si128(a: __m128d) -> __m128i {
+ transmute(a)
+}
+
+/// Casts a 128-bit floating-point vector of `[4 x float]` into a 128-bit
+/// floating-point vector of `[2 x double]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castps_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_castps_pd(a: __m128) -> __m128d {
+ transmute(a)
+}
+
+/// Casts a 128-bit floating-point vector of `[4 x float]` into a 128-bit
+/// integer vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castps_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_castps_si128(a: __m128) -> __m128i {
+ transmute(a)
+}
+
+/// Casts a 128-bit integer vector into a 128-bit floating-point vector
+/// of `[2 x double]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castsi128_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_castsi128_pd(a: __m128i) -> __m128d {
+ transmute(a)
+}
+
+/// Casts a 128-bit integer vector into a 128-bit floating-point vector
+/// of `[4 x float]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castsi128_ps)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_castsi128_ps(a: __m128i) -> __m128 {
+ transmute(a)
+}
+
+/// Returns vector of type __m128d with undefined elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_undefined_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_undefined_pd() -> __m128d {
+ __m128d(0.0, 0.0)
+}
+
+/// Returns vector of type __m128i with undefined elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_undefined_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_undefined_si128() -> __m128i {
+ __m128i(0, 0)
+}
+
+/// The resulting `__m128d` element is composed by the low-order values of
+/// the two `__m128d` interleaved input elements, i.e.:
+///
+/// * The `[127:64]` bits are copied from the `[127:64]` bits of the second
+/// input * The `[63:0]` bits are copied from the `[127:64]` bits of the first
+/// input
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpackhi_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(unpckhpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpackhi_pd(a: __m128d, b: __m128d) -> __m128d {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// The resulting `__m128d` element is composed by the high-order values of
+/// the two `__m128d` interleaved input elements, i.e.:
+///
+/// * The `[127:64]` bits are copied from the `[63:0]` bits of the second input
+/// * The `[63:0]` bits are copied from the `[63:0]` bits of the first input
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpacklo_pd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movlhps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_unpacklo_pd(a: __m128d, b: __m128d) -> __m128d {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.sse2.pause"]
+ fn pause();
+ #[link_name = "llvm.x86.sse2.clflush"]
+ fn clflush(p: *const u8);
+ #[link_name = "llvm.x86.sse2.lfence"]
+ fn lfence();
+ #[link_name = "llvm.x86.sse2.mfence"]
+ fn mfence();
+ #[link_name = "llvm.x86.sse2.pavg.b"]
+ fn pavgb(a: u8x16, b: u8x16) -> u8x16;
+ #[link_name = "llvm.x86.sse2.pavg.w"]
+ fn pavgw(a: u16x8, b: u16x8) -> u16x8;
+ #[link_name = "llvm.x86.sse2.pmadd.wd"]
+ fn pmaddwd(a: i16x8, b: i16x8) -> i32x4;
+ #[link_name = "llvm.x86.sse2.pmaxs.w"]
+ fn pmaxsw(a: i16x8, b: i16x8) -> i16x8;
+ #[link_name = "llvm.x86.sse2.pmaxu.b"]
+ fn pmaxub(a: u8x16, b: u8x16) -> u8x16;
+ #[link_name = "llvm.x86.sse2.pmins.w"]
+ fn pminsw(a: i16x8, b: i16x8) -> i16x8;
+ #[link_name = "llvm.x86.sse2.pminu.b"]
+ fn pminub(a: u8x16, b: u8x16) -> u8x16;
+ #[link_name = "llvm.x86.sse2.pmulh.w"]
+ fn pmulhw(a: i16x8, b: i16x8) -> i16x8;
+ #[link_name = "llvm.x86.sse2.pmulhu.w"]
+ fn pmulhuw(a: u16x8, b: u16x8) -> u16x8;
+ #[link_name = "llvm.x86.sse2.pmulu.dq"]
+ fn pmuludq(a: u32x4, b: u32x4) -> u64x2;
+ #[link_name = "llvm.x86.sse2.psad.bw"]
+ fn psadbw(a: u8x16, b: u8x16) -> u64x2;
+ #[link_name = "llvm.x86.sse2.pslli.w"]
+ fn pslliw(a: i16x8, imm8: i32) -> i16x8;
+ #[link_name = "llvm.x86.sse2.psll.w"]
+ fn psllw(a: i16x8, count: i16x8) -> i16x8;
+ #[link_name = "llvm.x86.sse2.pslli.d"]
+ fn psllid(a: i32x4, imm8: i32) -> i32x4;
+ #[link_name = "llvm.x86.sse2.psll.d"]
+ fn pslld(a: i32x4, count: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.sse2.pslli.q"]
+ fn pslliq(a: i64x2, imm8: i32) -> i64x2;
+ #[link_name = "llvm.x86.sse2.psll.q"]
+ fn psllq(a: i64x2, count: i64x2) -> i64x2;
+ #[link_name = "llvm.x86.sse2.psrai.w"]
+ fn psraiw(a: i16x8, imm8: i32) -> i16x8;
+ #[link_name = "llvm.x86.sse2.psra.w"]
+ fn psraw(a: i16x8, count: i16x8) -> i16x8;
+ #[link_name = "llvm.x86.sse2.psrai.d"]
+ fn psraid(a: i32x4, imm8: i32) -> i32x4;
+ #[link_name = "llvm.x86.sse2.psra.d"]
+ fn psrad(a: i32x4, count: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.sse2.psrli.w"]
+ fn psrliw(a: i16x8, imm8: i32) -> i16x8;
+ #[link_name = "llvm.x86.sse2.psrl.w"]
+ fn psrlw(a: i16x8, count: i16x8) -> i16x8;
+ #[link_name = "llvm.x86.sse2.psrli.d"]
+ fn psrlid(a: i32x4, imm8: i32) -> i32x4;
+ #[link_name = "llvm.x86.sse2.psrl.d"]
+ fn psrld(a: i32x4, count: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.sse2.psrli.q"]
+ fn psrliq(a: i64x2, imm8: i32) -> i64x2;
+ #[link_name = "llvm.x86.sse2.psrl.q"]
+ fn psrlq(a: i64x2, count: i64x2) -> i64x2;
+ #[link_name = "llvm.x86.sse2.cvtdq2ps"]
+ fn cvtdq2ps(a: i32x4) -> __m128;
+ #[link_name = "llvm.x86.sse2.cvtps2dq"]
+ fn cvtps2dq(a: __m128) -> i32x4;
+ #[link_name = "llvm.x86.sse2.maskmov.dqu"]
+ fn maskmovdqu(a: i8x16, mask: i8x16, mem_addr: *mut i8);
+ #[link_name = "llvm.x86.sse2.packsswb.128"]
+ fn packsswb(a: i16x8, b: i16x8) -> i8x16;
+ #[link_name = "llvm.x86.sse2.packssdw.128"]
+ fn packssdw(a: i32x4, b: i32x4) -> i16x8;
+ #[link_name = "llvm.x86.sse2.packuswb.128"]
+ fn packuswb(a: i16x8, b: i16x8) -> u8x16;
+ #[link_name = "llvm.x86.sse2.pmovmskb.128"]
+ fn pmovmskb(a: i8x16) -> i32;
+ #[link_name = "llvm.x86.sse2.max.sd"]
+ fn maxsd(a: __m128d, b: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.sse2.max.pd"]
+ fn maxpd(a: __m128d, b: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.sse2.min.sd"]
+ fn minsd(a: __m128d, b: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.sse2.min.pd"]
+ fn minpd(a: __m128d, b: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.sse2.sqrt.sd"]
+ fn sqrtsd(a: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.sse2.sqrt.pd"]
+ fn sqrtpd(a: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.sse2.cmp.sd"]
+ fn cmpsd(a: __m128d, b: __m128d, imm8: i8) -> __m128d;
+ #[link_name = "llvm.x86.sse2.cmp.pd"]
+ fn cmppd(a: __m128d, b: __m128d, imm8: i8) -> __m128d;
+ #[link_name = "llvm.x86.sse2.comieq.sd"]
+ fn comieqsd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.comilt.sd"]
+ fn comiltsd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.comile.sd"]
+ fn comilesd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.comigt.sd"]
+ fn comigtsd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.comige.sd"]
+ fn comigesd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.comineq.sd"]
+ fn comineqsd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.ucomieq.sd"]
+ fn ucomieqsd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.ucomilt.sd"]
+ fn ucomiltsd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.ucomile.sd"]
+ fn ucomilesd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.ucomigt.sd"]
+ fn ucomigtsd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.ucomige.sd"]
+ fn ucomigesd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.ucomineq.sd"]
+ fn ucomineqsd(a: __m128d, b: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.movmsk.pd"]
+ fn movmskpd(a: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.cvtpd2ps"]
+ fn cvtpd2ps(a: __m128d) -> __m128;
+ #[link_name = "llvm.x86.sse2.cvtps2pd"]
+ fn cvtps2pd(a: __m128) -> __m128d;
+ #[link_name = "llvm.x86.sse2.cvtpd2dq"]
+ fn cvtpd2dq(a: __m128d) -> i32x4;
+ #[link_name = "llvm.x86.sse2.cvtsd2si"]
+ fn cvtsd2si(a: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.cvtsd2ss"]
+ fn cvtsd2ss(a: __m128, b: __m128d) -> __m128;
+ #[link_name = "llvm.x86.sse2.cvtss2sd"]
+ fn cvtss2sd(a: __m128d, b: __m128) -> __m128d;
+ #[link_name = "llvm.x86.sse2.cvttpd2dq"]
+ fn cvttpd2dq(a: __m128d) -> i32x4;
+ #[link_name = "llvm.x86.sse2.cvttsd2si"]
+ fn cvttsd2si(a: __m128d) -> i32;
+ #[link_name = "llvm.x86.sse2.cvttps2dq"]
+ fn cvttps2dq(a: __m128) -> i32x4;
+ #[link_name = "llvm.x86.sse2.storeu.dq"]
+ fn storeudq(mem_addr: *mut i8, a: __m128i);
+ #[link_name = "llvm.x86.sse2.storeu.pd"]
+ fn storeupd(mem_addr: *mut i8, a: __m128d);
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::{
+ core_arch::{simd::*, x86::*},
+ hint::black_box,
+ };
+ use std::{
+ boxed, f32,
+ f64::{self, NAN},
+ i32,
+ mem::{self, transmute},
+ };
+ use stdarch_test::simd_test;
+
+ #[test]
+ fn test_mm_pause() {
+ unsafe { _mm_pause() }
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_clflush() {
+ let x = 0_u8;
+ _mm_clflush(&x as *const _);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_lfence() {
+ _mm_lfence();
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_mfence() {
+ _mm_mfence();
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_add_epi8() {
+ let a = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ );
+ let r = _mm_add_epi8(a, b);
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_add_epi8_overflow() {
+ let a = _mm_set1_epi8(0x7F);
+ let b = _mm_set1_epi8(1);
+ let r = _mm_add_epi8(a, b);
+ assert_eq_m128i(r, _mm_set1_epi8(-128));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_add_epi16() {
+ let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm_setr_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_add_epi16(a, b);
+ let e = _mm_setr_epi16(8, 10, 12, 14, 16, 18, 20, 22);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_add_epi32() {
+ let a = _mm_setr_epi32(0, 1, 2, 3);
+ let b = _mm_setr_epi32(4, 5, 6, 7);
+ let r = _mm_add_epi32(a, b);
+ let e = _mm_setr_epi32(4, 6, 8, 10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_add_epi64() {
+ let a = _mm_setr_epi64x(0, 1);
+ let b = _mm_setr_epi64x(2, 3);
+ let r = _mm_add_epi64(a, b);
+ let e = _mm_setr_epi64x(2, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_adds_epi8() {
+ let a = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ );
+ let r = _mm_adds_epi8(a, b);
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_adds_epi8_saturate_positive() {
+ let a = _mm_set1_epi8(0x7F);
+ let b = _mm_set1_epi8(1);
+ let r = _mm_adds_epi8(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_adds_epi8_saturate_negative() {
+ let a = _mm_set1_epi8(-0x80);
+ let b = _mm_set1_epi8(-1);
+ let r = _mm_adds_epi8(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_adds_epi16() {
+ let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm_setr_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_adds_epi16(a, b);
+ let e = _mm_setr_epi16(8, 10, 12, 14, 16, 18, 20, 22);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_adds_epi16_saturate_positive() {
+ let a = _mm_set1_epi16(0x7FFF);
+ let b = _mm_set1_epi16(1);
+ let r = _mm_adds_epi16(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_adds_epi16_saturate_negative() {
+ let a = _mm_set1_epi16(-0x8000);
+ let b = _mm_set1_epi16(-1);
+ let r = _mm_adds_epi16(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_adds_epu8() {
+ let a = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ );
+ let r = _mm_adds_epu8(a, b);
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_adds_epu8_saturate() {
+ let a = _mm_set1_epi8(!0);
+ let b = _mm_set1_epi8(1);
+ let r = _mm_adds_epu8(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_adds_epu16() {
+ let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm_setr_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_adds_epu16(a, b);
+ let e = _mm_setr_epi16(8, 10, 12, 14, 16, 18, 20, 22);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_adds_epu16_saturate() {
+ let a = _mm_set1_epi16(!0);
+ let b = _mm_set1_epi16(1);
+ let r = _mm_adds_epu16(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_avg_epu8() {
+ let (a, b) = (_mm_set1_epi8(3), _mm_set1_epi8(9));
+ let r = _mm_avg_epu8(a, b);
+ assert_eq_m128i(r, _mm_set1_epi8(6));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_avg_epu16() {
+ let (a, b) = (_mm_set1_epi16(3), _mm_set1_epi16(9));
+ let r = _mm_avg_epu16(a, b);
+ assert_eq_m128i(r, _mm_set1_epi16(6));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_madd_epi16() {
+ let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm_setr_epi16(9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm_madd_epi16(a, b);
+ let e = _mm_setr_epi32(29, 81, 149, 233);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_max_epi16() {
+ let a = _mm_set1_epi16(1);
+ let b = _mm_set1_epi16(-1);
+ let r = _mm_max_epi16(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_max_epu8() {
+ let a = _mm_set1_epi8(1);
+ let b = _mm_set1_epi8(!0);
+ let r = _mm_max_epu8(a, b);
+ assert_eq_m128i(r, b);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_min_epi16() {
+ let a = _mm_set1_epi16(1);
+ let b = _mm_set1_epi16(-1);
+ let r = _mm_min_epi16(a, b);
+ assert_eq_m128i(r, b);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_min_epu8() {
+ let a = _mm_set1_epi8(1);
+ let b = _mm_set1_epi8(!0);
+ let r = _mm_min_epu8(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_mulhi_epi16() {
+ let (a, b) = (_mm_set1_epi16(1000), _mm_set1_epi16(-1001));
+ let r = _mm_mulhi_epi16(a, b);
+ assert_eq_m128i(r, _mm_set1_epi16(-16));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_mulhi_epu16() {
+ let (a, b) = (_mm_set1_epi16(1000), _mm_set1_epi16(1001));
+ let r = _mm_mulhi_epu16(a, b);
+ assert_eq_m128i(r, _mm_set1_epi16(15));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_mullo_epi16() {
+ let (a, b) = (_mm_set1_epi16(1000), _mm_set1_epi16(-1001));
+ let r = _mm_mullo_epi16(a, b);
+ assert_eq_m128i(r, _mm_set1_epi16(-17960));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_mul_epu32() {
+ let a = _mm_setr_epi64x(1_000_000_000, 1 << 34);
+ let b = _mm_setr_epi64x(1_000_000_000, 1 << 35);
+ let r = _mm_mul_epu32(a, b);
+ let e = _mm_setr_epi64x(1_000_000_000 * 1_000_000_000, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sad_epu8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 255u8 as i8, 254u8 as i8, 253u8 as i8, 252u8 as i8,
+ 1, 2, 3, 4,
+ 155u8 as i8, 154u8 as i8, 153u8 as i8, 152u8 as i8,
+ 1, 2, 3, 4,
+ );
+ let b = _mm_setr_epi8(0, 0, 0, 0, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2);
+ let r = _mm_sad_epu8(a, b);
+ let e = _mm_setr_epi64x(1020, 614);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sub_epi8() {
+ let (a, b) = (_mm_set1_epi8(5), _mm_set1_epi8(6));
+ let r = _mm_sub_epi8(a, b);
+ assert_eq_m128i(r, _mm_set1_epi8(-1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sub_epi16() {
+ let (a, b) = (_mm_set1_epi16(5), _mm_set1_epi16(6));
+ let r = _mm_sub_epi16(a, b);
+ assert_eq_m128i(r, _mm_set1_epi16(-1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sub_epi32() {
+ let (a, b) = (_mm_set1_epi32(5), _mm_set1_epi32(6));
+ let r = _mm_sub_epi32(a, b);
+ assert_eq_m128i(r, _mm_set1_epi32(-1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sub_epi64() {
+ let (a, b) = (_mm_set1_epi64x(5), _mm_set1_epi64x(6));
+ let r = _mm_sub_epi64(a, b);
+ assert_eq_m128i(r, _mm_set1_epi64x(-1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_subs_epi8() {
+ let (a, b) = (_mm_set1_epi8(5), _mm_set1_epi8(2));
+ let r = _mm_subs_epi8(a, b);
+ assert_eq_m128i(r, _mm_set1_epi8(3));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_subs_epi8_saturate_positive() {
+ let a = _mm_set1_epi8(0x7F);
+ let b = _mm_set1_epi8(-1);
+ let r = _mm_subs_epi8(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_subs_epi8_saturate_negative() {
+ let a = _mm_set1_epi8(-0x80);
+ let b = _mm_set1_epi8(1);
+ let r = _mm_subs_epi8(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_subs_epi16() {
+ let (a, b) = (_mm_set1_epi16(5), _mm_set1_epi16(2));
+ let r = _mm_subs_epi16(a, b);
+ assert_eq_m128i(r, _mm_set1_epi16(3));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_subs_epi16_saturate_positive() {
+ let a = _mm_set1_epi16(0x7FFF);
+ let b = _mm_set1_epi16(-1);
+ let r = _mm_subs_epi16(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_subs_epi16_saturate_negative() {
+ let a = _mm_set1_epi16(-0x8000);
+ let b = _mm_set1_epi16(1);
+ let r = _mm_subs_epi16(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_subs_epu8() {
+ let (a, b) = (_mm_set1_epi8(5), _mm_set1_epi8(2));
+ let r = _mm_subs_epu8(a, b);
+ assert_eq_m128i(r, _mm_set1_epi8(3));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_subs_epu8_saturate() {
+ let a = _mm_set1_epi8(0);
+ let b = _mm_set1_epi8(1);
+ let r = _mm_subs_epu8(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_subs_epu16() {
+ let (a, b) = (_mm_set1_epi16(5), _mm_set1_epi16(2));
+ let r = _mm_subs_epu16(a, b);
+ assert_eq_m128i(r, _mm_set1_epi16(3));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_subs_epu16_saturate() {
+ let a = _mm_set1_epi16(0);
+ let b = _mm_set1_epi16(1);
+ let r = _mm_subs_epu16(a, b);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_slli_si128() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ let r = _mm_slli_si128::<1>(a);
+ let e = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ let r = _mm_slli_si128::<15>(a);
+ let e = _mm_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
+ assert_eq_m128i(r, e);
+
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ let r = _mm_slli_si128::<16>(a);
+ assert_eq_m128i(r, _mm_set1_epi8(0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_slli_epi16() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi16(
+ 0xFFFF as u16 as i16, 0x0FFF, 0x00FF, 0x000F, 0, 0, 0, 0,
+ );
+ let r = _mm_slli_epi16::<4>(a);
+
+ #[rustfmt::skip]
+ let e = _mm_setr_epi16(
+ 0xFFF0 as u16 as i16, 0xFFF0 as u16 as i16, 0x0FF0, 0x00F0,
+ 0, 0, 0, 0,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sll_epi16() {
+ let a = _mm_setr_epi16(0xFF, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm_sll_epi16(a, _mm_setr_epi16(4, 0, 0, 0, 0, 0, 0, 0));
+ assert_eq_m128i(r, _mm_setr_epi16(0xFF0, 0, 0, 0, 0, 0, 0, 0));
+ let r = _mm_sll_epi16(a, _mm_setr_epi16(0, 0, 0, 0, 4, 0, 0, 0));
+ assert_eq_m128i(r, _mm_setr_epi16(0xFF, 0, 0, 0, 0, 0, 0, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_slli_epi32() {
+ let r = _mm_slli_epi32::<4>(_mm_set1_epi32(0xFFFF));
+ assert_eq_m128i(r, _mm_set1_epi32(0xFFFF0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sll_epi32() {
+ let a = _mm_set1_epi32(0xFFFF);
+ let b = _mm_setr_epi32(4, 0, 0, 0);
+ let r = _mm_sll_epi32(a, b);
+ assert_eq_m128i(r, _mm_set1_epi32(0xFFFF0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_slli_epi64() {
+ let r = _mm_slli_epi64::<4>(_mm_set1_epi64x(0xFFFFFFFF));
+ assert_eq_m128i(r, _mm_set1_epi64x(0xFFFFFFFF0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sll_epi64() {
+ let a = _mm_set1_epi64x(0xFFFFFFFF);
+ let b = _mm_setr_epi64x(4, 0);
+ let r = _mm_sll_epi64(a, b);
+ assert_eq_m128i(r, _mm_set1_epi64x(0xFFFFFFFF0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_srai_epi16() {
+ let r = _mm_srai_epi16::<1>(_mm_set1_epi16(-1));
+ assert_eq_m128i(r, _mm_set1_epi16(-1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sra_epi16() {
+ let a = _mm_set1_epi16(-1);
+ let b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm_sra_epi16(a, b);
+ assert_eq_m128i(r, _mm_set1_epi16(-1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_srai_epi32() {
+ let r = _mm_srai_epi32::<1>(_mm_set1_epi32(-1));
+ assert_eq_m128i(r, _mm_set1_epi32(-1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sra_epi32() {
+ let a = _mm_set1_epi32(-1);
+ let b = _mm_setr_epi32(1, 0, 0, 0);
+ let r = _mm_sra_epi32(a, b);
+ assert_eq_m128i(r, _mm_set1_epi32(-1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_srli_si128() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ let r = _mm_srli_si128::<1>(a);
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0,
+ );
+ assert_eq_m128i(r, e);
+
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ let r = _mm_srli_si128::<15>(a);
+ let e = _mm_setr_epi8(16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m128i(r, e);
+
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ let r = _mm_srli_si128::<16>(a);
+ assert_eq_m128i(r, _mm_set1_epi8(0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_srli_epi16() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi16(
+ 0xFFFF as u16 as i16, 0x0FFF, 0x00FF, 0x000F, 0, 0, 0, 0,
+ );
+ let r = _mm_srli_epi16::<4>(a);
+ #[rustfmt::skip]
+ let e = _mm_setr_epi16(
+ 0xFFF as u16 as i16, 0xFF as u16 as i16, 0xF, 0, 0, 0, 0, 0,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_srl_epi16() {
+ let a = _mm_setr_epi16(0xFF, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm_srl_epi16(a, _mm_setr_epi16(4, 0, 0, 0, 0, 0, 0, 0));
+ assert_eq_m128i(r, _mm_setr_epi16(0xF, 0, 0, 0, 0, 0, 0, 0));
+ let r = _mm_srl_epi16(a, _mm_setr_epi16(0, 0, 0, 0, 4, 0, 0, 0));
+ assert_eq_m128i(r, _mm_setr_epi16(0xFF, 0, 0, 0, 0, 0, 0, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_srli_epi32() {
+ let r = _mm_srli_epi32::<4>(_mm_set1_epi32(0xFFFF));
+ assert_eq_m128i(r, _mm_set1_epi32(0xFFF));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_srl_epi32() {
+ let a = _mm_set1_epi32(0xFFFF);
+ let b = _mm_setr_epi32(4, 0, 0, 0);
+ let r = _mm_srl_epi32(a, b);
+ assert_eq_m128i(r, _mm_set1_epi32(0xFFF));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_srli_epi64() {
+ let r = _mm_srli_epi64::<4>(_mm_set1_epi64x(0xFFFFFFFF));
+ assert_eq_m128i(r, _mm_set1_epi64x(0xFFFFFFF));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_srl_epi64() {
+ let a = _mm_set1_epi64x(0xFFFFFFFF);
+ let b = _mm_setr_epi64x(4, 0);
+ let r = _mm_srl_epi64(a, b);
+ assert_eq_m128i(r, _mm_set1_epi64x(0xFFFFFFF));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_and_si128() {
+ let a = _mm_set1_epi8(5);
+ let b = _mm_set1_epi8(3);
+ let r = _mm_and_si128(a, b);
+ assert_eq_m128i(r, _mm_set1_epi8(1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_andnot_si128() {
+ let a = _mm_set1_epi8(5);
+ let b = _mm_set1_epi8(3);
+ let r = _mm_andnot_si128(a, b);
+ assert_eq_m128i(r, _mm_set1_epi8(2));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_or_si128() {
+ let a = _mm_set1_epi8(5);
+ let b = _mm_set1_epi8(3);
+ let r = _mm_or_si128(a, b);
+ assert_eq_m128i(r, _mm_set1_epi8(7));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_xor_si128() {
+ let a = _mm_set1_epi8(5);
+ let b = _mm_set1_epi8(3);
+ let r = _mm_xor_si128(a, b);
+ assert_eq_m128i(r, _mm_set1_epi8(6));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpeq_epi8() {
+ let a = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = _mm_setr_epi8(15, 14, 2, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm_cmpeq_epi8(a, b);
+ #[rustfmt::skip]
+ assert_eq_m128i(
+ r,
+ _mm_setr_epi8(
+ 0, 0, 0xFFu8 as i8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ )
+ );
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpeq_epi16() {
+ let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm_setr_epi16(7, 6, 2, 4, 3, 2, 1, 0);
+ let r = _mm_cmpeq_epi16(a, b);
+ assert_eq_m128i(r, _mm_setr_epi16(0, 0, !0, 0, 0, 0, 0, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpeq_epi32() {
+ let a = _mm_setr_epi32(0, 1, 2, 3);
+ let b = _mm_setr_epi32(3, 2, 2, 0);
+ let r = _mm_cmpeq_epi32(a, b);
+ assert_eq_m128i(r, _mm_setr_epi32(0, 0, !0, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpgt_epi8() {
+ let a = _mm_set_epi8(5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let b = _mm_set1_epi8(0);
+ let r = _mm_cmpgt_epi8(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 = "sse2")]
+ unsafe fn test_mm_cmpgt_epi16() {
+ let a = _mm_set_epi16(5, 0, 0, 0, 0, 0, 0, 0);
+ let b = _mm_set1_epi16(0);
+ let r = _mm_cmpgt_epi16(a, b);
+ let e = _mm_set_epi16(!0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpgt_epi32() {
+ let a = _mm_set_epi32(5, 0, 0, 0);
+ let b = _mm_set1_epi32(0);
+ let r = _mm_cmpgt_epi32(a, b);
+ assert_eq_m128i(r, _mm_set_epi32(!0, 0, 0, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmplt_epi8() {
+ let a = _mm_set1_epi8(0);
+ let b = _mm_set_epi8(5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm_cmplt_epi8(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 = "sse2")]
+ unsafe fn test_mm_cmplt_epi16() {
+ let a = _mm_set1_epi16(0);
+ let b = _mm_set_epi16(5, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm_cmplt_epi16(a, b);
+ let e = _mm_set_epi16(!0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmplt_epi32() {
+ let a = _mm_set1_epi32(0);
+ let b = _mm_set_epi32(5, 0, 0, 0);
+ let r = _mm_cmplt_epi32(a, b);
+ assert_eq_m128i(r, _mm_set_epi32(!0, 0, 0, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtepi32_pd() {
+ let a = _mm_set_epi32(35, 25, 15, 5);
+ let r = _mm_cvtepi32_pd(a);
+ assert_eq_m128d(r, _mm_setr_pd(5.0, 15.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsi32_sd() {
+ let a = _mm_set1_pd(3.5);
+ let r = _mm_cvtsi32_sd(a, 5);
+ assert_eq_m128d(r, _mm_setr_pd(5.0, 3.5));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtepi32_ps() {
+ let a = _mm_setr_epi32(1, 2, 3, 4);
+ let r = _mm_cvtepi32_ps(a);
+ assert_eq_m128(r, _mm_setr_ps(1.0, 2.0, 3.0, 4.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtps_epi32() {
+ let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let r = _mm_cvtps_epi32(a);
+ assert_eq_m128i(r, _mm_setr_epi32(1, 2, 3, 4));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsi32_si128() {
+ let r = _mm_cvtsi32_si128(5);
+ assert_eq_m128i(r, _mm_setr_epi32(5, 0, 0, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsi128_si32() {
+ let r = _mm_cvtsi128_si32(_mm_setr_epi32(5, 0, 0, 0));
+ assert_eq!(r, 5);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set_epi64x() {
+ let r = _mm_set_epi64x(0, 1);
+ assert_eq_m128i(r, _mm_setr_epi64x(1, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set_epi32() {
+ let r = _mm_set_epi32(0, 1, 2, 3);
+ assert_eq_m128i(r, _mm_setr_epi32(3, 2, 1, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set_epi16() {
+ let r = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m128i(r, _mm_setr_epi16(7, 6, 5, 4, 3, 2, 1, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set_epi8() {
+ #[rustfmt::skip]
+ let r = _mm_set_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 15, 14, 13, 12, 11, 10, 9, 8,
+ 7, 6, 5, 4, 3, 2, 1, 0,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set1_epi64x() {
+ let r = _mm_set1_epi64x(1);
+ assert_eq_m128i(r, _mm_set1_epi64x(1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set1_epi32() {
+ let r = _mm_set1_epi32(1);
+ assert_eq_m128i(r, _mm_set1_epi32(1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set1_epi16() {
+ let r = _mm_set1_epi16(1);
+ assert_eq_m128i(r, _mm_set1_epi16(1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set1_epi8() {
+ let r = _mm_set1_epi8(1);
+ assert_eq_m128i(r, _mm_set1_epi8(1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_setr_epi32() {
+ let r = _mm_setr_epi32(0, 1, 2, 3);
+ assert_eq_m128i(r, _mm_setr_epi32(0, 1, 2, 3));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_setr_epi16() {
+ let r = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m128i(r, _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_setr_epi8() {
+ #[rustfmt::skip]
+ let r = _mm_setr_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ #[rustfmt::skip]
+ let e = _mm_setr_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 = "sse2")]
+ unsafe fn test_mm_setzero_si128() {
+ let r = _mm_setzero_si128();
+ assert_eq_m128i(r, _mm_set1_epi64x(0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_loadl_epi64() {
+ let a = _mm_setr_epi64x(6, 5);
+ let r = _mm_loadl_epi64(&a as *const _);
+ assert_eq_m128i(r, _mm_setr_epi64x(6, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_load_si128() {
+ let a = _mm_set_epi64x(5, 6);
+ let r = _mm_load_si128(&a as *const _ as *const _);
+ assert_eq_m128i(a, r);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_loadu_si128() {
+ let a = _mm_set_epi64x(5, 6);
+ let r = _mm_loadu_si128(&a as *const _ as *const _);
+ assert_eq_m128i(a, r);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_maskmoveu_si128() {
+ let a = _mm_set1_epi8(9);
+ #[rustfmt::skip]
+ let mask = _mm_set_epi8(
+ 0, 0, 0x80u8 as i8, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ );
+ let mut r = _mm_set1_epi8(0);
+ _mm_maskmoveu_si128(a, mask, &mut r as *mut _ as *mut i8);
+ let e = _mm_set_epi8(0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_store_si128() {
+ let a = _mm_set1_epi8(9);
+ let mut r = _mm_set1_epi8(0);
+ _mm_store_si128(&mut r as *mut _ as *mut __m128i, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_storeu_si128() {
+ let a = _mm_set1_epi8(9);
+ let mut r = _mm_set1_epi8(0);
+ _mm_storeu_si128(&mut r as *mut _ as *mut __m128i, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_storel_epi64() {
+ let a = _mm_setr_epi64x(2, 9);
+ let mut r = _mm_set1_epi8(0);
+ _mm_storel_epi64(&mut r as *mut _ as *mut __m128i, a);
+ assert_eq_m128i(r, _mm_setr_epi64x(2, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_stream_si128() {
+ let a = _mm_setr_epi32(1, 2, 3, 4);
+ let mut r = _mm_undefined_si128();
+ _mm_stream_si128(&mut r as *mut _, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_stream_si32() {
+ let a: i32 = 7;
+ let mut mem = boxed::Box::<i32>::new(-1);
+ _mm_stream_si32(&mut *mem as *mut i32, a);
+ assert_eq!(a, *mem);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_move_epi64() {
+ let a = _mm_setr_epi64x(5, 6);
+ let r = _mm_move_epi64(a);
+ assert_eq_m128i(r, _mm_setr_epi64x(5, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_packs_epi16() {
+ let a = _mm_setr_epi16(0x80, -0x81, 0, 0, 0, 0, 0, 0);
+ let b = _mm_setr_epi16(0, 0, 0, 0, 0, 0, -0x81, 0x80);
+ let r = _mm_packs_epi16(a, b);
+ #[rustfmt::skip]
+ assert_eq_m128i(
+ r,
+ _mm_setr_epi8(
+ 0x7F, -0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0x80, 0x7F
+ )
+ );
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_packs_epi32() {
+ let a = _mm_setr_epi32(0x8000, -0x8001, 0, 0);
+ let b = _mm_setr_epi32(0, 0, -0x8001, 0x8000);
+ let r = _mm_packs_epi32(a, b);
+ assert_eq_m128i(
+ r,
+ _mm_setr_epi16(0x7FFF, -0x8000, 0, 0, 0, 0, -0x8000, 0x7FFF),
+ );
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_packus_epi16() {
+ let a = _mm_setr_epi16(0x100, -1, 0, 0, 0, 0, 0, 0);
+ let b = _mm_setr_epi16(0, 0, 0, 0, 0, 0, -1, 0x100);
+ let r = _mm_packus_epi16(a, b);
+ assert_eq_m128i(
+ r,
+ _mm_setr_epi8(!0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, !0),
+ );
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_extract_epi16() {
+ let a = _mm_setr_epi16(-1, 1, 2, 3, 4, 5, 6, 7);
+ let r1 = _mm_extract_epi16::<0>(a);
+ let r2 = _mm_extract_epi16::<3>(a);
+ assert_eq!(r1, 0xFFFF);
+ assert_eq!(r2, 3);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_insert_epi16() {
+ let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm_insert_epi16::<0>(a, 9);
+ let e = _mm_setr_epi16(9, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_movemask_epi8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0b1000_0000u8 as i8, 0b0, 0b1000_0000u8 as i8, 0b01,
+ 0b0101, 0b1111_0000u8 as i8, 0, 0,
+ 0, 0b1011_0101u8 as i8, 0b1111_0000u8 as i8, 0b0101,
+ 0b01, 0b1000_0000u8 as i8, 0b0, 0b1000_0000u8 as i8,
+ );
+ let r = _mm_movemask_epi8(a);
+ assert_eq!(r, 0b10100110_00100101);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_shuffle_epi32() {
+ let a = _mm_setr_epi32(5, 10, 15, 20);
+ let r = _mm_shuffle_epi32::<0b00_01_01_11>(a);
+ let e = _mm_setr_epi32(20, 10, 10, 5);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_shufflehi_epi16() {
+ let a = _mm_setr_epi16(1, 2, 3, 4, 5, 10, 15, 20);
+ let r = _mm_shufflehi_epi16::<0b00_01_01_11>(a);
+ let e = _mm_setr_epi16(1, 2, 3, 4, 20, 10, 10, 5);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_shufflelo_epi16() {
+ let a = _mm_setr_epi16(5, 10, 15, 20, 1, 2, 3, 4);
+ let r = _mm_shufflelo_epi16::<0b00_01_01_11>(a);
+ let e = _mm_setr_epi16(20, 10, 10, 5, 1, 2, 3, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_unpackhi_epi8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ );
+ let r = _mm_unpackhi_epi8(a, b);
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_unpackhi_epi16() {
+ let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm_setr_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_unpackhi_epi16(a, b);
+ let e = _mm_setr_epi16(4, 12, 5, 13, 6, 14, 7, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_unpackhi_epi32() {
+ let a = _mm_setr_epi32(0, 1, 2, 3);
+ let b = _mm_setr_epi32(4, 5, 6, 7);
+ let r = _mm_unpackhi_epi32(a, b);
+ let e = _mm_setr_epi32(2, 6, 3, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_unpackhi_epi64() {
+ let a = _mm_setr_epi64x(0, 1);
+ let b = _mm_setr_epi64x(2, 3);
+ let r = _mm_unpackhi_epi64(a, b);
+ let e = _mm_setr_epi64x(1, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_unpacklo_epi8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ );
+ let r = _mm_unpacklo_epi8(a, b);
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 0, 16, 1, 17, 2, 18, 3, 19,
+ 4, 20, 5, 21, 6, 22, 7, 23,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_unpacklo_epi16() {
+ let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm_setr_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_unpacklo_epi16(a, b);
+ let e = _mm_setr_epi16(0, 8, 1, 9, 2, 10, 3, 11);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_unpacklo_epi32() {
+ let a = _mm_setr_epi32(0, 1, 2, 3);
+ let b = _mm_setr_epi32(4, 5, 6, 7);
+ let r = _mm_unpacklo_epi32(a, b);
+ let e = _mm_setr_epi32(0, 4, 1, 5);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_unpacklo_epi64() {
+ let a = _mm_setr_epi64x(0, 1);
+ let b = _mm_setr_epi64x(2, 3);
+ let r = _mm_unpacklo_epi64(a, b);
+ let e = _mm_setr_epi64x(0, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_add_sd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_add_sd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(6.0, 2.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_add_pd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_add_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(6.0, 12.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_div_sd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_div_sd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(0.2, 2.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_div_pd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_div_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(0.2, 0.2));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_max_sd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_max_sd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(5.0, 2.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_max_pd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_max_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(5.0, 10.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_min_sd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_min_sd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(1.0, 2.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_min_pd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_min_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(1.0, 2.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_mul_sd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_mul_sd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(5.0, 2.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_mul_pd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_mul_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(5.0, 20.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sqrt_sd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_sqrt_sd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(5.0f64.sqrt(), 2.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sqrt_pd() {
+ let r = _mm_sqrt_pd(_mm_setr_pd(1.0, 2.0));
+ assert_eq_m128d(r, _mm_setr_pd(1.0f64.sqrt(), 2.0f64.sqrt()));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sub_sd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_sub_sd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(-4.0, 2.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_sub_pd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(5.0, 10.0);
+ let r = _mm_sub_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(-4.0, -8.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_and_pd() {
+ let a = transmute(u64x2::splat(5));
+ let b = transmute(u64x2::splat(3));
+ let r = _mm_and_pd(a, b);
+ let e = transmute(u64x2::splat(1));
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_andnot_pd() {
+ let a = transmute(u64x2::splat(5));
+ let b = transmute(u64x2::splat(3));
+ let r = _mm_andnot_pd(a, b);
+ let e = transmute(u64x2::splat(2));
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_or_pd() {
+ let a = transmute(u64x2::splat(5));
+ let b = transmute(u64x2::splat(3));
+ let r = _mm_or_pd(a, b);
+ let e = transmute(u64x2::splat(7));
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_xor_pd() {
+ let a = transmute(u64x2::splat(5));
+ let b = transmute(u64x2::splat(3));
+ let r = _mm_xor_pd(a, b);
+ let e = transmute(u64x2::splat(6));
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpeq_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(!0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmpeq_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmplt_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(5.0, 3.0));
+ let e = _mm_setr_epi64x(!0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmplt_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmple_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(!0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmple_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpgt_sd() {
+ let (a, b) = (_mm_setr_pd(5.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(!0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmpgt_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpge_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(!0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmpge_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpord_sd() {
+ let (a, b) = (_mm_setr_pd(NAN, 2.0), _mm_setr_pd(5.0, 3.0));
+ let e = _mm_setr_epi64x(0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmpord_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpunord_sd() {
+ let (a, b) = (_mm_setr_pd(NAN, 2.0), _mm_setr_pd(5.0, 3.0));
+ let e = _mm_setr_epi64x(!0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmpunord_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpneq_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(5.0, 3.0));
+ let e = _mm_setr_epi64x(!0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmpneq_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpnlt_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(5.0, 3.0));
+ let e = _mm_setr_epi64x(0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmpnlt_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpnle_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmpnle_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpngt_sd() {
+ let (a, b) = (_mm_setr_pd(5.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmpngt_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpnge_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(0, transmute(2.0f64));
+ let r = transmute::<_, __m128i>(_mm_cmpnge_sd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpeq_pd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(!0, 0);
+ let r = transmute::<_, __m128i>(_mm_cmpeq_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmplt_pd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(0, !0);
+ let r = transmute::<_, __m128i>(_mm_cmplt_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmple_pd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(!0, !0);
+ let r = transmute::<_, __m128i>(_mm_cmple_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpgt_pd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(0, 0);
+ let r = transmute::<_, __m128i>(_mm_cmpgt_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpge_pd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(!0, 0);
+ let r = transmute::<_, __m128i>(_mm_cmpge_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpord_pd() {
+ let (a, b) = (_mm_setr_pd(NAN, 2.0), _mm_setr_pd(5.0, 3.0));
+ let e = _mm_setr_epi64x(0, !0);
+ let r = transmute::<_, __m128i>(_mm_cmpord_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpunord_pd() {
+ let (a, b) = (_mm_setr_pd(NAN, 2.0), _mm_setr_pd(5.0, 3.0));
+ let e = _mm_setr_epi64x(!0, 0);
+ let r = transmute::<_, __m128i>(_mm_cmpunord_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpneq_pd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(5.0, 3.0));
+ let e = _mm_setr_epi64x(!0, !0);
+ let r = transmute::<_, __m128i>(_mm_cmpneq_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpnlt_pd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(5.0, 3.0));
+ let e = _mm_setr_epi64x(0, 0);
+ let r = transmute::<_, __m128i>(_mm_cmpnlt_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpnle_pd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(0, 0);
+ let r = transmute::<_, __m128i>(_mm_cmpnle_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpngt_pd() {
+ let (a, b) = (_mm_setr_pd(5.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(0, !0);
+ let r = transmute::<_, __m128i>(_mm_cmpngt_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cmpnge_pd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ let e = _mm_setr_epi64x(0, !0);
+ let r = transmute::<_, __m128i>(_mm_cmpnge_pd(a, b));
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_comieq_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_comieq_sd(a, b) != 0);
+
+ let (a, b) = (_mm_setr_pd(NAN, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_comieq_sd(a, b) == 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_comilt_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_comilt_sd(a, b) == 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_comile_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_comile_sd(a, b) != 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_comigt_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_comigt_sd(a, b) == 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_comige_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_comige_sd(a, b) != 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_comineq_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_comineq_sd(a, b) == 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_ucomieq_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_ucomieq_sd(a, b) != 0);
+
+ let (a, b) = (_mm_setr_pd(NAN, 2.0), _mm_setr_pd(NAN, 3.0));
+ assert!(_mm_ucomieq_sd(a, b) == 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_ucomilt_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_ucomilt_sd(a, b) == 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_ucomile_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_ucomile_sd(a, b) != 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_ucomigt_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_ucomigt_sd(a, b) == 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_ucomige_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_ucomige_sd(a, b) != 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_ucomineq_sd() {
+ let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0));
+ assert!(_mm_ucomineq_sd(a, b) == 0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_movemask_pd() {
+ let r = _mm_movemask_pd(_mm_setr_pd(-1.0, 5.0));
+ assert_eq!(r, 0b01);
+
+ let r = _mm_movemask_pd(_mm_setr_pd(-1.0, -5.0));
+ assert_eq!(r, 0b11);
+ }
+
+ #[repr(align(16))]
+ struct Memory {
+ data: [f64; 4],
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_load_pd() {
+ let mem = Memory {
+ data: [1.0f64, 2.0, 3.0, 4.0],
+ };
+ let vals = &mem.data;
+ let d = vals.as_ptr();
+
+ let r = _mm_load_pd(d);
+ assert_eq_m128d(r, _mm_setr_pd(1.0, 2.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_load_sd() {
+ let a = 1.;
+ let expected = _mm_setr_pd(a, 0.);
+ let r = _mm_load_sd(&a);
+ assert_eq_m128d(r, expected);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_loadh_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = 3.;
+ let expected = _mm_setr_pd(_mm_cvtsd_f64(a), 3.);
+ let r = _mm_loadh_pd(a, &b);
+ assert_eq_m128d(r, expected);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_loadl_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = 3.;
+ let expected = _mm_setr_pd(3., get_m128d(a, 1));
+ let r = _mm_loadl_pd(a, &b);
+ assert_eq_m128d(r, expected);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_stream_pd() {
+ #[repr(align(128))]
+ struct Memory {
+ pub data: [f64; 2],
+ }
+ let a = _mm_set1_pd(7.0);
+ let mut mem = Memory { data: [-1.0; 2] };
+
+ _mm_stream_pd(&mut mem.data[0] as *mut f64, a);
+ for i in 0..2 {
+ assert_eq!(mem.data[i], get_m128d(a, i));
+ }
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_store_sd() {
+ let mut dest = 0.;
+ let a = _mm_setr_pd(1., 2.);
+ _mm_store_sd(&mut dest, a);
+ assert_eq!(dest, _mm_cvtsd_f64(a));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_store_pd() {
+ let mut mem = Memory { data: [0.0f64; 4] };
+ let vals = &mut mem.data;
+ let a = _mm_setr_pd(1.0, 2.0);
+ let d = vals.as_mut_ptr();
+
+ _mm_store_pd(d, *black_box(&a));
+ assert_eq!(vals[0], 1.0);
+ assert_eq!(vals[1], 2.0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_storeu_pd() {
+ let mut mem = Memory { data: [0.0f64; 4] };
+ let vals = &mut mem.data;
+ let a = _mm_setr_pd(1.0, 2.0);
+
+ let mut ofs = 0;
+ let mut p = vals.as_mut_ptr();
+
+ // Make sure p is **not** aligned to 16-byte boundary
+ if (p as usize) & 0xf == 0 {
+ ofs = 1;
+ p = p.offset(1);
+ }
+
+ _mm_storeu_pd(p, *black_box(&a));
+
+ if ofs > 0 {
+ assert_eq!(vals[ofs - 1], 0.0);
+ }
+ assert_eq!(vals[ofs + 0], 1.0);
+ assert_eq!(vals[ofs + 1], 2.0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_store1_pd() {
+ let mut mem = Memory { data: [0.0f64; 4] };
+ let vals = &mut mem.data;
+ let a = _mm_setr_pd(1.0, 2.0);
+ let d = vals.as_mut_ptr();
+
+ _mm_store1_pd(d, *black_box(&a));
+ assert_eq!(vals[0], 1.0);
+ assert_eq!(vals[1], 1.0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_store_pd1() {
+ let mut mem = Memory { data: [0.0f64; 4] };
+ let vals = &mut mem.data;
+ let a = _mm_setr_pd(1.0, 2.0);
+ let d = vals.as_mut_ptr();
+
+ _mm_store_pd1(d, *black_box(&a));
+ assert_eq!(vals[0], 1.0);
+ assert_eq!(vals[1], 1.0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_storer_pd() {
+ let mut mem = Memory { data: [0.0f64; 4] };
+ let vals = &mut mem.data;
+ let a = _mm_setr_pd(1.0, 2.0);
+ let d = vals.as_mut_ptr();
+
+ _mm_storer_pd(d, *black_box(&a));
+ assert_eq!(vals[0], 2.0);
+ assert_eq!(vals[1], 1.0);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_storeh_pd() {
+ let mut dest = 0.;
+ let a = _mm_setr_pd(1., 2.);
+ _mm_storeh_pd(&mut dest, a);
+ assert_eq!(dest, get_m128d(a, 1));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_storel_pd() {
+ let mut dest = 0.;
+ let a = _mm_setr_pd(1., 2.);
+ _mm_storel_pd(&mut dest, a);
+ assert_eq!(dest, _mm_cvtsd_f64(a));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_loadr_pd() {
+ let mut mem = Memory {
+ data: [1.0f64, 2.0, 3.0, 4.0],
+ };
+ let vals = &mut mem.data;
+ let d = vals.as_ptr();
+
+ let r = _mm_loadr_pd(d);
+ assert_eq_m128d(r, _mm_setr_pd(2.0, 1.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_loadu_pd() {
+ let mut mem = Memory {
+ data: [1.0f64, 2.0, 3.0, 4.0],
+ };
+ let vals = &mut mem.data;
+ let mut d = vals.as_ptr();
+
+ // make sure d is not aligned to 16-byte boundary
+ let mut offset = 0;
+ if (d as usize) & 0xf == 0 {
+ offset = 1;
+ d = d.offset(offset as isize);
+ }
+
+ let r = _mm_loadu_pd(d);
+ let e = _mm_add_pd(_mm_setr_pd(1.0, 2.0), _mm_set1_pd(offset as f64));
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtpd_ps() {
+ let r = _mm_cvtpd_ps(_mm_setr_pd(-1.0, 5.0));
+ assert_eq_m128(r, _mm_setr_ps(-1.0, 5.0, 0.0, 0.0));
+
+ let r = _mm_cvtpd_ps(_mm_setr_pd(-1.0, -5.0));
+ assert_eq_m128(r, _mm_setr_ps(-1.0, -5.0, 0.0, 0.0));
+
+ let r = _mm_cvtpd_ps(_mm_setr_pd(f64::MAX, f64::MIN));
+ assert_eq_m128(r, _mm_setr_ps(f32::INFINITY, f32::NEG_INFINITY, 0.0, 0.0));
+
+ let r = _mm_cvtpd_ps(_mm_setr_pd(f32::MAX as f64, f32::MIN as f64));
+ assert_eq_m128(r, _mm_setr_ps(f32::MAX, f32::MIN, 0.0, 0.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtps_pd() {
+ let r = _mm_cvtps_pd(_mm_setr_ps(-1.0, 2.0, -3.0, 5.0));
+ assert_eq_m128d(r, _mm_setr_pd(-1.0, 2.0));
+
+ let r = _mm_cvtps_pd(_mm_setr_ps(
+ f32::MAX,
+ f32::INFINITY,
+ f32::NEG_INFINITY,
+ f32::MIN,
+ ));
+ assert_eq_m128d(r, _mm_setr_pd(f32::MAX as f64, f64::INFINITY));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtpd_epi32() {
+ let r = _mm_cvtpd_epi32(_mm_setr_pd(-1.0, 5.0));
+ assert_eq_m128i(r, _mm_setr_epi32(-1, 5, 0, 0));
+
+ let r = _mm_cvtpd_epi32(_mm_setr_pd(-1.0, -5.0));
+ assert_eq_m128i(r, _mm_setr_epi32(-1, -5, 0, 0));
+
+ let r = _mm_cvtpd_epi32(_mm_setr_pd(f64::MAX, f64::MIN));
+ assert_eq_m128i(r, _mm_setr_epi32(i32::MIN, i32::MIN, 0, 0));
+
+ let r = _mm_cvtpd_epi32(_mm_setr_pd(f64::INFINITY, f64::NEG_INFINITY));
+ assert_eq_m128i(r, _mm_setr_epi32(i32::MIN, i32::MIN, 0, 0));
+
+ let r = _mm_cvtpd_epi32(_mm_setr_pd(f64::NAN, f64::NAN));
+ assert_eq_m128i(r, _mm_setr_epi32(i32::MIN, i32::MIN, 0, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsd_si32() {
+ let r = _mm_cvtsd_si32(_mm_setr_pd(-2.0, 5.0));
+ assert_eq!(r, -2);
+
+ let r = _mm_cvtsd_si32(_mm_setr_pd(f64::MAX, f64::MIN));
+ assert_eq!(r, i32::MIN);
+
+ let r = _mm_cvtsd_si32(_mm_setr_pd(f64::NAN, f64::NAN));
+ assert_eq!(r, i32::MIN);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsd_ss() {
+ let a = _mm_setr_ps(-1.1, -2.2, 3.3, 4.4);
+ let b = _mm_setr_pd(2.0, -5.0);
+
+ let r = _mm_cvtsd_ss(a, b);
+
+ assert_eq_m128(r, _mm_setr_ps(2.0, -2.2, 3.3, 4.4));
+
+ let a = _mm_setr_ps(-1.1, f32::NEG_INFINITY, f32::MAX, f32::NEG_INFINITY);
+ let b = _mm_setr_pd(f64::INFINITY, -5.0);
+
+ let r = _mm_cvtsd_ss(a, b);
+
+ assert_eq_m128(
+ r,
+ _mm_setr_ps(
+ f32::INFINITY,
+ f32::NEG_INFINITY,
+ f32::MAX,
+ f32::NEG_INFINITY,
+ ),
+ );
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsd_f64() {
+ let r = _mm_cvtsd_f64(_mm_setr_pd(-1.1, 2.2));
+ assert_eq!(r, -1.1);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtss_sd() {
+ let a = _mm_setr_pd(-1.1, 2.2);
+ let b = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+
+ let r = _mm_cvtss_sd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(1.0, 2.2));
+
+ let a = _mm_setr_pd(-1.1, f64::INFINITY);
+ let b = _mm_setr_ps(f32::NEG_INFINITY, 2.0, 3.0, 4.0);
+
+ let r = _mm_cvtss_sd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(f64::NEG_INFINITY, f64::INFINITY));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvttpd_epi32() {
+ let a = _mm_setr_pd(-1.1, 2.2);
+ let r = _mm_cvttpd_epi32(a);
+ assert_eq_m128i(r, _mm_setr_epi32(-1, 2, 0, 0));
+
+ let a = _mm_setr_pd(f64::NEG_INFINITY, f64::NAN);
+ let r = _mm_cvttpd_epi32(a);
+ assert_eq_m128i(r, _mm_setr_epi32(i32::MIN, i32::MIN, 0, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvttsd_si32() {
+ let a = _mm_setr_pd(-1.1, 2.2);
+ let r = _mm_cvttsd_si32(a);
+ assert_eq!(r, -1);
+
+ let a = _mm_setr_pd(f64::NEG_INFINITY, f64::NAN);
+ let r = _mm_cvttsd_si32(a);
+ assert_eq!(r, i32::MIN);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvttps_epi32() {
+ let a = _mm_setr_ps(-1.1, 2.2, -3.3, 6.6);
+ let r = _mm_cvttps_epi32(a);
+ assert_eq_m128i(r, _mm_setr_epi32(-1, 2, -3, 6));
+
+ let a = _mm_setr_ps(f32::NEG_INFINITY, f32::INFINITY, f32::MIN, f32::MAX);
+ let r = _mm_cvttps_epi32(a);
+ assert_eq_m128i(r, _mm_setr_epi32(i32::MIN, i32::MIN, i32::MIN, i32::MIN));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set_sd() {
+ let r = _mm_set_sd(-1.0_f64);
+ assert_eq_m128d(r, _mm_setr_pd(-1.0_f64, 0_f64));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set1_pd() {
+ let r = _mm_set1_pd(-1.0_f64);
+ assert_eq_m128d(r, _mm_setr_pd(-1.0_f64, -1.0_f64));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set_pd1() {
+ let r = _mm_set_pd1(-2.0_f64);
+ assert_eq_m128d(r, _mm_setr_pd(-2.0_f64, -2.0_f64));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_set_pd() {
+ let r = _mm_set_pd(1.0_f64, 5.0_f64);
+ assert_eq_m128d(r, _mm_setr_pd(5.0_f64, 1.0_f64));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_setr_pd() {
+ let r = _mm_setr_pd(1.0_f64, -5.0_f64);
+ assert_eq_m128d(r, _mm_setr_pd(1.0_f64, -5.0_f64));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_setzero_pd() {
+ let r = _mm_setzero_pd();
+ assert_eq_m128d(r, _mm_setr_pd(0_f64, 0_f64));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_load1_pd() {
+ let d = -5.0;
+ let r = _mm_load1_pd(&d);
+ assert_eq_m128d(r, _mm_setr_pd(d, d));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_load_pd1() {
+ let d = -5.0;
+ let r = _mm_load_pd1(&d);
+ assert_eq_m128d(r, _mm_setr_pd(d, d));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_unpackhi_pd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(3.0, 4.0);
+ let r = _mm_unpackhi_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(2.0, 4.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_unpacklo_pd() {
+ let a = _mm_setr_pd(1.0, 2.0);
+ let b = _mm_setr_pd(3.0, 4.0);
+ let r = _mm_unpacklo_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(1.0, 3.0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_shuffle_pd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(3., 4.);
+ let expected = _mm_setr_pd(1., 3.);
+ let r = _mm_shuffle_pd::<0b00_00_00_00>(a, b);
+ assert_eq_m128d(r, expected);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_move_sd() {
+ let a = _mm_setr_pd(1., 2.);
+ let b = _mm_setr_pd(3., 4.);
+ let expected = _mm_setr_pd(3., 2.);
+ let r = _mm_move_sd(a, b);
+ assert_eq_m128d(r, expected);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_castpd_ps() {
+ let a = _mm_set1_pd(0.);
+ let expected = _mm_set1_ps(0.);
+ let r = _mm_castpd_ps(a);
+ assert_eq_m128(r, expected);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_castpd_si128() {
+ let a = _mm_set1_pd(0.);
+ let expected = _mm_set1_epi64x(0);
+ let r = _mm_castpd_si128(a);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_castps_pd() {
+ let a = _mm_set1_ps(0.);
+ let expected = _mm_set1_pd(0.);
+ let r = _mm_castps_pd(a);
+ assert_eq_m128d(r, expected);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_castps_si128() {
+ let a = _mm_set1_ps(0.);
+ let expected = _mm_set1_epi32(0);
+ let r = _mm_castps_si128(a);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_castsi128_pd() {
+ let a = _mm_set1_epi64x(0);
+ let expected = _mm_set1_pd(0.);
+ let r = _mm_castsi128_pd(a);
+ assert_eq_m128d(r, expected);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_castsi128_ps() {
+ let a = _mm_set1_epi32(0);
+ let expected = _mm_set1_ps(0.);
+ let r = _mm_castsi128_ps(a);
+ assert_eq_m128(r, expected);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/sse3.rs b/library/stdarch/crates/core_arch/src/x86/sse3.rs
new file mode 100644
index 000000000..ab0dd38fe
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/sse3.rs
@@ -0,0 +1,260 @@
+//! Streaming SIMD Extensions 3 (SSE3)
+
+use crate::{
+ core_arch::{
+ simd::*,
+ simd_llvm::{simd_shuffle2, simd_shuffle4},
+ x86::*,
+ },
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Alternatively add and subtract packed single-precision (32-bit)
+/// floating-point elements in `a` to/from packed elements in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_addsub_ps)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(addsubps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_addsub_ps(a: __m128, b: __m128) -> __m128 {
+ addsubps(a, b)
+}
+
+/// Alternatively add and subtract packed double-precision (64-bit)
+/// floating-point elements in `a` to/from packed elements in `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_addsub_pd)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(addsubpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_addsub_pd(a: __m128d, b: __m128d) -> __m128d {
+ addsubpd(a, b)
+}
+
+/// Horizontally adds adjacent pairs of double-precision (64-bit)
+/// floating-point elements in `a` and `b`, and pack the results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hadd_pd)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(haddpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_hadd_pd(a: __m128d, b: __m128d) -> __m128d {
+ haddpd(a, b)
+}
+
+/// Horizontally adds adjacent pairs of single-precision (32-bit)
+/// floating-point elements in `a` and `b`, and pack the results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hadd_ps)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(haddps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_hadd_ps(a: __m128, b: __m128) -> __m128 {
+ haddps(a, b)
+}
+
+/// Horizontally subtract adjacent pairs of double-precision (64-bit)
+/// floating-point elements in `a` and `b`, and pack the results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hsub_pd)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(hsubpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_hsub_pd(a: __m128d, b: __m128d) -> __m128d {
+ hsubpd(a, b)
+}
+
+/// Horizontally adds adjacent pairs of single-precision (32-bit)
+/// floating-point elements in `a` and `b`, and pack the results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hsub_ps)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(hsubps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_hsub_ps(a: __m128, b: __m128) -> __m128 {
+ hsubps(a, b)
+}
+
+/// Loads 128-bits of integer data from unaligned memory.
+/// This intrinsic may perform better than `_mm_loadu_si128`
+/// when the data crosses a cache line boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_lddqu_si128)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(lddqu))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_lddqu_si128(mem_addr: *const __m128i) -> __m128i {
+ transmute(lddqu(mem_addr as *const _))
+}
+
+/// Duplicate the low double-precision (64-bit) floating-point element
+/// from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movedup_pd)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(movddup))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_movedup_pd(a: __m128d) -> __m128d {
+ simd_shuffle2!(a, a, [0, 0])
+}
+
+/// Loads a double-precision (64-bit) floating-point element from memory
+/// into both elements of return vector.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_loaddup_pd)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(movddup))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_loaddup_pd(mem_addr: *const f64) -> __m128d {
+ _mm_load1_pd(mem_addr)
+}
+
+/// Duplicate odd-indexed single-precision (32-bit) floating-point elements
+/// from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movehdup_ps)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(movshdup))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_movehdup_ps(a: __m128) -> __m128 {
+ simd_shuffle4!(a, a, [1, 1, 3, 3])
+}
+
+/// Duplicate even-indexed single-precision (32-bit) floating-point elements
+/// from `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_moveldup_ps)
+#[inline]
+#[target_feature(enable = "sse3")]
+#[cfg_attr(test, assert_instr(movsldup))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_moveldup_ps(a: __m128) -> __m128 {
+ simd_shuffle4!(a, a, [0, 0, 2, 2])
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.sse3.addsub.ps"]
+ fn addsubps(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse3.addsub.pd"]
+ fn addsubpd(a: __m128d, b: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.sse3.hadd.pd"]
+ fn haddpd(a: __m128d, b: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.sse3.hadd.ps"]
+ fn haddps(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse3.hsub.pd"]
+ fn hsubpd(a: __m128d, b: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.sse3.hsub.ps"]
+ fn hsubps(a: __m128, b: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse3.ldu.dq"]
+ fn lddqu(mem_addr: *const i8) -> i8x16;
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_addsub_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_addsub_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(99.0, 25.0, 0.0, -15.0));
+ }
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_addsub_pd() {
+ let a = _mm_setr_pd(-1.0, 5.0);
+ let b = _mm_setr_pd(-100.0, 20.0);
+ let r = _mm_addsub_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(99.0, 25.0));
+ }
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_hadd_pd() {
+ let a = _mm_setr_pd(-1.0, 5.0);
+ let b = _mm_setr_pd(-100.0, 20.0);
+ let r = _mm_hadd_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(4.0, -80.0));
+ }
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_hadd_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_hadd_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(4.0, -10.0, -80.0, -5.0));
+ }
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_hsub_pd() {
+ let a = _mm_setr_pd(-1.0, 5.0);
+ let b = _mm_setr_pd(-100.0, 20.0);
+ let r = _mm_hsub_pd(a, b);
+ assert_eq_m128d(r, _mm_setr_pd(-6.0, -120.0));
+ }
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_hsub_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0);
+ let r = _mm_hsub_ps(a, b);
+ assert_eq_m128(r, _mm_setr_ps(-6.0, 10.0, -120.0, 5.0));
+ }
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_lddqu_si128() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16,
+ );
+ let r = _mm_lddqu_si128(&a);
+ assert_eq_m128i(a, r);
+ }
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_movedup_pd() {
+ let a = _mm_setr_pd(-1.0, 5.0);
+ let r = _mm_movedup_pd(a);
+ assert_eq_m128d(r, _mm_setr_pd(-1.0, -1.0));
+ }
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_movehdup_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let r = _mm_movehdup_ps(a);
+ assert_eq_m128(r, _mm_setr_ps(5.0, 5.0, -10.0, -10.0));
+ }
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_moveldup_ps() {
+ let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0);
+ let r = _mm_moveldup_ps(a);
+ assert_eq_m128(r, _mm_setr_ps(-1.0, -1.0, 0.0, 0.0));
+ }
+
+ #[simd_test(enable = "sse3")]
+ unsafe fn test_mm_loaddup_pd() {
+ let d = -5.0;
+ let r = _mm_loaddup_pd(&d);
+ assert_eq_m128d(r, _mm_setr_pd(d, d));
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/sse41.rs b/library/stdarch/crates/core_arch/src/x86/sse41.rs
new file mode 100644
index 000000000..7c59f2702
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/sse41.rs
@@ -0,0 +1,1887 @@
+//! Streaming SIMD Extensions 4.1 (SSE4.1)
+
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+// SSE4 rounding constants
+/// round to nearest
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_TO_NEAREST_INT: i32 = 0x00;
+/// round down
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_TO_NEG_INF: i32 = 0x01;
+/// round up
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_TO_POS_INF: i32 = 0x02;
+/// truncate
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_TO_ZERO: i32 = 0x03;
+/// use MXCSR.RC; see `vendor::_MM_SET_ROUNDING_MODE`
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_CUR_DIRECTION: i32 = 0x04;
+/// do not suppress exceptions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_RAISE_EXC: i32 = 0x00;
+/// suppress exceptions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_NO_EXC: i32 = 0x08;
+/// round to nearest and do not suppress exceptions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_NINT: i32 = 0x00;
+/// round down and do not suppress exceptions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_FLOOR: i32 = _MM_FROUND_RAISE_EXC | _MM_FROUND_TO_NEG_INF;
+/// round up and do not suppress exceptions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_CEIL: i32 = _MM_FROUND_RAISE_EXC | _MM_FROUND_TO_POS_INF;
+/// truncate and do not suppress exceptions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_TRUNC: i32 = _MM_FROUND_RAISE_EXC | _MM_FROUND_TO_ZERO;
+/// use MXCSR.RC and do not suppress exceptions; see
+/// `vendor::_MM_SET_ROUNDING_MODE`
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_RINT: i32 = _MM_FROUND_RAISE_EXC | _MM_FROUND_CUR_DIRECTION;
+/// use MXCSR.RC and suppress exceptions; see `vendor::_MM_SET_ROUNDING_MODE`
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _MM_FROUND_NEARBYINT: i32 = _MM_FROUND_NO_EXC | _MM_FROUND_CUR_DIRECTION;
+
+/// Blend packed 8-bit integers from `a` and `b` using `mask`
+///
+/// The high bit of each corresponding mask byte determines the selection.
+/// If the high bit is set the element of `a` is selected. The element
+/// of `b` is selected otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_blendv_epi8)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pblendvb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_blendv_epi8(a: __m128i, b: __m128i, mask: __m128i) -> __m128i {
+ transmute(pblendvb(a.as_i8x16(), b.as_i8x16(), mask.as_i8x16()))
+}
+
+/// Blend packed 16-bit integers from `a` and `b` using the mask `IMM8`.
+///
+/// The mask bits determine the selection. A clear bit selects the
+/// corresponding element of `a`, and a set bit the corresponding
+/// element of `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_blend_epi16)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+// Note: LLVM7 prefers the single-precision floating-point domain when possible
+// see https://bugs.llvm.org/show_bug.cgi?id=38195
+// #[cfg_attr(test, assert_instr(pblendw, IMM8 = 0xF0))]
+#[cfg_attr(test, assert_instr(blendps, IMM8 = 0xF0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_blend_epi16<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(pblendw(a.as_i16x8(), b.as_i16x8(), IMM8 as u8))
+}
+
+/// Blend packed double-precision (64-bit) floating-point elements from `a`
+/// and `b` using `mask`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_blendv_pd)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(blendvpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_blendv_pd(a: __m128d, b: __m128d, mask: __m128d) -> __m128d {
+ blendvpd(a, b, mask)
+}
+
+/// Blend packed single-precision (32-bit) floating-point elements from `a`
+/// and `b` using `mask`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_blendv_ps)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(blendvps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_blendv_ps(a: __m128, b: __m128, mask: __m128) -> __m128 {
+ blendvps(a, b, mask)
+}
+
+/// Blend packed double-precision (64-bit) floating-point elements from `a`
+/// and `b` using control mask `IMM2`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_blend_pd)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+// Note: LLVM7 prefers the single-precision floating-point domain when possible
+// see https://bugs.llvm.org/show_bug.cgi?id=38195
+// #[cfg_attr(test, assert_instr(blendpd, IMM2 = 0b10))]
+#[cfg_attr(test, assert_instr(blendps, IMM2 = 0b10))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_blend_pd<const IMM2: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_imm2!(IMM2);
+ blendpd(a, b, IMM2 as u8)
+}
+
+/// Blend packed single-precision (32-bit) floating-point elements from `a`
+/// and `b` using mask `IMM4`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_blend_ps)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(blendps, IMM4 = 0b0101))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_blend_ps<const IMM4: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_imm4!(IMM4);
+ blendps(a, b, IMM4 as u8)
+}
+
+/// Extracts a single-precision (32-bit) floating-point element from `a`,
+/// selected with `IMM8`. The returned `i32` stores the float's bit-pattern,
+/// and may be converted back to a floating point number via casting.
+///
+/// # Example
+/// ```rust
+/// # #[cfg(target_arch = "x86")]
+/// # use std::arch::x86::*;
+/// # #[cfg(target_arch = "x86_64")]
+/// # use std::arch::x86_64::*;
+/// # fn main() {
+/// # if is_x86_feature_detected!("sse4.1") {
+/// # #[target_feature(enable = "sse4.1")]
+/// # unsafe fn worker() {
+/// let mut float_store = vec![1.0, 1.0, 2.0, 3.0];
+/// let simd_floats = _mm_set_ps(2.5, 5.0, 7.5, 10.0);
+/// let x: i32 = _mm_extract_ps::<2>(simd_floats);
+/// float_store.push(f32::from_bits(x as u32));
+/// assert_eq!(float_store, vec![1.0, 1.0, 2.0, 3.0, 5.0]);
+/// # }
+/// # unsafe { worker() }
+/// # }
+/// # }
+/// ```
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_extract_ps)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(extractps, IMM8 = 0)
+)]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_extract_ps<const IMM8: i32>(a: __m128) -> i32 {
+ static_assert_imm2!(IMM8);
+ transmute(simd_extract::<_, f32>(a, IMM8 as u32))
+}
+
+/// Extracts an 8-bit integer from `a`, selected with `IMM8`. Returns a 32-bit
+/// integer containing the zero-extended integer data.
+///
+/// See [LLVM commit D20468](https://reviews.llvm.org/D20468).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_extract_epi8)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pextrb, IMM8 = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_extract_epi8<const IMM8: i32>(a: __m128i) -> i32 {
+ static_assert_imm4!(IMM8);
+ simd_extract::<_, u8>(a.as_u8x16(), IMM8 as u32) as i32
+}
+
+/// Extracts an 32-bit integer from `a` selected with `IMM8`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_extract_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(
+ all(test, not(target_os = "windows")),
+ assert_instr(extractps, IMM8 = 1)
+)]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_extract_epi32<const IMM8: i32>(a: __m128i) -> i32 {
+ static_assert_imm2!(IMM8);
+ simd_extract::<_, i32>(a.as_i32x4(), IMM8 as u32)
+}
+
+/// Select a single value in `a` to store at some position in `b`,
+/// Then zero elements according to `IMM8`.
+///
+/// `IMM8` specifies which bits from operand `a` will be copied, which bits in
+/// the result they will be copied to, and which bits in the result will be
+/// cleared. The following assignments are made:
+///
+/// * Bits `[7:6]` specify the bits to copy from operand `a`:
+/// - `00`: Selects bits `[31:0]` from operand `a`.
+/// - `01`: Selects bits `[63:32]` from operand `a`.
+/// - `10`: Selects bits `[95:64]` from operand `a`.
+/// - `11`: Selects bits `[127:96]` from operand `a`.
+///
+/// * Bits `[5:4]` specify the bits in the result to which the selected bits
+/// from operand `a` are copied:
+/// - `00`: Copies the selected bits from `a` to result bits `[31:0]`.
+/// - `01`: Copies the selected bits from `a` to result bits `[63:32]`.
+/// - `10`: Copies the selected bits from `a` to result bits `[95:64]`.
+/// - `11`: Copies the selected bits from `a` to result bits `[127:96]`.
+///
+/// * Bits `[3:0]`: If any of these bits are set, the corresponding result
+/// element is cleared.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_insert_ps)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(insertps, IMM8 = 0b1010))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_insert_ps<const IMM8: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_imm8!(IMM8);
+ insertps(a, b, IMM8 as u8)
+}
+
+/// Returns a copy of `a` with the 8-bit integer from `i` inserted at a
+/// location specified by `IMM8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_insert_epi8)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pinsrb, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_insert_epi8<const IMM8: i32>(a: __m128i, i: i32) -> __m128i {
+ static_assert_imm4!(IMM8);
+ transmute(simd_insert(a.as_i8x16(), IMM8 as u32, i as i8))
+}
+
+/// Returns a copy of `a` with the 32-bit integer from `i` inserted at a
+/// location specified by `IMM8`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_insert_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pinsrd, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_insert_epi32<const IMM8: i32>(a: __m128i, i: i32) -> __m128i {
+ static_assert_imm2!(IMM8);
+ transmute(simd_insert(a.as_i32x4(), IMM8 as u32, i))
+}
+
+/// Compares packed 8-bit integers in `a` and `b` and returns packed maximum
+/// values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_epi8)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmaxsb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_max_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmaxsb(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Compares packed unsigned 16-bit integers in `a` and `b`, and returns packed
+/// maximum.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_epu16)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmaxuw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_max_epu16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmaxuw(a.as_u16x8(), b.as_u16x8()))
+}
+
+/// Compares packed 32-bit integers in `a` and `b`, and returns packed maximum
+/// values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmaxsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_max_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmaxsd(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compares packed unsigned 32-bit integers in `a` and `b`, and returns packed
+/// maximum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_max_epu32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmaxud))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_max_epu32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmaxud(a.as_u32x4(), b.as_u32x4()))
+}
+
+/// Compares packed 8-bit integers in `a` and `b` and returns packed minimum
+/// values in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_epi8)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pminsb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_min_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pminsb(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Compares packed unsigned 16-bit integers in `a` and `b`, and returns packed
+/// minimum.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_epu16)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pminuw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_min_epu16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pminuw(a.as_u16x8(), b.as_u16x8()))
+}
+
+/// Compares packed 32-bit integers in `a` and `b`, and returns packed minimum
+/// values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pminsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_min_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pminsd(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compares packed unsigned 32-bit integers in `a` and `b`, and returns packed
+/// minimum values.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_min_epu32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pminud))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_min_epu32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pminud(a.as_u32x4(), b.as_u32x4()))
+}
+
+/// Converts packed 32-bit integers from `a` and `b` to packed 16-bit integers
+/// using unsigned saturation
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_packus_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(packusdw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_packus_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(packusdw(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Compares packed 64-bit integers in `a` and `b` for equality
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpeq_epi64)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pcmpeqq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpeq_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_eq::<_, i64x2>(a.as_i64x2(), b.as_i64x2()))
+}
+
+/// Sign extend packed 8-bit integers in `a` to packed 16-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi8_epi16)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovsxbw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepi8_epi16(a: __m128i) -> __m128i {
+ let a = a.as_i8x16();
+ let a: i8x8 = simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]);
+ transmute(simd_cast::<_, i16x8>(a))
+}
+
+/// Sign extend packed 8-bit integers in `a` to packed 32-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi8_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovsxbd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepi8_epi32(a: __m128i) -> __m128i {
+ let a = a.as_i8x16();
+ let a: i8x4 = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ transmute(simd_cast::<_, i32x4>(a))
+}
+
+/// Sign extend packed 8-bit integers in the low 8 bytes of `a` to packed
+/// 64-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi8_epi64)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovsxbq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepi8_epi64(a: __m128i) -> __m128i {
+ let a = a.as_i8x16();
+ let a: i8x2 = simd_shuffle2!(a, a, [0, 1]);
+ transmute(simd_cast::<_, i64x2>(a))
+}
+
+/// Sign extend packed 16-bit integers in `a` to packed 32-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi16_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovsxwd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepi16_epi32(a: __m128i) -> __m128i {
+ let a = a.as_i16x8();
+ let a: i16x4 = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ transmute(simd_cast::<_, i32x4>(a))
+}
+
+/// Sign extend packed 16-bit integers in `a` to packed 64-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi16_epi64)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovsxwq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepi16_epi64(a: __m128i) -> __m128i {
+ let a = a.as_i16x8();
+ let a: i16x2 = simd_shuffle2!(a, a, [0, 1]);
+ transmute(simd_cast::<_, i64x2>(a))
+}
+
+/// Sign extend packed 32-bit integers in `a` to packed 64-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepi32_epi64)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovsxdq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepi32_epi64(a: __m128i) -> __m128i {
+ let a = a.as_i32x4();
+ let a: i32x2 = simd_shuffle2!(a, a, [0, 1]);
+ transmute(simd_cast::<_, i64x2>(a))
+}
+
+/// Zeroes extend packed unsigned 8-bit integers in `a` to packed 16-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepu8_epi16)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovzxbw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepu8_epi16(a: __m128i) -> __m128i {
+ let a = a.as_u8x16();
+ let a: u8x8 = simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]);
+ transmute(simd_cast::<_, i16x8>(a))
+}
+
+/// Zeroes extend packed unsigned 8-bit integers in `a` to packed 32-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepu8_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovzxbd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepu8_epi32(a: __m128i) -> __m128i {
+ let a = a.as_u8x16();
+ let a: u8x4 = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ transmute(simd_cast::<_, i32x4>(a))
+}
+
+/// Zeroes extend packed unsigned 8-bit integers in `a` to packed 64-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepu8_epi64)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovzxbq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepu8_epi64(a: __m128i) -> __m128i {
+ let a = a.as_u8x16();
+ let a: u8x2 = simd_shuffle2!(a, a, [0, 1]);
+ transmute(simd_cast::<_, i64x2>(a))
+}
+
+/// Zeroes extend packed unsigned 16-bit integers in `a`
+/// to packed 32-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepu16_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovzxwd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepu16_epi32(a: __m128i) -> __m128i {
+ let a = a.as_u16x8();
+ let a: u16x4 = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ transmute(simd_cast::<_, i32x4>(a))
+}
+
+/// Zeroes extend packed unsigned 16-bit integers in `a`
+/// to packed 64-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepu16_epi64)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovzxwq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepu16_epi64(a: __m128i) -> __m128i {
+ let a = a.as_u16x8();
+ let a: u16x2 = simd_shuffle2!(a, a, [0, 1]);
+ transmute(simd_cast::<_, i64x2>(a))
+}
+
+/// Zeroes extend packed unsigned 32-bit integers in `a`
+/// to packed 64-bit integers
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepu32_epi64)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmovzxdq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtepu32_epi64(a: __m128i) -> __m128i {
+ let a = a.as_u32x4();
+ let a: u32x2 = simd_shuffle2!(a, a, [0, 1]);
+ transmute(simd_cast::<_, i64x2>(a))
+}
+
+/// Returns the dot product of two __m128d vectors.
+///
+/// `IMM8[1:0]` is the broadcast mask, and `IMM8[5:4]` is the condition mask.
+/// If a condition mask bit is zero, the corresponding multiplication is
+/// replaced by a value of `0.0`. If a broadcast mask bit is one, the result of
+/// the dot product will be stored in the return value component. Otherwise if
+/// the broadcast mask bit is zero then the return component will be zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_dp_pd)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(dppd, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_dp_pd<const IMM8: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_imm8!(IMM8);
+ dppd(a, b, IMM8 as u8)
+}
+
+/// Returns the dot product of two __m128 vectors.
+///
+/// `IMM8[3:0]` is the broadcast mask, and `IMM8[7:4]` is the condition mask.
+/// If a condition mask bit is zero, the corresponding multiplication is
+/// replaced by a value of `0.0`. If a broadcast mask bit is one, the result of
+/// the dot product will be stored in the return value component. Otherwise if
+/// the broadcast mask bit is zero then the return component will be zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_dp_ps)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(dpps, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_dp_ps<const IMM8: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_imm8!(IMM8);
+ dpps(a, b, IMM8 as u8)
+}
+
+/// Round the packed double-precision (64-bit) floating-point elements in `a`
+/// down to an integer value, and stores the results as packed double-precision
+/// floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_floor_pd)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_floor_pd(a: __m128d) -> __m128d {
+ simd_floor(a)
+}
+
+/// Round the packed single-precision (32-bit) floating-point elements in `a`
+/// down to an integer value, and stores the results as packed single-precision
+/// floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_floor_ps)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_floor_ps(a: __m128) -> __m128 {
+ simd_floor(a)
+}
+
+/// Round the lower double-precision (64-bit) floating-point element in `b`
+/// down to an integer value, store the result as a double-precision
+/// floating-point element in the lower element of the intrinsic result,
+/// and copies the upper element from `a` to the upper element of the intrinsic
+/// result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_floor_sd)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_floor_sd(a: __m128d, b: __m128d) -> __m128d {
+ roundsd(a, b, _MM_FROUND_FLOOR)
+}
+
+/// Round the lower single-precision (32-bit) floating-point element in `b`
+/// down to an integer value, store the result as a single-precision
+/// floating-point element in the lower element of the intrinsic result,
+/// and copies the upper 3 packed elements from `a` to the upper elements
+/// of the intrinsic result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_floor_ss)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_floor_ss(a: __m128, b: __m128) -> __m128 {
+ roundss(a, b, _MM_FROUND_FLOOR)
+}
+
+/// Round the packed double-precision (64-bit) floating-point elements in `a`
+/// up to an integer value, and stores the results as packed double-precision
+/// floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ceil_pd)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundpd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ceil_pd(a: __m128d) -> __m128d {
+ simd_ceil(a)
+}
+
+/// Round the packed single-precision (32-bit) floating-point elements in `a`
+/// up to an integer value, and stores the results as packed single-precision
+/// floating-point elements.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ceil_ps)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundps))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ceil_ps(a: __m128) -> __m128 {
+ simd_ceil(a)
+}
+
+/// Round the lower double-precision (64-bit) floating-point element in `b`
+/// up to an integer value, store the result as a double-precision
+/// floating-point element in the lower element of the intrisic result,
+/// and copies the upper element from `a` to the upper element
+/// of the intrinsic result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ceil_sd)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ceil_sd(a: __m128d, b: __m128d) -> __m128d {
+ roundsd(a, b, _MM_FROUND_CEIL)
+}
+
+/// Round the lower single-precision (32-bit) floating-point element in `b`
+/// up to an integer value, store the result as a single-precision
+/// floating-point element in the lower element of the intrinsic result,
+/// and copies the upper 3 packed elements from `a` to the upper elements
+/// of the intrinsic result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ceil_ss)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_ceil_ss(a: __m128, b: __m128) -> __m128 {
+ roundss(a, b, _MM_FROUND_CEIL)
+}
+
+/// Round the packed double-precision (64-bit) floating-point elements in `a`
+/// using the `ROUNDING` parameter, and stores the results as packed
+/// double-precision floating-point elements.
+/// Rounding is done according to the rounding parameter, which can be one of:
+///
+/// ```
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// // round to nearest, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC;
+/// // round down, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC;
+/// // round up, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC;
+/// // truncate, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC;
+/// // use MXCSR.RC; see `_MM_SET_ROUNDING_MODE`:
+/// # let _x =
+/// _MM_FROUND_CUR_DIRECTION;
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_round_pd)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundpd, ROUNDING = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_round_pd<const ROUNDING: i32>(a: __m128d) -> __m128d {
+ static_assert_imm4!(ROUNDING);
+ roundpd(a, ROUNDING)
+}
+
+/// Round the packed single-precision (32-bit) floating-point elements in `a`
+/// using the `ROUNDING` parameter, and stores the results as packed
+/// single-precision floating-point elements.
+/// Rounding is done according to the rounding parameter, which can be one of:
+///
+/// ```
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// // round to nearest, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC;
+/// // round down, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC;
+/// // round up, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC;
+/// // truncate, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC;
+/// // use MXCSR.RC; see `_MM_SET_ROUNDING_MODE`:
+/// # let _x =
+/// _MM_FROUND_CUR_DIRECTION;
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_round_ps)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundps, ROUNDING = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_round_ps<const ROUNDING: i32>(a: __m128) -> __m128 {
+ static_assert_imm4!(ROUNDING);
+ roundps(a, ROUNDING)
+}
+
+/// Round the lower double-precision (64-bit) floating-point element in `b`
+/// using the `ROUNDING` parameter, store the result as a double-precision
+/// floating-point element in the lower element of the intrinsic result,
+/// and copies the upper element from `a` to the upper element of the intrinsic
+/// result.
+/// Rounding is done according to the rounding parameter, which can be one of:
+///
+/// ```
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// // round to nearest, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC;
+/// // round down, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC;
+/// // round up, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC;
+/// // truncate, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC;
+/// // use MXCSR.RC; see `_MM_SET_ROUNDING_MODE`:
+/// # let _x =
+/// _MM_FROUND_CUR_DIRECTION;
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_round_sd)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundsd, ROUNDING = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_round_sd<const ROUNDING: i32>(a: __m128d, b: __m128d) -> __m128d {
+ static_assert_imm4!(ROUNDING);
+ roundsd(a, b, ROUNDING)
+}
+
+/// Round the lower single-precision (32-bit) floating-point element in `b`
+/// using the `ROUNDING` parameter, store the result as a single-precision
+/// floating-point element in the lower element of the intrinsic result,
+/// and copies the upper 3 packed elements from `a` to the upper elements
+/// of the intrinsic result.
+/// Rounding is done according to the rounding parameter, which can be one of:
+///
+/// ```
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// // round to nearest, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC;
+/// // round down, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC;
+/// // round up, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC;
+/// // truncate, and suppress exceptions:
+/// # let _x =
+/// _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC;
+/// // use MXCSR.RC; see `_MM_SET_ROUNDING_MODE`:
+/// # let _x =
+/// _MM_FROUND_CUR_DIRECTION;
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_round_ss)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(roundss, ROUNDING = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_round_ss<const ROUNDING: i32>(a: __m128, b: __m128) -> __m128 {
+ static_assert_imm4!(ROUNDING);
+ roundss(a, b, ROUNDING)
+}
+
+/// Finds the minimum unsigned 16-bit element in the 128-bit __m128i vector,
+/// returning a vector containing its value in its first position, and its
+/// index
+/// in its second position; all other elements are set to zero.
+///
+/// This intrinsic corresponds to the `VPHMINPOSUW` / `PHMINPOSUW`
+/// instruction.
+///
+/// Arguments:
+///
+/// * `a` - A 128-bit vector of type `__m128i`.
+///
+/// Returns:
+///
+/// A 128-bit value where:
+///
+/// * bits `[15:0]` - contain the minimum value found in parameter `a`,
+/// * bits `[18:16]` - contain the index of the minimum value
+/// * remaining bits are set to `0`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_minpos_epu16)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(phminposuw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_minpos_epu16(a: __m128i) -> __m128i {
+ transmute(phminposuw(a.as_u16x8()))
+}
+
+/// Multiplies the low 32-bit integers from each packed 64-bit
+/// element in `a` and `b`, and returns the signed 64-bit result.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mul_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmuldq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mul_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmuldq(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Multiplies the packed 32-bit integers in `a` and `b`, producing intermediate
+/// 64-bit integers, and returns the lowest 32-bit, whatever they might be,
+/// reinterpreted as a signed integer. While `pmulld __m128i::splat(2),
+/// __m128i::splat(2)` returns the obvious `__m128i::splat(4)`, due to wrapping
+/// arithmetic `pmulld __m128i::splat(i32::MAX), __m128i::splat(2)` would
+/// return a negative number.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mullo_epi32)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pmulld))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mullo_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_mul(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Subtracts 8-bit unsigned integer values and computes the absolute
+/// values of the differences to the corresponding bits in the destination.
+/// Then sums of the absolute differences are returned according to the bit
+/// fields in the immediate operand.
+///
+/// The following algorithm is performed:
+///
+/// ```ignore
+/// i = IMM8[2] * 4
+/// j = IMM8[1:0] * 4
+/// for k := 0 to 7
+/// d0 = abs(a[i + k + 0] - b[j + 0])
+/// d1 = abs(a[i + k + 1] - b[j + 1])
+/// d2 = abs(a[i + k + 2] - b[j + 2])
+/// d3 = abs(a[i + k + 3] - b[j + 3])
+/// r[k] = d0 + d1 + d2 + d3
+/// ```
+///
+/// Arguments:
+///
+/// * `a` - A 128-bit vector of type `__m128i`.
+/// * `b` - A 128-bit vector of type `__m128i`.
+/// * `IMM8` - An 8-bit immediate operand specifying how the absolute
+/// differences are to be calculated
+/// * Bit `[2]` specify the offset for operand `a`
+/// * Bits `[1:0]` specify the offset for operand `b`
+///
+/// Returns:
+///
+/// * A `__m128i` vector containing the sums of the sets of absolute
+/// differences between both operands.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mpsadbw_epu8)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(mpsadbw, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mpsadbw_epu8<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm3!(IMM8);
+ transmute(mpsadbw(a.as_u8x16(), b.as_u8x16(), IMM8 as u8))
+}
+
+/// Tests whether the specified bits in a 128-bit integer vector are all
+/// zeros.
+///
+/// Arguments:
+///
+/// * `a` - A 128-bit integer vector containing the bits to be tested.
+/// * `mask` - A 128-bit integer vector selecting which bits to test in
+/// operand `a`.
+///
+/// Returns:
+///
+/// * `1` - if the specified bits are all zeros,
+/// * `0` - otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testz_si128)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(ptest))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_testz_si128(a: __m128i, mask: __m128i) -> i32 {
+ ptestz(a.as_i64x2(), mask.as_i64x2())
+}
+
+/// Tests whether the specified bits in a 128-bit integer vector are all
+/// ones.
+///
+/// Arguments:
+///
+/// * `a` - A 128-bit integer vector containing the bits to be tested.
+/// * `mask` - A 128-bit integer vector selecting which bits to test in
+/// operand `a`.
+///
+/// Returns:
+///
+/// * `1` - if the specified bits are all ones,
+/// * `0` - otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testc_si128)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(ptest))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_testc_si128(a: __m128i, mask: __m128i) -> i32 {
+ ptestc(a.as_i64x2(), mask.as_i64x2())
+}
+
+/// Tests whether the specified bits in a 128-bit integer vector are
+/// neither all zeros nor all ones.
+///
+/// Arguments:
+///
+/// * `a` - A 128-bit integer vector containing the bits to be tested.
+/// * `mask` - A 128-bit integer vector selecting which bits to test in
+/// operand `a`.
+///
+/// Returns:
+///
+/// * `1` - if the specified bits are neither all zeros nor all ones,
+/// * `0` - otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_testnzc_si128)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(ptest))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_testnzc_si128(a: __m128i, mask: __m128i) -> i32 {
+ ptestnzc(a.as_i64x2(), mask.as_i64x2())
+}
+
+/// Tests whether the specified bits in a 128-bit integer vector are all
+/// zeros.
+///
+/// Arguments:
+///
+/// * `a` - A 128-bit integer vector containing the bits to be tested.
+/// * `mask` - A 128-bit integer vector selecting which bits to test in
+/// operand `a`.
+///
+/// Returns:
+///
+/// * `1` - if the specified bits are all zeros,
+/// * `0` - otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_test_all_zeros)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(ptest))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_test_all_zeros(a: __m128i, mask: __m128i) -> i32 {
+ _mm_testz_si128(a, mask)
+}
+
+/// Tests whether the specified bits in `a` 128-bit integer vector are all
+/// ones.
+///
+/// Argument:
+///
+/// * `a` - A 128-bit integer vector containing the bits to be tested.
+///
+/// Returns:
+///
+/// * `1` - if the bits specified in the operand are all set to 1,
+/// * `0` - otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_test_all_ones)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pcmpeqd))]
+#[cfg_attr(test, assert_instr(ptest))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_test_all_ones(a: __m128i) -> i32 {
+ _mm_testc_si128(a, _mm_cmpeq_epi32(a, a))
+}
+
+/// Tests whether the specified bits in a 128-bit integer vector are
+/// neither all zeros nor all ones.
+///
+/// Arguments:
+///
+/// * `a` - A 128-bit integer vector containing the bits to be tested.
+/// * `mask` - A 128-bit integer vector selecting which bits to test in
+/// operand `a`.
+///
+/// Returns:
+///
+/// * `1` - if the specified bits are neither all zeros nor all ones,
+/// * `0` - otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_test_mix_ones_zeros)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(ptest))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_test_mix_ones_zeros(a: __m128i, mask: __m128i) -> i32 {
+ _mm_testnzc_si128(a, mask)
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.sse41.pblendvb"]
+ fn pblendvb(a: i8x16, b: i8x16, mask: i8x16) -> i8x16;
+ #[link_name = "llvm.x86.sse41.blendvpd"]
+ fn blendvpd(a: __m128d, b: __m128d, mask: __m128d) -> __m128d;
+ #[link_name = "llvm.x86.sse41.blendvps"]
+ fn blendvps(a: __m128, b: __m128, mask: __m128) -> __m128;
+ #[link_name = "llvm.x86.sse41.blendpd"]
+ fn blendpd(a: __m128d, b: __m128d, imm2: u8) -> __m128d;
+ #[link_name = "llvm.x86.sse41.blendps"]
+ fn blendps(a: __m128, b: __m128, imm4: u8) -> __m128;
+ #[link_name = "llvm.x86.sse41.pblendw"]
+ fn pblendw(a: i16x8, b: i16x8, imm8: u8) -> i16x8;
+ #[link_name = "llvm.x86.sse41.insertps"]
+ fn insertps(a: __m128, b: __m128, imm8: u8) -> __m128;
+ #[link_name = "llvm.x86.sse41.pmaxsb"]
+ fn pmaxsb(a: i8x16, b: i8x16) -> i8x16;
+ #[link_name = "llvm.x86.sse41.pmaxuw"]
+ fn pmaxuw(a: u16x8, b: u16x8) -> u16x8;
+ #[link_name = "llvm.x86.sse41.pmaxsd"]
+ fn pmaxsd(a: i32x4, b: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.sse41.pmaxud"]
+ fn pmaxud(a: u32x4, b: u32x4) -> u32x4;
+ #[link_name = "llvm.x86.sse41.pminsb"]
+ fn pminsb(a: i8x16, b: i8x16) -> i8x16;
+ #[link_name = "llvm.x86.sse41.pminuw"]
+ fn pminuw(a: u16x8, b: u16x8) -> u16x8;
+ #[link_name = "llvm.x86.sse41.pminsd"]
+ fn pminsd(a: i32x4, b: i32x4) -> i32x4;
+ #[link_name = "llvm.x86.sse41.pminud"]
+ fn pminud(a: u32x4, b: u32x4) -> u32x4;
+ #[link_name = "llvm.x86.sse41.packusdw"]
+ fn packusdw(a: i32x4, b: i32x4) -> u16x8;
+ #[link_name = "llvm.x86.sse41.dppd"]
+ fn dppd(a: __m128d, b: __m128d, imm8: u8) -> __m128d;
+ #[link_name = "llvm.x86.sse41.dpps"]
+ fn dpps(a: __m128, b: __m128, imm8: u8) -> __m128;
+ #[link_name = "llvm.x86.sse41.round.pd"]
+ fn roundpd(a: __m128d, rounding: i32) -> __m128d;
+ #[link_name = "llvm.x86.sse41.round.ps"]
+ fn roundps(a: __m128, rounding: i32) -> __m128;
+ #[link_name = "llvm.x86.sse41.round.sd"]
+ fn roundsd(a: __m128d, b: __m128d, rounding: i32) -> __m128d;
+ #[link_name = "llvm.x86.sse41.round.ss"]
+ fn roundss(a: __m128, b: __m128, rounding: i32) -> __m128;
+ #[link_name = "llvm.x86.sse41.phminposuw"]
+ fn phminposuw(a: u16x8) -> u16x8;
+ #[link_name = "llvm.x86.sse41.pmuldq"]
+ fn pmuldq(a: i32x4, b: i32x4) -> i64x2;
+ #[link_name = "llvm.x86.sse41.mpsadbw"]
+ fn mpsadbw(a: u8x16, b: u8x16, imm8: u8) -> u16x8;
+ #[link_name = "llvm.x86.sse41.ptestz"]
+ fn ptestz(a: i64x2, mask: i64x2) -> i32;
+ #[link_name = "llvm.x86.sse41.ptestc"]
+ fn ptestc(a: i64x2, mask: i64x2) -> i32;
+ #[link_name = "llvm.x86.sse41.ptestnzc"]
+ fn ptestnzc(a: i64x2, mask: i64x2) -> i32;
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::x86::*;
+ use std::mem;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_blendv_epi8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ );
+ #[rustfmt::skip]
+ let mask = _mm_setr_epi8(
+ 0, -1, 0, -1, 0, -1, 0, -1,
+ 0, -1, 0, -1, 0, -1, 0, -1,
+ );
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 0, 17, 2, 19, 4, 21, 6, 23, 8, 25, 10, 27, 12, 29, 14, 31,
+ );
+ assert_eq_m128i(_mm_blendv_epi8(a, b, mask), e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_blendv_pd() {
+ let a = _mm_set1_pd(0.0);
+ let b = _mm_set1_pd(1.0);
+ let mask = transmute(_mm_setr_epi64x(0, -1));
+ let r = _mm_blendv_pd(a, b, mask);
+ let e = _mm_setr_pd(0.0, 1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_blendv_ps() {
+ let a = _mm_set1_ps(0.0);
+ let b = _mm_set1_ps(1.0);
+ let mask = transmute(_mm_setr_epi32(0, -1, 0, -1));
+ let r = _mm_blendv_ps(a, b, mask);
+ let e = _mm_setr_ps(0.0, 1.0, 0.0, 1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_blend_pd() {
+ let a = _mm_set1_pd(0.0);
+ let b = _mm_set1_pd(1.0);
+ let r = _mm_blend_pd::<0b10>(a, b);
+ let e = _mm_setr_pd(0.0, 1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_blend_ps() {
+ let a = _mm_set1_ps(0.0);
+ let b = _mm_set1_ps(1.0);
+ let r = _mm_blend_ps::<0b1010>(a, b);
+ let e = _mm_setr_ps(0.0, 1.0, 0.0, 1.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_blend_epi16() {
+ let a = _mm_set1_epi16(0);
+ let b = _mm_set1_epi16(1);
+ let r = _mm_blend_epi16::<0b1010_1100>(a, b);
+ let e = _mm_setr_epi16(0, 0, 1, 1, 0, 1, 0, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_extract_ps() {
+ let a = _mm_setr_ps(0.0, 1.0, 2.0, 3.0);
+ let r: f32 = transmute(_mm_extract_ps::<1>(a));
+ assert_eq!(r, 1.0);
+ let r: f32 = transmute(_mm_extract_ps::<3>(a));
+ assert_eq!(r, 3.0);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_extract_epi8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ -1, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15
+ );
+ let r1 = _mm_extract_epi8::<0>(a);
+ let r2 = _mm_extract_epi8::<3>(a);
+ assert_eq!(r1, 0xFF);
+ assert_eq!(r2, 3);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_extract_epi32() {
+ let a = _mm_setr_epi32(0, 1, 2, 3);
+ let r = _mm_extract_epi32::<1>(a);
+ assert_eq!(r, 1);
+ let r = _mm_extract_epi32::<3>(a);
+ assert_eq!(r, 3);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_insert_ps() {
+ let a = _mm_set1_ps(1.0);
+ let b = _mm_setr_ps(1.0, 2.0, 3.0, 4.0);
+ let r = _mm_insert_ps::<0b11_00_1100>(a, b);
+ let e = _mm_setr_ps(4.0, 1.0, 0.0, 0.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_insert_epi8() {
+ let a = _mm_set1_epi8(0);
+ let e = _mm_setr_epi8(0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r = _mm_insert_epi8::<1>(a, 32);
+ assert_eq_m128i(r, e);
+ let e = _mm_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0);
+ let r = _mm_insert_epi8::<14>(a, 32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_insert_epi32() {
+ let a = _mm_set1_epi32(0);
+ let e = _mm_setr_epi32(0, 32, 0, 0);
+ let r = _mm_insert_epi32::<1>(a, 32);
+ assert_eq_m128i(r, e);
+ let e = _mm_setr_epi32(0, 0, 0, 32);
+ let r = _mm_insert_epi32::<3>(a, 32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_max_epi8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 4, 5, 8, 9, 12, 13, 16,
+ 17, 20, 21, 24, 25, 28, 29, 32,
+ );
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 2, 3, 6, 7, 10, 11, 14, 15,
+ 18, 19, 22, 23, 26, 27, 30, 31,
+ );
+ let r = _mm_max_epi8(a, b);
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 2, 4, 6, 8, 10, 12, 14, 16,
+ 18, 20, 22, 24, 26, 28, 30, 32,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_max_epu16() {
+ let a = _mm_setr_epi16(1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm_setr_epi16(2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm_max_epu16(a, b);
+ let e = _mm_setr_epi16(2, 4, 6, 8, 10, 12, 14, 16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_max_epi32() {
+ let a = _mm_setr_epi32(1, 4, 5, 8);
+ let b = _mm_setr_epi32(2, 3, 6, 7);
+ let r = _mm_max_epi32(a, b);
+ let e = _mm_setr_epi32(2, 4, 6, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_max_epu32() {
+ let a = _mm_setr_epi32(1, 4, 5, 8);
+ let b = _mm_setr_epi32(2, 3, 6, 7);
+ let r = _mm_max_epu32(a, b);
+ let e = _mm_setr_epi32(2, 4, 6, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_min_epi8_1() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 4, 5, 8, 9, 12, 13, 16,
+ 17, 20, 21, 24, 25, 28, 29, 32,
+ );
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 2, 3, 6, 7, 10, 11, 14, 15,
+ 18, 19, 22, 23, 26, 27, 30, 31,
+ );
+ let r = _mm_min_epi8(a, b);
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 1, 3, 5, 7, 9, 11, 13, 15,
+ 17, 19, 21, 23, 25, 27, 29, 31,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_min_epi8_2() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, -4, -5, 8, -9, -12, 13, -16,
+ 17, 20, 21, 24, 25, 28, 29, 32,
+ );
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 2, -3, -6, 7, -10, -11, 14, -15,
+ 18, 19, 22, 23, 26, 27, 30, 31,
+ );
+ let r = _mm_min_epi8(a, b);
+ #[rustfmt::skip]
+ let e = _mm_setr_epi8(
+ 1, -4, -6, 7, -10, -12, 13, -16,
+ 17, 19, 21, 23, 25, 27, 29, 31,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_min_epu16() {
+ let a = _mm_setr_epi16(1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm_setr_epi16(2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm_min_epu16(a, b);
+ let e = _mm_setr_epi16(1, 3, 5, 7, 9, 11, 13, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_min_epi32_1() {
+ let a = _mm_setr_epi32(1, 4, 5, 8);
+ let b = _mm_setr_epi32(2, 3, 6, 7);
+ let r = _mm_min_epi32(a, b);
+ let e = _mm_setr_epi32(1, 3, 5, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_min_epi32_2() {
+ let a = _mm_setr_epi32(-1, 4, 5, -7);
+ let b = _mm_setr_epi32(-2, 3, -6, 8);
+ let r = _mm_min_epi32(a, b);
+ let e = _mm_setr_epi32(-2, 3, -6, -7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_min_epu32() {
+ let a = _mm_setr_epi32(1, 4, 5, 8);
+ let b = _mm_setr_epi32(2, 3, 6, 7);
+ let r = _mm_min_epu32(a, b);
+ let e = _mm_setr_epi32(1, 3, 5, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_packus_epi32() {
+ let a = _mm_setr_epi32(1, 2, 3, 4);
+ let b = _mm_setr_epi32(-1, -2, -3, -4);
+ let r = _mm_packus_epi32(a, b);
+ let e = _mm_setr_epi16(1, 2, 3, 4, 0, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cmpeq_epi64() {
+ let a = _mm_setr_epi64x(0, 1);
+ let b = _mm_setr_epi64x(0, 0);
+ let r = _mm_cmpeq_epi64(a, b);
+ let e = _mm_setr_epi64x(-1, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepi8_epi16() {
+ let a = _mm_set1_epi8(10);
+ let r = _mm_cvtepi8_epi16(a);
+ let e = _mm_set1_epi16(10);
+ assert_eq_m128i(r, e);
+ let a = _mm_set1_epi8(-10);
+ let r = _mm_cvtepi8_epi16(a);
+ let e = _mm_set1_epi16(-10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepi8_epi32() {
+ let a = _mm_set1_epi8(10);
+ let r = _mm_cvtepi8_epi32(a);
+ let e = _mm_set1_epi32(10);
+ assert_eq_m128i(r, e);
+ let a = _mm_set1_epi8(-10);
+ let r = _mm_cvtepi8_epi32(a);
+ let e = _mm_set1_epi32(-10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepi8_epi64() {
+ let a = _mm_set1_epi8(10);
+ let r = _mm_cvtepi8_epi64(a);
+ let e = _mm_set1_epi64x(10);
+ assert_eq_m128i(r, e);
+ let a = _mm_set1_epi8(-10);
+ let r = _mm_cvtepi8_epi64(a);
+ let e = _mm_set1_epi64x(-10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepi16_epi32() {
+ let a = _mm_set1_epi16(10);
+ let r = _mm_cvtepi16_epi32(a);
+ let e = _mm_set1_epi32(10);
+ assert_eq_m128i(r, e);
+ let a = _mm_set1_epi16(-10);
+ let r = _mm_cvtepi16_epi32(a);
+ let e = _mm_set1_epi32(-10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepi16_epi64() {
+ let a = _mm_set1_epi16(10);
+ let r = _mm_cvtepi16_epi64(a);
+ let e = _mm_set1_epi64x(10);
+ assert_eq_m128i(r, e);
+ let a = _mm_set1_epi16(-10);
+ let r = _mm_cvtepi16_epi64(a);
+ let e = _mm_set1_epi64x(-10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepi32_epi64() {
+ let a = _mm_set1_epi32(10);
+ let r = _mm_cvtepi32_epi64(a);
+ let e = _mm_set1_epi64x(10);
+ assert_eq_m128i(r, e);
+ let a = _mm_set1_epi32(-10);
+ let r = _mm_cvtepi32_epi64(a);
+ let e = _mm_set1_epi64x(-10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepu8_epi16() {
+ let a = _mm_set1_epi8(10);
+ let r = _mm_cvtepu8_epi16(a);
+ let e = _mm_set1_epi16(10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepu8_epi32() {
+ let a = _mm_set1_epi8(10);
+ let r = _mm_cvtepu8_epi32(a);
+ let e = _mm_set1_epi32(10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepu8_epi64() {
+ let a = _mm_set1_epi8(10);
+ let r = _mm_cvtepu8_epi64(a);
+ let e = _mm_set1_epi64x(10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepu16_epi32() {
+ let a = _mm_set1_epi16(10);
+ let r = _mm_cvtepu16_epi32(a);
+ let e = _mm_set1_epi32(10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepu16_epi64() {
+ let a = _mm_set1_epi16(10);
+ let r = _mm_cvtepu16_epi64(a);
+ let e = _mm_set1_epi64x(10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_cvtepu32_epi64() {
+ let a = _mm_set1_epi32(10);
+ let r = _mm_cvtepu32_epi64(a);
+ let e = _mm_set1_epi64x(10);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_dp_pd() {
+ let a = _mm_setr_pd(2.0, 3.0);
+ let b = _mm_setr_pd(1.0, 4.0);
+ let e = _mm_setr_pd(14.0, 0.0);
+ assert_eq_m128d(_mm_dp_pd::<0b00110001>(a, b), e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_dp_ps() {
+ let a = _mm_setr_ps(2.0, 3.0, 1.0, 10.0);
+ let b = _mm_setr_ps(1.0, 4.0, 0.5, 10.0);
+ let e = _mm_setr_ps(14.5, 0.0, 14.5, 0.0);
+ assert_eq_m128(_mm_dp_ps::<0b01110101>(a, b), e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_floor_pd() {
+ let a = _mm_setr_pd(2.5, 4.5);
+ let r = _mm_floor_pd(a);
+ let e = _mm_setr_pd(2.0, 4.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_floor_ps() {
+ let a = _mm_setr_ps(2.5, 4.5, 8.5, 16.5);
+ let r = _mm_floor_ps(a);
+ let e = _mm_setr_ps(2.0, 4.0, 8.0, 16.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_floor_sd() {
+ let a = _mm_setr_pd(2.5, 4.5);
+ let b = _mm_setr_pd(-1.5, -3.5);
+ let r = _mm_floor_sd(a, b);
+ let e = _mm_setr_pd(-2.0, 4.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_floor_ss() {
+ let a = _mm_setr_ps(2.5, 4.5, 8.5, 16.5);
+ let b = _mm_setr_ps(-1.5, -3.5, -7.5, -15.5);
+ let r = _mm_floor_ss(a, b);
+ let e = _mm_setr_ps(-2.0, 4.5, 8.5, 16.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_ceil_pd() {
+ let a = _mm_setr_pd(1.5, 3.5);
+ let r = _mm_ceil_pd(a);
+ let e = _mm_setr_pd(2.0, 4.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_ceil_ps() {
+ let a = _mm_setr_ps(1.5, 3.5, 7.5, 15.5);
+ let r = _mm_ceil_ps(a);
+ let e = _mm_setr_ps(2.0, 4.0, 8.0, 16.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_ceil_sd() {
+ let a = _mm_setr_pd(1.5, 3.5);
+ let b = _mm_setr_pd(-2.5, -4.5);
+ let r = _mm_ceil_sd(a, b);
+ let e = _mm_setr_pd(-2.0, 3.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_ceil_ss() {
+ let a = _mm_setr_ps(1.5, 3.5, 7.5, 15.5);
+ let b = _mm_setr_ps(-2.5, -4.5, -8.5, -16.5);
+ let r = _mm_ceil_ss(a, b);
+ let e = _mm_setr_ps(-2.0, 3.5, 7.5, 15.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_round_pd() {
+ let a = _mm_setr_pd(1.25, 3.75);
+ let r = _mm_round_pd::<_MM_FROUND_TO_NEAREST_INT>(a);
+ let e = _mm_setr_pd(1.0, 4.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_round_ps() {
+ let a = _mm_setr_ps(2.25, 4.75, -1.75, -4.25);
+ let r = _mm_round_ps::<_MM_FROUND_TO_ZERO>(a);
+ let e = _mm_setr_ps(2.0, 4.0, -1.0, -4.0);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_round_sd() {
+ let a = _mm_setr_pd(1.5, 3.5);
+ let b = _mm_setr_pd(-2.5, -4.5);
+ let old_mode = _MM_GET_ROUNDING_MODE();
+ _MM_SET_ROUNDING_MODE(_MM_ROUND_TOWARD_ZERO);
+ let r = _mm_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ _MM_SET_ROUNDING_MODE(old_mode);
+ let e = _mm_setr_pd(-2.0, 3.5);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_round_ss() {
+ let a = _mm_setr_ps(1.5, 3.5, 7.5, 15.5);
+ let b = _mm_setr_ps(-1.75, -4.5, -8.5, -16.5);
+ let old_mode = _MM_GET_ROUNDING_MODE();
+ _MM_SET_ROUNDING_MODE(_MM_ROUND_NEAREST);
+ let r = _mm_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ _MM_SET_ROUNDING_MODE(old_mode);
+ let e = _mm_setr_ps(-2.0, 3.5, 7.5, 15.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_minpos_epu16_1() {
+ let a = _mm_setr_epi16(23, 18, 44, 97, 50, 13, 67, 66);
+ let r = _mm_minpos_epu16(a);
+ let e = _mm_setr_epi16(13, 5, 0, 0, 0, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_minpos_epu16_2() {
+ let a = _mm_setr_epi16(0, 18, 44, 97, 50, 13, 67, 66);
+ let r = _mm_minpos_epu16(a);
+ let e = _mm_setr_epi16(0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_mul_epi32() {
+ {
+ let a = _mm_setr_epi32(1, 1, 1, 1);
+ let b = _mm_setr_epi32(1, 2, 3, 4);
+ let r = _mm_mul_epi32(a, b);
+ let e = _mm_setr_epi64x(1, 3);
+ assert_eq_m128i(r, e);
+ }
+ {
+ let a = _mm_setr_epi32(15, 2 /* ignored */, 1234567, 4 /* ignored */);
+ let b = _mm_setr_epi32(
+ -20, -256, /* ignored */
+ 666666, 666666, /* ignored */
+ );
+ let r = _mm_mul_epi32(a, b);
+ let e = _mm_setr_epi64x(-300, 823043843622);
+ assert_eq_m128i(r, e);
+ }
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_mullo_epi32() {
+ {
+ let a = _mm_setr_epi32(1, 1, 1, 1);
+ let b = _mm_setr_epi32(1, 2, 3, 4);
+ let r = _mm_mullo_epi32(a, b);
+ let e = _mm_setr_epi32(1, 2, 3, 4);
+ assert_eq_m128i(r, e);
+ }
+ {
+ let a = _mm_setr_epi32(15, -2, 1234567, 99999);
+ let b = _mm_setr_epi32(-20, -256, 666666, -99999);
+ let r = _mm_mullo_epi32(a, b);
+ // Attention, most significant bit in r[2] is treated
+ // as a sign bit:
+ // 1234567 * 666666 = -1589877210
+ let e = _mm_setr_epi32(-300, 512, -1589877210, -1409865409);
+ assert_eq_m128i(r, e);
+ }
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_minpos_epu16() {
+ let a = _mm_setr_epi16(8, 7, 6, 5, 4, 1, 2, 3);
+ let r = _mm_minpos_epu16(a);
+ let e = _mm_setr_epi16(1, 5, 0, 0, 0, 0, 0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_mpsadbw_epu8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+
+ let r = _mm_mpsadbw_epu8::<0b000>(a, a);
+ let e = _mm_setr_epi16(0, 4, 8, 12, 16, 20, 24, 28);
+ assert_eq_m128i(r, e);
+
+ let r = _mm_mpsadbw_epu8::<0b001>(a, a);
+ let e = _mm_setr_epi16(16, 12, 8, 4, 0, 4, 8, 12);
+ assert_eq_m128i(r, e);
+
+ let r = _mm_mpsadbw_epu8::<0b100>(a, a);
+ let e = _mm_setr_epi16(16, 20, 24, 28, 32, 36, 40, 44);
+ assert_eq_m128i(r, e);
+
+ let r = _mm_mpsadbw_epu8::<0b101>(a, a);
+ let e = _mm_setr_epi16(0, 4, 8, 12, 16, 20, 24, 28);
+ assert_eq_m128i(r, e);
+
+ let r = _mm_mpsadbw_epu8::<0b111>(a, a);
+ let e = _mm_setr_epi16(32, 28, 24, 20, 16, 12, 8, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_testz_si128() {
+ let a = _mm_set1_epi8(1);
+ let mask = _mm_set1_epi8(0);
+ let r = _mm_testz_si128(a, mask);
+ assert_eq!(r, 1);
+ let a = _mm_set1_epi8(0b101);
+ let mask = _mm_set1_epi8(0b110);
+ let r = _mm_testz_si128(a, mask);
+ assert_eq!(r, 0);
+ let a = _mm_set1_epi8(0b011);
+ let mask = _mm_set1_epi8(0b100);
+ let r = _mm_testz_si128(a, mask);
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_testc_si128() {
+ let a = _mm_set1_epi8(-1);
+ let mask = _mm_set1_epi8(0);
+ let r = _mm_testc_si128(a, mask);
+ assert_eq!(r, 1);
+ let a = _mm_set1_epi8(0b101);
+ let mask = _mm_set1_epi8(0b110);
+ let r = _mm_testc_si128(a, mask);
+ assert_eq!(r, 0);
+ let a = _mm_set1_epi8(0b101);
+ let mask = _mm_set1_epi8(0b100);
+ let r = _mm_testc_si128(a, mask);
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_testnzc_si128() {
+ let a = _mm_set1_epi8(0);
+ let mask = _mm_set1_epi8(1);
+ let r = _mm_testnzc_si128(a, mask);
+ assert_eq!(r, 0);
+ let a = _mm_set1_epi8(-1);
+ let mask = _mm_set1_epi8(0);
+ let r = _mm_testnzc_si128(a, mask);
+ assert_eq!(r, 0);
+ let a = _mm_set1_epi8(0b101);
+ let mask = _mm_set1_epi8(0b110);
+ let r = _mm_testnzc_si128(a, mask);
+ assert_eq!(r, 1);
+ let a = _mm_set1_epi8(0b101);
+ let mask = _mm_set1_epi8(0b101);
+ let r = _mm_testnzc_si128(a, mask);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_test_all_zeros() {
+ let a = _mm_set1_epi8(1);
+ let mask = _mm_set1_epi8(0);
+ let r = _mm_test_all_zeros(a, mask);
+ assert_eq!(r, 1);
+ let a = _mm_set1_epi8(0b101);
+ let mask = _mm_set1_epi8(0b110);
+ let r = _mm_test_all_zeros(a, mask);
+ assert_eq!(r, 0);
+ let a = _mm_set1_epi8(0b011);
+ let mask = _mm_set1_epi8(0b100);
+ let r = _mm_test_all_zeros(a, mask);
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_test_all_ones() {
+ let a = _mm_set1_epi8(-1);
+ let r = _mm_test_all_ones(a);
+ assert_eq!(r, 1);
+ let a = _mm_set1_epi8(0b101);
+ let r = _mm_test_all_ones(a);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_test_mix_ones_zeros() {
+ let a = _mm_set1_epi8(0);
+ let mask = _mm_set1_epi8(1);
+ let r = _mm_test_mix_ones_zeros(a, mask);
+ assert_eq!(r, 0);
+ let a = _mm_set1_epi8(-1);
+ let mask = _mm_set1_epi8(0);
+ let r = _mm_test_mix_ones_zeros(a, mask);
+ assert_eq!(r, 0);
+ let a = _mm_set1_epi8(0b101);
+ let mask = _mm_set1_epi8(0b110);
+ let r = _mm_test_mix_ones_zeros(a, mask);
+ assert_eq!(r, 1);
+ let a = _mm_set1_epi8(0b101);
+ let mask = _mm_set1_epi8(0b101);
+ let r = _mm_test_mix_ones_zeros(a, mask);
+ assert_eq!(r, 0);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/sse42.rs b/library/stdarch/crates/core_arch/src/x86/sse42.rs
new file mode 100644
index 000000000..f474b0671
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/sse42.rs
@@ -0,0 +1,802 @@
+//! Streaming SIMD Extensions 4.2 (SSE4.2)
+//!
+//! Extends SSE4.1 with STTNI (String and Text New Instructions).
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ mem::transmute,
+};
+
+/// String contains unsigned 8-bit characters *(Default)*
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_UBYTE_OPS: i32 = 0b0000_0000;
+/// String contains unsigned 16-bit characters
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_UWORD_OPS: i32 = 0b0000_0001;
+/// String contains signed 8-bit characters
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_SBYTE_OPS: i32 = 0b0000_0010;
+/// String contains unsigned 16-bit characters
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_SWORD_OPS: i32 = 0b0000_0011;
+
+/// For each character in `a`, find if it is in `b` *(Default)*
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_CMP_EQUAL_ANY: i32 = 0b0000_0000;
+/// For each character in `a`, determine if
+/// `b[0] <= c <= b[1] or b[1] <= c <= b[2]...`
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_CMP_RANGES: i32 = 0b0000_0100;
+/// The strings defined by `a` and `b` are equal
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_CMP_EQUAL_EACH: i32 = 0b0000_1000;
+/// Search for the defined substring in the target
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_CMP_EQUAL_ORDERED: i32 = 0b0000_1100;
+
+/// Do not negate results *(Default)*
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_POSITIVE_POLARITY: i32 = 0b0000_0000;
+/// Negates results
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_NEGATIVE_POLARITY: i32 = 0b0001_0000;
+/// Do not negate results before the end of the string
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_MASKED_POSITIVE_POLARITY: i32 = 0b0010_0000;
+/// Negates results only before the end of the string
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_MASKED_NEGATIVE_POLARITY: i32 = 0b0011_0000;
+
+/// **Index only**: return the least significant bit *(Default)*
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_LEAST_SIGNIFICANT: i32 = 0b0000_0000;
+/// **Index only**: return the most significant bit
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_MOST_SIGNIFICANT: i32 = 0b0100_0000;
+
+/// **Mask only**: return the bit mask
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_BIT_MASK: i32 = 0b0000_0000;
+/// **Mask only**: return the byte mask
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _SIDD_UNIT_MASK: i32 = 0b0100_0000;
+
+/// Compares packed strings with implicit lengths in `a` and `b` using the
+/// control in `IMM8`, and return the generated mask.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpistrm)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpistrm, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpistrm<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(pcmpistrm128(a.as_i8x16(), b.as_i8x16(), IMM8 as i8))
+}
+
+/// Compares packed strings with implicit lengths in `a` and `b` using the
+/// control in `IMM8` and return the generated index. Similar to
+/// [`_mm_cmpestri`] with the exception that [`_mm_cmpestri`] requires the
+/// lengths of `a` and `b` to be explicitly specified.
+///
+/// # Control modes
+///
+/// The control specified by `IMM8` may be one or more of the following.
+///
+/// ## Data size and signedness
+///
+/// - [`_SIDD_UBYTE_OPS`] - Default
+/// - [`_SIDD_UWORD_OPS`]
+/// - [`_SIDD_SBYTE_OPS`]
+/// - [`_SIDD_SWORD_OPS`]
+///
+/// ## Comparison options
+/// - [`_SIDD_CMP_EQUAL_ANY`] - Default
+/// - [`_SIDD_CMP_RANGES`]
+/// - [`_SIDD_CMP_EQUAL_EACH`]
+/// - [`_SIDD_CMP_EQUAL_ORDERED`]
+///
+/// ## Result polarity
+/// - [`_SIDD_POSITIVE_POLARITY`] - Default
+/// - [`_SIDD_NEGATIVE_POLARITY`]
+///
+/// ## Bit returned
+/// - [`_SIDD_LEAST_SIGNIFICANT`] - Default
+/// - [`_SIDD_MOST_SIGNIFICANT`]
+///
+/// # Examples
+///
+/// Finds a substring using [`_SIDD_CMP_EQUAL_ORDERED`]
+///
+/// ```
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("sse4.2") {
+/// # #[target_feature(enable = "sse4.2")]
+/// # unsafe fn worker() {
+/// let haystack = b"This is a long string of text data\r\n\tthat extends
+/// multiple lines";
+/// let needle = b"\r\n\t\0\0\0\0\0\0\0\0\0\0\0\0\0";
+///
+/// let a = _mm_loadu_si128(needle.as_ptr() as *const _);
+/// let hop = 16;
+/// let mut indexes = Vec::new();
+///
+/// // Chunk the haystack into 16 byte chunks and find
+/// // the first "\r\n\t" in the chunk.
+/// for (i, chunk) in haystack.chunks(hop).enumerate() {
+/// let b = _mm_loadu_si128(chunk.as_ptr() as *const _);
+/// let idx = _mm_cmpistri(a, b, _SIDD_CMP_EQUAL_ORDERED);
+/// if idx != 16 {
+/// indexes.push((idx as usize) + (i * hop));
+/// }
+/// }
+/// assert_eq!(indexes, vec![34]);
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// The `_mm_cmpistri` intrinsic may also be used to find the existence of
+/// one or more of a given set of characters in the haystack.
+///
+/// ```
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("sse4.2") {
+/// # #[target_feature(enable = "sse4.2")]
+/// # unsafe fn worker() {
+/// // Ensure your input is 16 byte aligned
+/// let password = b"hunter2\0\0\0\0\0\0\0\0\0";
+/// let special_chars = b"!@#$%^&*()[]:;<>";
+///
+/// // Load the input
+/// let a = _mm_loadu_si128(special_chars.as_ptr() as *const _);
+/// let b = _mm_loadu_si128(password.as_ptr() as *const _);
+///
+/// // Use _SIDD_CMP_EQUAL_ANY to find the index of any bytes in b
+/// let idx = _mm_cmpistri(a.into(), b.into(), _SIDD_CMP_EQUAL_ANY);
+///
+/// if idx < 16 {
+/// println!("Congrats! Your password contains a special character");
+/// # panic!("{:?} does not contain a special character", password);
+/// } else {
+/// println!("Your password should contain a special character");
+/// }
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// Finds the index of the first character in the haystack that is within a
+/// range of characters.
+///
+/// ```
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("sse4.2") {
+/// # #[target_feature(enable = "sse4.2")]
+/// # unsafe fn worker() {
+/// # let b = b":;<=>?@[\\]^_`abc";
+/// # let b = _mm_loadu_si128(b.as_ptr() as *const _);
+///
+/// // Specify the ranges of values to be searched for [A-Za-z0-9].
+/// let a = b"AZaz09\0\0\0\0\0\0\0\0\0\0";
+/// let a = _mm_loadu_si128(a.as_ptr() as *const _);
+///
+/// // Use _SIDD_CMP_RANGES to find the index of first byte in ranges.
+/// // Which in this case will be the first alpha numeric byte found
+/// // in the string.
+/// let idx = _mm_cmpistri(a, b, _SIDD_CMP_RANGES);
+///
+/// if idx < 16 {
+/// println!("Found an alpha numeric character");
+/// # assert_eq!(idx, 13);
+/// } else {
+/// println!("Did not find an alpha numeric character");
+/// }
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// Working with 16-bit characters.
+///
+/// ```
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("sse4.2") {
+/// # #[target_feature(enable = "sse4.2")]
+/// # unsafe fn worker() {
+/// # let mut some_utf16_words = [0u16; 8];
+/// # let mut more_utf16_words = [0u16; 8];
+/// # '❤'.encode_utf16(&mut some_utf16_words);
+/// # '𝕊'.encode_utf16(&mut more_utf16_words);
+/// // Load the input
+/// let a = _mm_loadu_si128(some_utf16_words.as_ptr() as *const _);
+/// let b = _mm_loadu_si128(more_utf16_words.as_ptr() as *const _);
+///
+/// // Specify _SIDD_UWORD_OPS to compare words instead of bytes, and
+/// // use _SIDD_CMP_EQUAL_EACH to compare the two strings.
+/// let idx = _mm_cmpistri(a, b, _SIDD_UWORD_OPS | _SIDD_CMP_EQUAL_EACH);
+///
+/// if idx == 0 {
+/// println!("16-bit unicode strings were equal!");
+/// # panic!("Strings should not be equal!")
+/// } else {
+/// println!("16-bit unicode strings were not equal!");
+/// }
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpistri)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpistri, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpistri<const IMM8: i32>(a: __m128i, b: __m128i) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpistri128(a.as_i8x16(), b.as_i8x16(), IMM8 as i8)
+}
+
+/// Compares packed strings with implicit lengths in `a` and `b` using the
+/// control in `IMM8`, and return `1` if any character in `b` was null.
+/// and `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpistrz)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpistri, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpistrz<const IMM8: i32>(a: __m128i, b: __m128i) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpistriz128(a.as_i8x16(), b.as_i8x16(), IMM8 as i8)
+}
+
+/// Compares packed strings with implicit lengths in `a` and `b` using the
+/// control in `IMM8`, and return `1` if the resulting mask was non-zero,
+/// and `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpistrc)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpistri, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpistrc<const IMM8: i32>(a: __m128i, b: __m128i) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpistric128(a.as_i8x16(), b.as_i8x16(), IMM8 as i8)
+}
+
+/// Compares packed strings with implicit lengths in `a` and `b` using the
+/// control in `IMM8`, and returns `1` if any character in `a` was null,
+/// and `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpistrs)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpistri, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpistrs<const IMM8: i32>(a: __m128i, b: __m128i) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpistris128(a.as_i8x16(), b.as_i8x16(), IMM8 as i8)
+}
+
+/// Compares packed strings with implicit lengths in `a` and `b` using the
+/// control in `IMM8`, and return bit `0` of the resulting bit mask.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpistro)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpistri, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpistro<const IMM8: i32>(a: __m128i, b: __m128i) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpistrio128(a.as_i8x16(), b.as_i8x16(), IMM8 as i8)
+}
+
+/// Compares packed strings with implicit lengths in `a` and `b` using the
+/// control in `IMM8`, and return `1` if `b` did not contain a null
+/// character and the resulting mask was zero, and `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpistra)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpistri, IMM8 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpistra<const IMM8: i32>(a: __m128i, b: __m128i) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpistria128(a.as_i8x16(), b.as_i8x16(), IMM8 as i8)
+}
+
+/// Compares packed strings in `a` and `b` with lengths `la` and `lb`
+/// using the control in `IMM8`, and return the generated mask.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpestrm)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpestrm, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpestrm<const IMM8: i32>(a: __m128i, la: i32, b: __m128i, lb: i32) -> __m128i {
+ static_assert_imm8!(IMM8);
+ transmute(pcmpestrm128(a.as_i8x16(), la, b.as_i8x16(), lb, IMM8 as i8))
+}
+
+/// Compares packed strings `a` and `b` with lengths `la` and `lb` using the
+/// control in `IMM8` and return the generated index. Similar to
+/// [`_mm_cmpistri`] with the exception that [`_mm_cmpistri`] implicitly
+/// determines the length of `a` and `b`.
+///
+/// # Control modes
+///
+/// The control specified by `IMM8` may be one or more of the following.
+///
+/// ## Data size and signedness
+///
+/// - [`_SIDD_UBYTE_OPS`] - Default
+/// - [`_SIDD_UWORD_OPS`]
+/// - [`_SIDD_SBYTE_OPS`]
+/// - [`_SIDD_SWORD_OPS`]
+///
+/// ## Comparison options
+/// - [`_SIDD_CMP_EQUAL_ANY`] - Default
+/// - [`_SIDD_CMP_RANGES`]
+/// - [`_SIDD_CMP_EQUAL_EACH`]
+/// - [`_SIDD_CMP_EQUAL_ORDERED`]
+///
+/// ## Result polarity
+/// - [`_SIDD_POSITIVE_POLARITY`] - Default
+/// - [`_SIDD_NEGATIVE_POLARITY`]
+///
+/// ## Bit returned
+/// - [`_SIDD_LEAST_SIGNIFICANT`] - Default
+/// - [`_SIDD_MOST_SIGNIFICANT`]
+///
+/// # Examples
+///
+/// ```
+/// #[cfg(target_arch = "x86")]
+/// use std::arch::x86::*;
+/// #[cfg(target_arch = "x86_64")]
+/// use std::arch::x86_64::*;
+///
+/// # fn main() {
+/// # if is_x86_feature_detected!("sse4.2") {
+/// # #[target_feature(enable = "sse4.2")]
+/// # unsafe fn worker() {
+///
+/// // The string we want to find a substring in
+/// let haystack = b"Split \r\n\t line ";
+///
+/// // The string we want to search for with some
+/// // extra bytes we do not want to search for.
+/// let needle = b"\r\n\t ignore this ";
+///
+/// let a = _mm_loadu_si128(needle.as_ptr() as *const _);
+/// let b = _mm_loadu_si128(haystack.as_ptr() as *const _);
+///
+/// // Note: We explicitly specify we only want to search `b` for the
+/// // first 3 characters of a.
+/// let idx = _mm_cmpestri(a, 3, b, 15, _SIDD_CMP_EQUAL_ORDERED);
+///
+/// assert_eq!(idx, 6);
+/// # }
+/// # unsafe { worker(); }
+/// # }
+/// # }
+/// ```
+///
+/// [`_SIDD_UBYTE_OPS`]: constant._SIDD_UBYTE_OPS.html
+/// [`_SIDD_UWORD_OPS`]: constant._SIDD_UWORD_OPS.html
+/// [`_SIDD_SBYTE_OPS`]: constant._SIDD_SBYTE_OPS.html
+/// [`_SIDD_SWORD_OPS`]: constant._SIDD_SWORD_OPS.html
+/// [`_SIDD_CMP_EQUAL_ANY`]: constant._SIDD_CMP_EQUAL_ANY.html
+/// [`_SIDD_CMP_RANGES`]: constant._SIDD_CMP_RANGES.html
+/// [`_SIDD_CMP_EQUAL_EACH`]: constant._SIDD_CMP_EQUAL_EACH.html
+/// [`_SIDD_CMP_EQUAL_ORDERED`]: constant._SIDD_CMP_EQUAL_ORDERED.html
+/// [`_SIDD_POSITIVE_POLARITY`]: constant._SIDD_POSITIVE_POLARITY.html
+/// [`_SIDD_NEGATIVE_POLARITY`]: constant._SIDD_NEGATIVE_POLARITY.html
+/// [`_SIDD_LEAST_SIGNIFICANT`]: constant._SIDD_LEAST_SIGNIFICANT.html
+/// [`_SIDD_MOST_SIGNIFICANT`]: constant._SIDD_MOST_SIGNIFICANT.html
+/// [`_mm_cmpistri`]: fn._mm_cmpistri.html
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpestri)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpestri, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpestri<const IMM8: i32>(a: __m128i, la: i32, b: __m128i, lb: i32) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpestri128(a.as_i8x16(), la, b.as_i8x16(), lb, IMM8 as i8)
+}
+
+/// Compares packed strings in `a` and `b` with lengths `la` and `lb`
+/// using the control in `IMM8`, and return `1` if any character in
+/// `b` was null, and `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpestrz)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpestri, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpestrz<const IMM8: i32>(a: __m128i, la: i32, b: __m128i, lb: i32) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpestriz128(a.as_i8x16(), la, b.as_i8x16(), lb, IMM8 as i8)
+}
+
+/// Compares packed strings in `a` and `b` with lengths `la` and `lb`
+/// using the control in `IMM8`, and return `1` if the resulting mask
+/// was non-zero, and `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpestrc)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpestri, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpestrc<const IMM8: i32>(a: __m128i, la: i32, b: __m128i, lb: i32) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpestric128(a.as_i8x16(), la, b.as_i8x16(), lb, IMM8 as i8)
+}
+
+/// Compares packed strings in `a` and `b` with lengths `la` and `lb`
+/// using the control in `IMM8`, and return `1` if any character in
+/// a was null, and `0` otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpestrs)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpestri, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpestrs<const IMM8: i32>(a: __m128i, la: i32, b: __m128i, lb: i32) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpestris128(a.as_i8x16(), la, b.as_i8x16(), lb, IMM8 as i8)
+}
+
+/// Compares packed strings in `a` and `b` with lengths `la` and `lb`
+/// using the control in `IMM8`, and return bit `0` of the resulting
+/// bit mask.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpestro)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpestri, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpestro<const IMM8: i32>(a: __m128i, la: i32, b: __m128i, lb: i32) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpestrio128(a.as_i8x16(), la, b.as_i8x16(), lb, IMM8 as i8)
+}
+
+/// Compares packed strings in `a` and `b` with lengths `la` and `lb`
+/// using the control in `IMM8`, and return `1` if `b` did not
+/// contain a null character and the resulting mask was zero, and `0`
+/// otherwise.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpestra)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpestri, IMM8 = 0))]
+#[rustc_legacy_const_generics(4)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpestra<const IMM8: i32>(a: __m128i, la: i32, b: __m128i, lb: i32) -> i32 {
+ static_assert_imm8!(IMM8);
+ pcmpestria128(a.as_i8x16(), la, b.as_i8x16(), lb, IMM8 as i8)
+}
+
+/// Starting with the initial value in `crc`, return the accumulated
+/// CRC32-C value for unsigned 8-bit integer `v`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_crc32_u8)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(crc32))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_crc32_u8(crc: u32, v: u8) -> u32 {
+ crc32_32_8(crc, v)
+}
+
+/// Starting with the initial value in `crc`, return the accumulated
+/// CRC32-C value for unsigned 16-bit integer `v`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_crc32_u16)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(crc32))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_crc32_u16(crc: u32, v: u16) -> u32 {
+ crc32_32_16(crc, v)
+}
+
+/// Starting with the initial value in `crc`, return the accumulated
+/// CRC32-C value for unsigned 32-bit integer `v`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_crc32_u32)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(crc32))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_crc32_u32(crc: u32, v: u32) -> u32 {
+ crc32_32_32(crc, v)
+}
+
+/// Compares packed 64-bit integers in `a` and `b` for greater-than,
+/// return the results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmpgt_epi64)
+#[inline]
+#[target_feature(enable = "sse4.2")]
+#[cfg_attr(test, assert_instr(pcmpgtq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cmpgt_epi64(a: __m128i, b: __m128i) -> __m128i {
+ transmute(simd_gt::<_, i64x2>(a.as_i64x2(), b.as_i64x2()))
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ // SSE 4.2 string and text comparison ops
+ #[link_name = "llvm.x86.sse42.pcmpestrm128"]
+ fn pcmpestrm128(a: i8x16, la: i32, b: i8x16, lb: i32, imm8: i8) -> u8x16;
+ #[link_name = "llvm.x86.sse42.pcmpestri128"]
+ fn pcmpestri128(a: i8x16, la: i32, b: i8x16, lb: i32, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpestriz128"]
+ fn pcmpestriz128(a: i8x16, la: i32, b: i8x16, lb: i32, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpestric128"]
+ fn pcmpestric128(a: i8x16, la: i32, b: i8x16, lb: i32, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpestris128"]
+ fn pcmpestris128(a: i8x16, la: i32, b: i8x16, lb: i32, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpestrio128"]
+ fn pcmpestrio128(a: i8x16, la: i32, b: i8x16, lb: i32, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpestria128"]
+ fn pcmpestria128(a: i8x16, la: i32, b: i8x16, lb: i32, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpistrm128"]
+ fn pcmpistrm128(a: i8x16, b: i8x16, imm8: i8) -> i8x16;
+ #[link_name = "llvm.x86.sse42.pcmpistri128"]
+ fn pcmpistri128(a: i8x16, b: i8x16, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpistriz128"]
+ fn pcmpistriz128(a: i8x16, b: i8x16, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpistric128"]
+ fn pcmpistric128(a: i8x16, b: i8x16, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpistris128"]
+ fn pcmpistris128(a: i8x16, b: i8x16, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpistrio128"]
+ fn pcmpistrio128(a: i8x16, b: i8x16, imm8: i8) -> i32;
+ #[link_name = "llvm.x86.sse42.pcmpistria128"]
+ fn pcmpistria128(a: i8x16, b: i8x16, imm8: i8) -> i32;
+ // SSE 4.2 CRC instructions
+ #[link_name = "llvm.x86.sse42.crc32.32.8"]
+ fn crc32_32_8(crc: u32, v: u8) -> u32;
+ #[link_name = "llvm.x86.sse42.crc32.32.16"]
+ fn crc32_32_16(crc: u32, v: u16) -> u32;
+ #[link_name = "llvm.x86.sse42.crc32.32.32"]
+ fn crc32_32_32(crc: u32, v: u32) -> u32;
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+ use std::ptr;
+
+ // Currently one cannot `load` a &[u8] that is is less than 16
+ // in length. This makes loading strings less than 16 in length
+ // a bit difficult. Rather than `load` and mutate the __m128i,
+ // it is easier to memcpy the given string to a local slice with
+ // length 16 and `load` the local slice.
+ #[target_feature(enable = "sse4.2")]
+ unsafe fn str_to_m128i(s: &[u8]) -> __m128i {
+ assert!(s.len() <= 16);
+ let slice = &mut [0u8; 16];
+ ptr::copy_nonoverlapping(
+ s.get_unchecked(0) as *const u8 as *const u8,
+ slice.get_unchecked_mut(0) as *mut u8 as *mut u8,
+ s.len(),
+ );
+ _mm_loadu_si128(slice.as_ptr() as *const _)
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpistrm() {
+ let a = str_to_m128i(b"Hello! Good-Bye!");
+ let b = str_to_m128i(b"hello! good-bye!");
+ let i = _mm_cmpistrm::<_SIDD_UNIT_MASK>(a, b);
+ #[rustfmt::skip]
+ let res = _mm_setr_epi8(
+ 0x00, !0, !0, !0, !0, !0, !0, 0x00,
+ !0, !0, !0, !0, 0x00, !0, !0, !0,
+ );
+ assert_eq_m128i(i, res);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpistri() {
+ let a = str_to_m128i(b"Hello");
+ let b = str_to_m128i(b" Hello ");
+ let i = _mm_cmpistri::<_SIDD_CMP_EQUAL_ORDERED>(a, b);
+ assert_eq!(3, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpistrz() {
+ let a = str_to_m128i(b"");
+ let b = str_to_m128i(b"Hello");
+ let i = _mm_cmpistrz::<_SIDD_CMP_EQUAL_ORDERED>(a, b);
+ assert_eq!(1, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpistrc() {
+ let a = str_to_m128i(b" ");
+ let b = str_to_m128i(b" ! ");
+ let i = _mm_cmpistrc::<_SIDD_UNIT_MASK>(a, b);
+ assert_eq!(1, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpistrs() {
+ let a = str_to_m128i(b"Hello");
+ let b = str_to_m128i(b"");
+ let i = _mm_cmpistrs::<_SIDD_CMP_EQUAL_ORDERED>(a, b);
+ assert_eq!(1, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpistro() {
+ #[rustfmt::skip]
+ let a_bytes = _mm_setr_epi8(
+ 0x00, 0x47, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c,
+ 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ );
+ #[rustfmt::skip]
+ let b_bytes = _mm_setr_epi8(
+ 0x00, 0x48, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c,
+ 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ );
+ let a = a_bytes;
+ let b = b_bytes;
+ let i = _mm_cmpistro::<{ _SIDD_UWORD_OPS | _SIDD_UNIT_MASK }>(a, b);
+ assert_eq!(0, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpistra() {
+ let a = str_to_m128i(b"");
+ let b = str_to_m128i(b"Hello!!!!!!!!!!!");
+ let i = _mm_cmpistra::<_SIDD_UNIT_MASK>(a, b);
+ assert_eq!(1, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpestrm() {
+ let a = str_to_m128i(b"Hello!");
+ let b = str_to_m128i(b"Hello.");
+ let i = _mm_cmpestrm::<_SIDD_UNIT_MASK>(a, 5, b, 5);
+ #[rustfmt::skip]
+ let r = _mm_setr_epi8(
+ !0, !0, !0, !0, !0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ );
+ assert_eq_m128i(i, r);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpestri() {
+ let a = str_to_m128i(b"bar - garbage");
+ let b = str_to_m128i(b"foobar");
+ let i = _mm_cmpestri::<_SIDD_CMP_EQUAL_ORDERED>(a, 3, b, 6);
+ assert_eq!(3, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpestrz() {
+ let a = str_to_m128i(b"");
+ let b = str_to_m128i(b"Hello");
+ let i = _mm_cmpestrz::<_SIDD_CMP_EQUAL_ORDERED>(a, 16, b, 6);
+ assert_eq!(1, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpestrc() {
+ let va = str_to_m128i(b"!!!!!!!!");
+ let vb = str_to_m128i(b" ");
+ let i = _mm_cmpestrc::<_SIDD_UNIT_MASK>(va, 7, vb, 7);
+ assert_eq!(0, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpestrs() {
+ #[rustfmt::skip]
+ let a_bytes = _mm_setr_epi8(
+ 0x00, 0x48, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c,
+ 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ );
+ let a = a_bytes;
+ let b = _mm_set1_epi8(0x00);
+ let i = _mm_cmpestrs::<_SIDD_UWORD_OPS>(a, 8, b, 0);
+ assert_eq!(0, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpestro() {
+ let a = str_to_m128i(b"Hello");
+ let b = str_to_m128i(b"World");
+ let i = _mm_cmpestro::<_SIDD_UBYTE_OPS>(a, 5, b, 5);
+ assert_eq!(0, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpestra() {
+ let a = str_to_m128i(b"Cannot match a");
+ let b = str_to_m128i(b"Null after 14");
+ let i = _mm_cmpestra::<{ _SIDD_CMP_EQUAL_EACH | _SIDD_UNIT_MASK }>(a, 14, b, 16);
+ assert_eq!(1, i);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_crc32_u8() {
+ let crc = 0x2aa1e72b;
+ let v = 0x2a;
+ let i = _mm_crc32_u8(crc, v);
+ assert_eq!(i, 0xf24122e4);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_crc32_u16() {
+ let crc = 0x8ecec3b5;
+ let v = 0x22b;
+ let i = _mm_crc32_u16(crc, v);
+ assert_eq!(i, 0x13bb2fb);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_crc32_u32() {
+ let crc = 0xae2912c8;
+ let v = 0x845fed;
+ let i = _mm_crc32_u32(crc, v);
+ assert_eq!(i, 0xffae2ed1);
+ }
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_cmpgt_epi64() {
+ let a = _mm_setr_epi64x(0, 0x2a);
+ let b = _mm_set1_epi64x(0x00);
+ let i = _mm_cmpgt_epi64(a, b);
+ assert_eq_m128i(i, _mm_setr_epi64x(0x00, 0xffffffffffffffffu64 as i64));
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/sse4a.rs b/library/stdarch/crates/core_arch/src/x86/sse4a.rs
new file mode 100644
index 000000000..976c907cb
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/sse4a.rs
@@ -0,0 +1,164 @@
+//! `i686`'s Streaming SIMD Extensions 4a (`SSE4a`)
+
+use crate::{
+ core_arch::{simd::*, x86::*},
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.sse4a.extrq"]
+ fn extrq(x: i64x2, y: i8x16) -> i64x2;
+ #[link_name = "llvm.x86.sse4a.insertq"]
+ fn insertq(x: i64x2, y: i64x2) -> i64x2;
+ #[link_name = "llvm.x86.sse4a.movnt.sd"]
+ fn movntsd(x: *mut f64, y: __m128d);
+ #[link_name = "llvm.x86.sse4a.movnt.ss"]
+ fn movntss(x: *mut f32, y: __m128);
+}
+
+// FIXME(blocked on #248): _mm_extracti_si64(x, len, idx) // EXTRQ
+// FIXME(blocked on #248): _mm_inserti_si64(x, y, len, idx) // INSERTQ
+
+/// Extracts the bit range specified by `y` from the lower 64 bits of `x`.
+///
+/// The `[13:8]` bits of `y` specify the index of the bit-range to extract. The
+/// `[5:0]` bits of `y` specify the length of the bit-range to extract. All
+/// other bits are ignored.
+///
+/// If the length is zero, it is interpreted as `64`. If the length and index
+/// are zero, the lower 64 bits of `x` are extracted.
+///
+/// If `length == 0 && index > 0` or `length + index > 64` the result is
+/// undefined.
+#[inline]
+#[target_feature(enable = "sse4a")]
+#[cfg_attr(test, assert_instr(extrq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_extract_si64(x: __m128i, y: __m128i) -> __m128i {
+ transmute(extrq(x.as_i64x2(), y.as_i8x16()))
+}
+
+/// Inserts the `[length:0]` bits of `y` into `x` at `index`.
+///
+/// The bits of `y`:
+///
+/// - `[69:64]` specify the `length`,
+/// - `[77:72]` specify the index.
+///
+/// If the `length` is zero it is interpreted as `64`. If `index + length > 64`
+/// or `index > 0 && length == 0` the result is undefined.
+#[inline]
+#[target_feature(enable = "sse4a")]
+#[cfg_attr(test, assert_instr(insertq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_insert_si64(x: __m128i, y: __m128i) -> __m128i {
+ transmute(insertq(x.as_i64x2(), y.as_i64x2()))
+}
+
+/// Non-temporal store of `a.0` into `p`.
+///
+/// Writes 64-bit data to a memory location without polluting the caches.
+#[inline]
+#[target_feature(enable = "sse4a")]
+#[cfg_attr(test, assert_instr(movntsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_stream_sd(p: *mut f64, a: __m128d) {
+ movntsd(p, a);
+}
+
+/// Non-temporal store of `a.0` into `p`.
+///
+/// Writes 32-bit data to a memory location without polluting the caches.
+#[inline]
+#[target_feature(enable = "sse4a")]
+#[cfg_attr(test, assert_instr(movntss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_stream_ss(p: *mut f32, a: __m128) {
+ movntss(p, a);
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::x86::*;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "sse4a")]
+ unsafe fn test_mm_extract_si64() {
+ let b = 0b0110_0000_0000_i64;
+ // ^^^^ bit range extracted
+ let x = _mm_setr_epi64x(b, 0);
+ let v = 0b001000___00___000100_i64;
+ // ^idx: 2^3 = 8 ^length = 2^2 = 4
+ let y = _mm_setr_epi64x(v, 0);
+ let e = _mm_setr_epi64x(0b0110_i64, 0);
+ let r = _mm_extract_si64(x, y);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "sse4a")]
+ unsafe fn test_mm_insert_si64() {
+ let i = 0b0110_i64;
+ // ^^^^ bit range inserted
+ let z = 0b1010_1010_1010i64;
+ // ^^^^ bit range replaced
+ let e = 0b0110_1010_1010i64;
+ // ^^^^ replaced 1010 with 0110
+ let x = _mm_setr_epi64x(z, 0);
+ let expected = _mm_setr_epi64x(e, 0);
+ let v = 0b001000___00___000100_i64;
+ // ^idx: 2^3 = 8 ^length = 2^2 = 4
+ let y = _mm_setr_epi64x(i, v);
+ let r = _mm_insert_si64(x, y);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[repr(align(16))]
+ struct MemoryF64 {
+ data: [f64; 2],
+ }
+
+ #[simd_test(enable = "sse4a")]
+ unsafe fn test_mm_stream_sd() {
+ let mut mem = MemoryF64 {
+ data: [1.0_f64, 2.0],
+ };
+ {
+ let vals = &mut mem.data;
+ let d = vals.as_mut_ptr();
+
+ let x = _mm_setr_pd(3.0, 4.0);
+
+ _mm_stream_sd(d, x);
+ }
+ assert_eq!(mem.data[0], 3.0);
+ assert_eq!(mem.data[1], 2.0);
+ }
+
+ #[repr(align(16))]
+ struct MemoryF32 {
+ data: [f32; 4],
+ }
+
+ #[simd_test(enable = "sse4a")]
+ unsafe fn test_mm_stream_ss() {
+ let mut mem = MemoryF32 {
+ data: [1.0_f32, 2.0, 3.0, 4.0],
+ };
+ {
+ let vals = &mut mem.data;
+ let d = vals.as_mut_ptr();
+
+ let x = _mm_setr_ps(5.0, 6.0, 7.0, 8.0);
+
+ _mm_stream_ss(d, x);
+ }
+ assert_eq!(mem.data[0], 5.0);
+ assert_eq!(mem.data[1], 2.0);
+ assert_eq!(mem.data[2], 3.0);
+ assert_eq!(mem.data[3], 4.0);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/ssse3.rs b/library/stdarch/crates/core_arch/src/x86/ssse3.rs
new file mode 100644
index 000000000..4beb496b6
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/ssse3.rs
@@ -0,0 +1,537 @@
+//! Supplemental Streaming SIMD Extensions 3 (SSSE3)
+
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*},
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Computes the absolute value of packed 8-bit signed integers in `a` and
+/// return the unsigned results.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_abs_epi8)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(pabsb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_abs_epi8(a: __m128i) -> __m128i {
+ transmute(pabsb128(a.as_i8x16()))
+}
+
+/// Computes the absolute value of each of the packed 16-bit signed integers in
+/// `a` and
+/// return the 16-bit unsigned integer
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_abs_epi16)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(pabsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_abs_epi16(a: __m128i) -> __m128i {
+ transmute(pabsw128(a.as_i16x8()))
+}
+
+/// Computes the absolute value of each of the packed 32-bit signed integers in
+/// `a` and
+/// return the 32-bit unsigned integer
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_abs_epi32)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(pabsd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_abs_epi32(a: __m128i) -> __m128i {
+ transmute(pabsd128(a.as_i32x4()))
+}
+
+/// Shuffles bytes from `a` according to the content of `b`.
+///
+/// The last 4 bits of each byte of `b` are used as addresses
+/// into the 16 bytes of `a`.
+///
+/// In addition, if the highest significant bit of a byte of `b`
+/// is set, the respective destination byte is set to 0.
+///
+/// Picturing `a` and `b` as `[u8; 16]`, `_mm_shuffle_epi8` is
+/// logically equivalent to:
+///
+/// ```
+/// fn mm_shuffle_epi8(a: [u8; 16], b: [u8; 16]) -> [u8; 16] {
+/// let mut r = [0u8; 16];
+/// for i in 0..16 {
+/// // if the most significant bit of b is set,
+/// // then the destination byte is set to 0.
+/// if b[i] & 0x80 == 0u8 {
+/// r[i] = a[(b[i] % 16) as usize];
+/// }
+/// }
+/// r
+/// }
+/// ```
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shuffle_epi8)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(pshufb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_shuffle_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pshufb128(a.as_u8x16(), b.as_u8x16()))
+}
+
+/// Concatenate 16-byte blocks in `a` and `b` into a 32-byte temporary result,
+/// shift the result right by `n` bytes, and returns the low 16 bytes.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_alignr_epi8)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(palignr, IMM8 = 15))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_alignr_epi8<const IMM8: i32>(a: __m128i, b: __m128i) -> __m128i {
+ static_assert_imm8!(IMM8);
+ // If palignr is shifting the pair of vectors more than the size of two
+ // lanes, emit zero.
+ if IMM8 > 32 {
+ return _mm_set1_epi8(0);
+ }
+ // If palignr is shifting the pair of input vectors more than one lane,
+ // but less than two lanes, convert to shifting in zeroes.
+ let (a, b) = if IMM8 > 16 {
+ (_mm_set1_epi8(0), a)
+ } else {
+ (a, b)
+ };
+ const fn mask(shift: u32, i: u32) -> u32 {
+ if shift > 32 {
+ // Unused, but needs to be a valid index.
+ i
+ } else if shift > 16 {
+ shift - 16 + i
+ } else {
+ shift + i
+ }
+ }
+ let r: i8x16 = simd_shuffle16!(
+ b.as_i8x16(),
+ a.as_i8x16(),
+ <const IMM8: i32> [
+ mask(IMM8 as u32, 0),
+ mask(IMM8 as u32, 1),
+ mask(IMM8 as u32, 2),
+ mask(IMM8 as u32, 3),
+ mask(IMM8 as u32, 4),
+ mask(IMM8 as u32, 5),
+ mask(IMM8 as u32, 6),
+ mask(IMM8 as u32, 7),
+ mask(IMM8 as u32, 8),
+ mask(IMM8 as u32, 9),
+ mask(IMM8 as u32, 10),
+ mask(IMM8 as u32, 11),
+ mask(IMM8 as u32, 12),
+ mask(IMM8 as u32, 13),
+ mask(IMM8 as u32, 14),
+ mask(IMM8 as u32, 15),
+ ],
+ );
+ transmute(r)
+}
+
+/// Horizontally adds the adjacent pairs of values contained in 2 packed
+/// 128-bit vectors of `[8 x i16]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hadd_epi16)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(phaddw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_hadd_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(phaddw128(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Horizontally adds the adjacent pairs of values contained in 2 packed
+/// 128-bit vectors of `[8 x i16]`. Positive sums greater than 7FFFh are
+/// saturated to 7FFFh. Negative sums less than 8000h are saturated to 8000h.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hadds_epi16)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(phaddsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_hadds_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(phaddsw128(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Horizontally adds the adjacent pairs of values contained in 2 packed
+/// 128-bit vectors of `[4 x i32]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hadd_epi32)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(phaddd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_hadd_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(phaddd128(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Horizontally subtract the adjacent pairs of values contained in 2
+/// packed 128-bit vectors of `[8 x i16]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hsub_epi16)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(phsubw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_hsub_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(phsubw128(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Horizontally subtract the adjacent pairs of values contained in 2
+/// packed 128-bit vectors of `[8 x i16]`. Positive differences greater than
+/// 7FFFh are saturated to 7FFFh. Negative differences less than 8000h are
+/// saturated to 8000h.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hsubs_epi16)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(phsubsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_hsubs_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(phsubsw128(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Horizontally subtract the adjacent pairs of values contained in 2
+/// packed 128-bit vectors of `[4 x i32]`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hsub_epi32)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(phsubd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_hsub_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(phsubd128(a.as_i32x4(), b.as_i32x4()))
+}
+
+/// Multiplies corresponding pairs of packed 8-bit unsigned integer
+/// values contained in the first source operand and packed 8-bit signed
+/// integer values contained in the second source operand, add pairs of
+/// contiguous products with signed saturation, and writes the 16-bit sums to
+/// the corresponding bits in the destination.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maddubs_epi16)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(pmaddubsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_maddubs_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmaddubsw128(a.as_u8x16(), b.as_i8x16()))
+}
+
+/// Multiplies packed 16-bit signed integer values, truncate the 32-bit
+/// product to the 18 most significant bits by right-shifting, round the
+/// truncated value by adding 1, and write bits `[16:1]` to the destination.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mulhrs_epi16)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(pmulhrsw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_mulhrs_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(pmulhrsw128(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Negates packed 8-bit integers in `a` when the corresponding signed 8-bit
+/// integer in `b` is negative, and returns the result.
+/// Elements in result are zeroed out when the corresponding element in `b`
+/// is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sign_epi8)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(psignb))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sign_epi8(a: __m128i, b: __m128i) -> __m128i {
+ transmute(psignb128(a.as_i8x16(), b.as_i8x16()))
+}
+
+/// Negates packed 16-bit integers in `a` when the corresponding signed 16-bit
+/// integer in `b` is negative, and returns the results.
+/// Elements in result are zeroed out when the corresponding element in `b`
+/// is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sign_epi16)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(psignw))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sign_epi16(a: __m128i, b: __m128i) -> __m128i {
+ transmute(psignw128(a.as_i16x8(), b.as_i16x8()))
+}
+
+/// Negates packed 32-bit integers in `a` when the corresponding signed 32-bit
+/// integer in `b` is negative, and returns the results.
+/// Element in result are zeroed out when the corresponding element in `b`
+/// is zero.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_sign_epi32)
+#[inline]
+#[target_feature(enable = "ssse3")]
+#[cfg_attr(test, assert_instr(psignd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_sign_epi32(a: __m128i, b: __m128i) -> __m128i {
+ transmute(psignd128(a.as_i32x4(), b.as_i32x4()))
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.ssse3.pabs.b.128"]
+ fn pabsb128(a: i8x16) -> u8x16;
+
+ #[link_name = "llvm.x86.ssse3.pabs.w.128"]
+ fn pabsw128(a: i16x8) -> u16x8;
+
+ #[link_name = "llvm.x86.ssse3.pabs.d.128"]
+ fn pabsd128(a: i32x4) -> u32x4;
+
+ #[link_name = "llvm.x86.ssse3.pshuf.b.128"]
+ fn pshufb128(a: u8x16, b: u8x16) -> u8x16;
+
+ #[link_name = "llvm.x86.ssse3.phadd.w.128"]
+ fn phaddw128(a: i16x8, b: i16x8) -> i16x8;
+
+ #[link_name = "llvm.x86.ssse3.phadd.sw.128"]
+ fn phaddsw128(a: i16x8, b: i16x8) -> i16x8;
+
+ #[link_name = "llvm.x86.ssse3.phadd.d.128"]
+ fn phaddd128(a: i32x4, b: i32x4) -> i32x4;
+
+ #[link_name = "llvm.x86.ssse3.phsub.w.128"]
+ fn phsubw128(a: i16x8, b: i16x8) -> i16x8;
+
+ #[link_name = "llvm.x86.ssse3.phsub.sw.128"]
+ fn phsubsw128(a: i16x8, b: i16x8) -> i16x8;
+
+ #[link_name = "llvm.x86.ssse3.phsub.d.128"]
+ fn phsubd128(a: i32x4, b: i32x4) -> i32x4;
+
+ #[link_name = "llvm.x86.ssse3.pmadd.ub.sw.128"]
+ fn pmaddubsw128(a: u8x16, b: i8x16) -> i16x8;
+
+ #[link_name = "llvm.x86.ssse3.pmul.hr.sw.128"]
+ fn pmulhrsw128(a: i16x8, b: i16x8) -> i16x8;
+
+ #[link_name = "llvm.x86.ssse3.psign.b.128"]
+ fn psignb128(a: i8x16, b: i8x16) -> i8x16;
+
+ #[link_name = "llvm.x86.ssse3.psign.w.128"]
+ fn psignw128(a: i16x8, b: i16x8) -> i16x8;
+
+ #[link_name = "llvm.x86.ssse3.psign.d.128"]
+ fn psignd128(a: i32x4, b: i32x4) -> i32x4;
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_abs_epi8() {
+ let r = _mm_abs_epi8(_mm_set1_epi8(-5));
+ assert_eq_m128i(r, _mm_set1_epi8(5));
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_abs_epi16() {
+ let r = _mm_abs_epi16(_mm_set1_epi16(-5));
+ assert_eq_m128i(r, _mm_set1_epi16(5));
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_abs_epi32() {
+ let r = _mm_abs_epi32(_mm_set1_epi32(-5));
+ assert_eq_m128i(r, _mm_set1_epi32(5));
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_shuffle_epi8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 4, 128_u8 as i8, 4, 3,
+ 24, 12, 6, 19,
+ 12, 5, 5, 10,
+ 4, 1, 8, 0,
+ );
+ let expected = _mm_setr_epi8(5, 0, 5, 4, 9, 13, 7, 4, 13, 6, 6, 11, 5, 2, 9, 1);
+ let r = _mm_shuffle_epi8(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_alignr_epi8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 4, 63, 4, 3,
+ 24, 12, 6, 19,
+ 12, 5, 5, 10,
+ 4, 1, 8, 0,
+ );
+ let r = _mm_alignr_epi8::<33>(a, b);
+ assert_eq_m128i(r, _mm_set1_epi8(0));
+
+ let r = _mm_alignr_epi8::<17>(a, b);
+ #[rustfmt::skip]
+ let expected = _mm_setr_epi8(
+ 2, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 0,
+ );
+ assert_eq_m128i(r, expected);
+
+ let r = _mm_alignr_epi8::<16>(a, b);
+ assert_eq_m128i(r, a);
+
+ let r = _mm_alignr_epi8::<15>(a, b);
+ #[rustfmt::skip]
+ let expected = _mm_setr_epi8(
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ );
+ assert_eq_m128i(r, expected);
+
+ let r = _mm_alignr_epi8::<0>(a, b);
+ assert_eq_m128i(r, b);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_hadd_epi16() {
+ let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm_setr_epi16(4, 128, 4, 3, 24, 12, 6, 19);
+ let expected = _mm_setr_epi16(3, 7, 11, 15, 132, 7, 36, 25);
+ let r = _mm_hadd_epi16(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_hadds_epi16() {
+ let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm_setr_epi16(4, 128, 4, 3, 32767, 1, -32768, -1);
+ let expected = _mm_setr_epi16(3, 7, 11, 15, 132, 7, 32767, -32768);
+ let r = _mm_hadds_epi16(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_hadd_epi32() {
+ let a = _mm_setr_epi32(1, 2, 3, 4);
+ let b = _mm_setr_epi32(4, 128, 4, 3);
+ let expected = _mm_setr_epi32(3, 7, 132, 7);
+ let r = _mm_hadd_epi32(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_hsub_epi16() {
+ let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm_setr_epi16(4, 128, 4, 3, 24, 12, 6, 19);
+ let expected = _mm_setr_epi16(-1, -1, -1, -1, -124, 1, 12, -13);
+ let r = _mm_hsub_epi16(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_hsubs_epi16() {
+ let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm_setr_epi16(4, 128, 4, 3, 32767, -1, -32768, 1);
+ let expected = _mm_setr_epi16(-1, -1, -1, -1, -124, 1, 32767, -32768);
+ let r = _mm_hsubs_epi16(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_hsub_epi32() {
+ let a = _mm_setr_epi32(1, 2, 3, 4);
+ let b = _mm_setr_epi32(4, 128, 4, 3);
+ let expected = _mm_setr_epi32(-1, -1, -124, 1);
+ let r = _mm_hsub_epi32(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_maddubs_epi16() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ );
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 4, 63, 4, 3,
+ 24, 12, 6, 19,
+ 12, 5, 5, 10,
+ 4, 1, 8, 0,
+ );
+ let expected = _mm_setr_epi16(130, 24, 192, 194, 158, 175, 66, 120);
+ let r = _mm_maddubs_epi16(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_mulhrs_epi16() {
+ let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm_setr_epi16(4, 128, 4, 3, 32767, -1, -32768, 1);
+ let expected = _mm_setr_epi16(0, 0, 0, 0, 5, 0, -7, 0);
+ let r = _mm_mulhrs_epi16(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_sign_epi8() {
+ #[rustfmt::skip]
+ let a = _mm_setr_epi8(
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, -14, -15, 16,
+ );
+ #[rustfmt::skip]
+ let b = _mm_setr_epi8(
+ 4, 63, -4, 3, 24, 12, -6, -19,
+ 12, 5, -5, 10, 4, 1, -8, 0,
+ );
+ #[rustfmt::skip]
+ let expected = _mm_setr_epi8(
+ 1, 2, -3, 4, 5, 6, -7, -8,
+ 9, 10, -11, 12, 13, -14, 15, 0,
+ );
+ let r = _mm_sign_epi8(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_sign_epi16() {
+ let a = _mm_setr_epi16(1, 2, 3, 4, -5, -6, 7, 8);
+ let b = _mm_setr_epi16(4, 128, 0, 3, 1, -1, -2, 1);
+ let expected = _mm_setr_epi16(1, 2, 0, 4, -5, 6, -7, 8);
+ let r = _mm_sign_epi16(a, b);
+ assert_eq_m128i(r, expected);
+ }
+
+ #[simd_test(enable = "ssse3")]
+ unsafe fn test_mm_sign_epi32() {
+ let a = _mm_setr_epi32(-1, 2, 3, 4);
+ let b = _mm_setr_epi32(1, -1, 1, 0);
+ let expected = _mm_setr_epi32(-1, -2, 3, 0);
+ let r = _mm_sign_epi32(a, b);
+ assert_eq_m128i(r, expected);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/tbm.rs b/library/stdarch/crates/core_arch/src/x86/tbm.rs
new file mode 100644
index 000000000..d1102a116
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/tbm.rs
@@ -0,0 +1,460 @@
+//! Trailing Bit Manipulation (TBM) instruction set.
+//!
+//! The reference is [AMD64 Architecture Programmer's Manual, Volume 3:
+//! General-Purpose and System Instructions][amd64_ref].
+//!
+//! [Wikipedia][wikipedia_bmi] provides a quick overview of the available
+//! instructions.
+//!
+//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf
+//! [wikipedia_bmi]:
+//! https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+// FIXME(blocked on #248)
+// TODO: LLVM-CODEGEN ERROR: LLVM ERROR: Cannot select:
+// intrinsic %llvm.x86.tbm.bextri.u32
+/*
+#[allow(dead_code)]
+extern "C" {
+ #[link_name="llvm.x86.tbm.bextri.u32"]
+ fn x86_tbm_bextri_u32(a: u32, y: u32) -> u32;
+ #[link_name="llvm.x86.tbm.bextri.u64"]
+ fn x86_tbm_bextri_u64(x: u64, y: u64) -> u64;
+}
+
+/// Extracts bits in range [`start`, `start` + `length`) from `a` into
+/// the least significant bits of the result.
+#[inline]
+#[target_feature(enable = "tbm")]
+pub fn _bextr_u32(a: u32, start: u32, len: u32) -> u32 {
+ _bextr2_u32(a, (start & 0xffu32) | ((len & 0xffu32) << 8u32))
+}
+
+/// Extracts bits in range [`start`, `start` + `length`) from `a` into
+/// the least significant bits of the result.
+#[inline]
+#[target_feature(enable = "tbm")]
+pub fn _bextr_u64(a: u64, start: u64, len: u64) -> u64 {
+ _bextr2_u64(a, (start & 0xffu64) | ((len & 0xffu64) << 8u64))
+}
+
+/// Extracts bits of `a` specified by `control` into
+/// the least significant bits of the result.
+///
+/// Bits `[7,0]` of `control` specify the index to the first bit in the range to
+/// be extracted, and bits `[15,8]` specify the length of the range.
+#[inline]
+#[target_feature(enable = "tbm")]
+pub fn _bextr2_u32(a: u32, control: u32) -> u32 {
+ unsafe { x86_tbm_bextri_u32(a, control) }
+}
+
+/// Extracts bits of `a` specified by `control` into
+/// the least significant bits of the result.
+///
+/// Bits `[7,0]` of `control` specify the index to the first bit in the range to
+/// be extracted, and bits `[15,8]` specify the length of the range.
+#[inline]
+#[target_feature(enable = "tbm")]
+pub fn _bextr2_u64(a: u64, control: u64) -> u64 {
+ unsafe { x86_tbm_bextri_u64(a, control) }
+}
+*/
+
+/// Clears all bits below the least significant zero bit of `x`.
+///
+/// If there is no zero bit in `x`, it returns zero.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blcfill))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blcfill_u32(x: u32) -> u32 {
+ x & (x.wrapping_add(1))
+}
+
+/// Clears all bits below the least significant zero bit of `x`.
+///
+/// If there is no zero bit in `x`, it returns zero.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blcfill))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blcfill_u64(x: u64) -> u64 {
+ x & (x.wrapping_add(1))
+}
+
+/// Sets all bits of `x` to 1 except for the least significant zero bit.
+///
+/// If there is no zero bit in `x`, it sets all bits.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blci))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blci_u32(x: u32) -> u32 {
+ x | !(x.wrapping_add(1))
+}
+
+/// Sets all bits of `x` to 1 except for the least significant zero bit.
+///
+/// If there is no zero bit in `x`, it sets all bits.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blci))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blci_u64(x: u64) -> u64 {
+ x | !(x.wrapping_add(1))
+}
+
+/// Sets the least significant zero bit of `x` and clears all other bits.
+///
+/// If there is no zero bit in `x`, it returns zero.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blcic))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blcic_u32(x: u32) -> u32 {
+ !x & (x.wrapping_add(1))
+}
+
+/// Sets the least significant zero bit of `x` and clears all other bits.
+///
+/// If there is no zero bit in `x`, it returns zero.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blcic))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blcic_u64(x: u64) -> u64 {
+ !x & (x.wrapping_add(1))
+}
+
+/// Sets the least significant zero bit of `x` and clears all bits above
+/// that bit.
+///
+/// If there is no zero bit in `x`, it sets all the bits.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blcmsk))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blcmsk_u32(x: u32) -> u32 {
+ x ^ (x.wrapping_add(1))
+}
+
+/// Sets the least significant zero bit of `x` and clears all bits above
+/// that bit.
+///
+/// If there is no zero bit in `x`, it sets all the bits.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blcmsk))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blcmsk_u64(x: u64) -> u64 {
+ x ^ (x.wrapping_add(1))
+}
+
+/// Sets the least significant zero bit of `x`.
+///
+/// If there is no zero bit in `x`, it returns `x`.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blcs))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blcs_u32(x: u32) -> u32 {
+ x | (x.wrapping_add(1))
+}
+
+/// Sets the least significant zero bit of `x`.
+///
+/// If there is no zero bit in `x`, it returns `x`.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blcs))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blcs_u64(x: u64) -> u64 {
+ x | x.wrapping_add(1)
+}
+
+/// Sets all bits of `x` below the least significant one.
+///
+/// If there is no set bit in `x`, it sets all the bits.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blsfill))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blsfill_u32(x: u32) -> u32 {
+ x | (x.wrapping_sub(1))
+}
+
+/// Sets all bits of `x` below the least significant one.
+///
+/// If there is no set bit in `x`, it sets all the bits.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blsfill))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blsfill_u64(x: u64) -> u64 {
+ x | (x.wrapping_sub(1))
+}
+
+/// Clears least significant bit and sets all other bits.
+///
+/// If there is no set bit in `x`, it sets all the bits.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blsic))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blsic_u32(x: u32) -> u32 {
+ !x | (x.wrapping_sub(1))
+}
+
+/// Clears least significant bit and sets all other bits.
+///
+/// If there is no set bit in `x`, it sets all the bits.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(blsic))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blsic_u64(x: u64) -> u64 {
+ !x | (x.wrapping_sub(1))
+}
+
+/// Clears all bits below the least significant zero of `x` and sets all other
+/// bits.
+///
+/// If the least significant bit of `x` is `0`, it sets all bits.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(t1mskc))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _t1mskc_u32(x: u32) -> u32 {
+ !x | (x.wrapping_add(1))
+}
+
+/// Clears all bits below the least significant zero of `x` and sets all other
+/// bits.
+///
+/// If the least significant bit of `x` is `0`, it sets all bits.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(t1mskc))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _t1mskc_u64(x: u64) -> u64 {
+ !x | (x.wrapping_add(1))
+}
+
+/// Sets all bits below the least significant one of `x` and clears all other
+/// bits.
+///
+/// If the least significant bit of `x` is 1, it returns zero.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(tzmsk))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _tzmsk_u32(x: u32) -> u32 {
+ !x & (x.wrapping_sub(1))
+}
+
+/// Sets all bits below the least significant one of `x` and clears all other
+/// bits.
+///
+/// If the least significant bit of `x` is 1, it returns zero.
+#[inline]
+#[target_feature(enable = "tbm")]
+#[cfg_attr(test, assert_instr(tzmsk))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _tzmsk_u64(x: u64) -> u64 {
+ !x & (x.wrapping_sub(1))
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ /*
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_bextr_u32() {
+ assert_eq!(_bextr_u32(0b0101_0000u32, 4, 4), 0b0000_0101u32);
+ }
+
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_bextr_u64() {
+ assert_eq!(_bextr_u64(0b0101_0000u64, 4, 4), 0b0000_0101u64);
+ }
+ */
+
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_blcfill_u32() {
+ assert_eq!(_blcfill_u32(0b0101_0111u32), 0b0101_0000u32);
+ assert_eq!(_blcfill_u32(0b1111_1111u32), 0u32);
+ }
+
+ #[simd_test(enable = "tbm")]
+ #[cfg(not(target_arch = "x86"))]
+ unsafe fn test_blcfill_u64() {
+ assert_eq!(_blcfill_u64(0b0101_0111u64), 0b0101_0000u64);
+ assert_eq!(_blcfill_u64(0b1111_1111u64), 0u64);
+ }
+
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_blci_u32() {
+ assert_eq!(
+ _blci_u32(0b0101_0000u32),
+ 0b1111_1111_1111_1111_1111_1111_1111_1110u32
+ );
+ assert_eq!(
+ _blci_u32(0b1111_1111u32),
+ 0b1111_1111_1111_1111_1111_1110_1111_1111u32
+ );
+ }
+
+ #[simd_test(enable = "tbm")]
+ #[cfg(not(target_arch = "x86"))]
+ #[rustfmt::skip]
+ unsafe fn test_blci_u64() {
+ assert_eq!(
+ _blci_u64(0b0101_0000u64),
+ 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1110u64
+ );
+ assert_eq!(
+ _blci_u64(0b1111_1111u64),
+ 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1110_1111_1111u64
+ );
+ }
+
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_blcic_u32() {
+ assert_eq!(_blcic_u32(0b0101_0001u32), 0b0000_0010u32);
+ assert_eq!(_blcic_u32(0b1111_1111u32), 0b1_0000_0000u32);
+ }
+
+ #[simd_test(enable = "tbm")]
+ #[cfg(not(target_arch = "x86"))]
+ unsafe fn test_blcic_u64() {
+ assert_eq!(_blcic_u64(0b0101_0001u64), 0b0000_0010u64);
+ assert_eq!(_blcic_u64(0b1111_1111u64), 0b1_0000_0000u64);
+ }
+
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_blcmsk_u32() {
+ assert_eq!(_blcmsk_u32(0b0101_0001u32), 0b0000_0011u32);
+ assert_eq!(_blcmsk_u32(0b1111_1111u32), 0b1_1111_1111u32);
+ }
+
+ #[simd_test(enable = "tbm")]
+ #[cfg(not(target_arch = "x86"))]
+ unsafe fn test_blcmsk_u64() {
+ assert_eq!(_blcmsk_u64(0b0101_0001u64), 0b0000_0011u64);
+ assert_eq!(_blcmsk_u64(0b1111_1111u64), 0b1_1111_1111u64);
+ }
+
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_blcs_u32() {
+ assert_eq!(_blcs_u32(0b0101_0001u32), 0b0101_0011u32);
+ assert_eq!(_blcs_u32(0b1111_1111u32), 0b1_1111_1111u32);
+ }
+
+ #[simd_test(enable = "tbm")]
+ #[cfg(not(target_arch = "x86"))]
+ unsafe fn test_blcs_u64() {
+ assert_eq!(_blcs_u64(0b0101_0001u64), 0b0101_0011u64);
+ assert_eq!(_blcs_u64(0b1111_1111u64), 0b1_1111_1111u64);
+ }
+
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_blsfill_u32() {
+ assert_eq!(_blsfill_u32(0b0101_0100u32), 0b0101_0111u32);
+ assert_eq!(
+ _blsfill_u32(0u32),
+ 0b1111_1111_1111_1111_1111_1111_1111_1111u32
+ );
+ }
+
+ #[simd_test(enable = "tbm")]
+ #[cfg(not(target_arch = "x86"))]
+ #[rustfmt::skip]
+ unsafe fn test_blsfill_u64() {
+ assert_eq!(_blsfill_u64(0b0101_0100u64), 0b0101_0111u64);
+ assert_eq!(
+ _blsfill_u64(0u64),
+ 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111u64
+ );
+ }
+
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_blsic_u32() {
+ assert_eq!(
+ _blsic_u32(0b0101_0100u32),
+ 0b1111_1111_1111_1111_1111_1111_1111_1011u32
+ );
+ assert_eq!(
+ _blsic_u32(0u32),
+ 0b1111_1111_1111_1111_1111_1111_1111_1111u32
+ );
+ }
+
+ #[simd_test(enable = "tbm")]
+ #[cfg(not(target_arch = "x86"))]
+ #[rustfmt::skip]
+ unsafe fn test_blsic_u64() {
+ assert_eq!(
+ _blsic_u64(0b0101_0100u64),
+ 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1011u64
+ );
+ assert_eq!(
+ _blsic_u64(0u64),
+ 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111u64
+ );
+ }
+
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_t1mskc_u32() {
+ assert_eq!(
+ _t1mskc_u32(0b0101_0111u32),
+ 0b1111_1111_1111_1111_1111_1111_1111_1000u32
+ );
+ assert_eq!(
+ _t1mskc_u32(0u32),
+ 0b1111_1111_1111_1111_1111_1111_1111_1111u32
+ );
+ }
+
+ #[simd_test(enable = "tbm")]
+ #[cfg(not(target_arch = "x86"))]
+ #[rustfmt::skip]
+ unsafe fn test_t1mksc_u64() {
+ assert_eq!(
+ _t1mskc_u64(0b0101_0111u64),
+ 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1000u64
+ );
+ assert_eq!(
+ _t1mskc_u64(0u64),
+ 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111u64
+ );
+ }
+
+ #[simd_test(enable = "tbm")]
+ unsafe fn test_tzmsk_u32() {
+ assert_eq!(_tzmsk_u32(0b0101_1000u32), 0b0000_0111u32);
+ assert_eq!(_tzmsk_u32(0b0101_1001u32), 0b0000_0000u32);
+ }
+
+ #[simd_test(enable = "tbm")]
+ #[cfg(not(target_arch = "x86"))]
+ unsafe fn test_tzmsk_u64() {
+ assert_eq!(_tzmsk_u64(0b0101_1000u64), 0b0000_0111u64);
+ assert_eq!(_tzmsk_u64(0b0101_1001u64), 0b0000_0000u64);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/test.rs b/library/stdarch/crates/core_arch/src/x86/test.rs
new file mode 100644
index 000000000..bab89e61a
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/test.rs
@@ -0,0 +1,144 @@
+//! Utilities used in testing the x86 intrinsics
+
+use crate::core_arch::x86::*;
+use std::mem::transmute;
+
+#[target_feature(enable = "sse2")]
+pub unsafe fn assert_eq_m128i(a: __m128i, b: __m128i) {
+ assert_eq!(transmute::<_, [u64; 2]>(a), transmute::<_, [u64; 2]>(b))
+}
+
+#[target_feature(enable = "sse2")]
+pub unsafe fn assert_eq_m128d(a: __m128d, b: __m128d) {
+ if _mm_movemask_pd(_mm_cmpeq_pd(a, b)) != 0b11 {
+ panic!("{:?} != {:?}", a, b);
+ }
+}
+
+#[target_feature(enable = "sse2")]
+pub unsafe fn get_m128d(a: __m128d, idx: usize) -> f64 {
+ transmute::<_, [f64; 2]>(a)[idx]
+}
+
+#[target_feature(enable = "sse")]
+pub unsafe fn assert_eq_m128(a: __m128, b: __m128) {
+ let r = _mm_cmpeq_ps(a, b);
+ if _mm_movemask_ps(r) != 0b1111 {
+ panic!("{:?} != {:?}", a, b);
+ }
+}
+
+#[target_feature(enable = "sse")]
+pub unsafe fn get_m128(a: __m128, idx: usize) -> f32 {
+ transmute::<_, [f32; 4]>(a)[idx]
+}
+
+// not actually an intrinsic but useful in various tests as we proted from
+// `i64x2::new` which is backwards from `_mm_set_epi64x`
+#[target_feature(enable = "sse2")]
+pub unsafe fn _mm_setr_epi64x(a: i64, b: i64) -> __m128i {
+ _mm_set_epi64x(b, a)
+}
+
+#[target_feature(enable = "avx")]
+pub unsafe fn assert_eq_m256i(a: __m256i, b: __m256i) {
+ assert_eq!(transmute::<_, [u64; 4]>(a), transmute::<_, [u64; 4]>(b))
+}
+
+#[target_feature(enable = "avx")]
+pub unsafe fn assert_eq_m256d(a: __m256d, b: __m256d) {
+ let cmp = _mm256_cmp_pd::<_CMP_EQ_OQ>(a, b);
+ if _mm256_movemask_pd(cmp) != 0b1111 {
+ panic!("{:?} != {:?}", a, b);
+ }
+}
+
+#[target_feature(enable = "avx")]
+pub unsafe fn get_m256d(a: __m256d, idx: usize) -> f64 {
+ transmute::<_, [f64; 4]>(a)[idx]
+}
+
+#[target_feature(enable = "avx")]
+pub unsafe fn assert_eq_m256(a: __m256, b: __m256) {
+ let cmp = _mm256_cmp_ps::<_CMP_EQ_OQ>(a, b);
+ if _mm256_movemask_ps(cmp) != 0b11111111 {
+ panic!("{:?} != {:?}", a, b);
+ }
+}
+
+#[target_feature(enable = "avx")]
+pub unsafe fn get_m256(a: __m256, idx: usize) -> f32 {
+ transmute::<_, [f32; 8]>(a)[idx]
+}
+
+#[target_feature(enable = "avx512f")]
+pub unsafe fn get_m512(a: __m512, idx: usize) -> f32 {
+ transmute::<_, [f32; 16]>(a)[idx]
+}
+
+#[target_feature(enable = "avx512f")]
+pub unsafe fn get_m512d(a: __m512d, idx: usize) -> f64 {
+ transmute::<_, [f64; 8]>(a)[idx]
+}
+
+#[target_feature(enable = "avx512f")]
+pub unsafe fn get_m512i(a: __m512i, idx: usize) -> i64 {
+ transmute::<_, [i64; 8]>(a)[idx]
+}
+
+// These intrinsics doesn't exist on x86 b/c it requires a 64-bit register,
+// which doesn't exist on x86!
+#[cfg(target_arch = "x86")]
+mod x86_polyfill {
+ use crate::core_arch::x86::*;
+
+ #[rustc_legacy_const_generics(2)]
+ pub unsafe fn _mm_insert_epi64<const INDEX: i32>(a: __m128i, val: i64) -> __m128i {
+ static_assert_imm1!(INDEX);
+ #[repr(C)]
+ union A {
+ a: __m128i,
+ b: [i64; 2],
+ }
+ let mut a = A { a };
+ a.b[INDEX as usize] = val;
+ a.a
+ }
+
+ #[target_feature(enable = "avx2")]
+ #[rustc_legacy_const_generics(2)]
+ pub unsafe fn _mm256_insert_epi64<const INDEX: i32>(a: __m256i, val: i64) -> __m256i {
+ static_assert_imm2!(INDEX);
+ #[repr(C)]
+ union A {
+ a: __m256i,
+ b: [i64; 4],
+ }
+ let mut a = A { a };
+ a.b[INDEX as usize] = val;
+ a.a
+ }
+}
+#[cfg(target_arch = "x86_64")]
+mod x86_polyfill {
+ pub use crate::core_arch::x86_64::{_mm256_insert_epi64, _mm_insert_epi64};
+}
+pub use self::x86_polyfill::*;
+
+pub unsafe fn assert_eq_m512i(a: __m512i, b: __m512i) {
+ assert_eq!(transmute::<_, [i32; 16]>(a), transmute::<_, [i32; 16]>(b))
+}
+
+pub unsafe fn assert_eq_m512(a: __m512, b: __m512) {
+ let cmp = _mm512_cmp_ps_mask::<_CMP_EQ_OQ>(a, b);
+ if cmp != 0b11111111_11111111 {
+ panic!("{:?} != {:?}", a, b);
+ }
+}
+
+pub unsafe fn assert_eq_m512d(a: __m512d, b: __m512d) {
+ let cmp = _mm512_cmp_pd_mask::<_CMP_EQ_OQ>(a, b);
+ if cmp != 0b11111111 {
+ panic!("{:?} != {:?}", a, b);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86/xsave.rs b/library/stdarch/crates/core_arch/src/x86/xsave.rs
new file mode 100644
index 000000000..30f807e44
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86/xsave.rs
@@ -0,0 +1,282 @@
+//! `i586`'s `xsave` and `xsaveopt` target feature intrinsics
+#![allow(clippy::module_name_repetitions)]
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.xsave"]
+ fn xsave(p: *mut u8, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xrstor"]
+ fn xrstor(p: *const u8, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xsetbv"]
+ fn xsetbv(v: u32, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xgetbv"]
+ fn xgetbv(v: u32) -> i64;
+ #[link_name = "llvm.x86.xsaveopt"]
+ fn xsaveopt(p: *mut u8, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xsavec"]
+ fn xsavec(p: *mut u8, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xsaves"]
+ fn xsaves(p: *mut u8, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xrstors"]
+ fn xrstors(p: *const u8, hi: u32, lo: u32);
+}
+
+/// Performs a full or partial save of the enabled processor states to memory at
+/// `mem_addr`.
+///
+/// State is saved based on bits `[62:0]` in `save_mask` and XCR0.
+/// `mem_addr` must be aligned on a 64-byte boundary.
+///
+/// The format of the XSAVE area is detailed in Section 13.4, “XSAVE Area,” of
+/// Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 1.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_xsave)
+#[inline]
+#[target_feature(enable = "xsave")]
+#[cfg_attr(test, assert_instr(xsave))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xsave(mem_addr: *mut u8, save_mask: u64) {
+ xsave(mem_addr, (save_mask >> 32) as u32, save_mask as u32);
+}
+
+/// Performs a full or partial restore of the enabled processor states using
+/// the state information stored in memory at `mem_addr`.
+///
+/// State is restored based on bits `[62:0]` in `rs_mask`, `XCR0`, and
+/// `mem_addr.HEADER.XSTATE_BV`. `mem_addr` must be aligned on a 64-byte
+/// boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_xrstor)
+#[inline]
+#[target_feature(enable = "xsave")]
+#[cfg_attr(test, assert_instr(xrstor))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xrstor(mem_addr: *const u8, rs_mask: u64) {
+ xrstor(mem_addr, (rs_mask >> 32) as u32, rs_mask as u32);
+}
+
+/// `XFEATURE_ENABLED_MASK` for `XCR`
+///
+/// This intrinsic maps to `XSETBV` instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub const _XCR_XFEATURE_ENABLED_MASK: u32 = 0;
+
+/// Copies 64-bits from `val` to the extended control register (`XCR`) specified
+/// by `a`.
+///
+/// Currently only `XFEATURE_ENABLED_MASK` `XCR` is supported.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_xsetbv)
+#[inline]
+#[target_feature(enable = "xsave")]
+#[cfg_attr(test, assert_instr(xsetbv))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xsetbv(a: u32, val: u64) {
+ xsetbv(a, (val >> 32) as u32, val as u32);
+}
+
+/// Reads the contents of the extended control register `XCR`
+/// specified in `xcr_no`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_xgetbv)
+#[inline]
+#[target_feature(enable = "xsave")]
+#[cfg_attr(test, assert_instr(xgetbv))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xgetbv(xcr_no: u32) -> u64 {
+ xgetbv(xcr_no) as u64
+}
+
+/// Performs a full or partial save of the enabled processor states to memory at
+/// `mem_addr`.
+///
+/// State is saved based on bits `[62:0]` in `save_mask` and `XCR0`.
+/// `mem_addr` must be aligned on a 64-byte boundary. The hardware may optimize
+/// the manner in which data is saved. The performance of this instruction will
+/// be equal to or better than using the `XSAVE` instruction.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_xsaveopt)
+#[inline]
+#[target_feature(enable = "xsave,xsaveopt")]
+#[cfg_attr(test, assert_instr(xsaveopt))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xsaveopt(mem_addr: *mut u8, save_mask: u64) {
+ xsaveopt(mem_addr, (save_mask >> 32) as u32, save_mask as u32);
+}
+
+/// Performs a full or partial save of the enabled processor states to memory
+/// at `mem_addr`.
+///
+/// `xsavec` differs from `xsave` in that it uses compaction and that it may
+/// use init optimization. State is saved based on bits `[62:0]` in `save_mask`
+/// and `XCR0`. `mem_addr` must be aligned on a 64-byte boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_xsavec)
+#[inline]
+#[target_feature(enable = "xsave,xsavec")]
+#[cfg_attr(test, assert_instr(xsavec))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xsavec(mem_addr: *mut u8, save_mask: u64) {
+ xsavec(mem_addr, (save_mask >> 32) as u32, save_mask as u32);
+}
+
+/// Performs a full or partial save of the enabled processor states to memory at
+/// `mem_addr`
+///
+/// `xsaves` differs from xsave in that it can save state components
+/// corresponding to bits set in `IA32_XSS` `MSR` and that it may use the
+/// modified optimization. State is saved based on bits `[62:0]` in `save_mask`
+/// and `XCR0`. `mem_addr` must be aligned on a 64-byte boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_xsaves)
+#[inline]
+#[target_feature(enable = "xsave,xsaves")]
+#[cfg_attr(test, assert_instr(xsaves))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xsaves(mem_addr: *mut u8, save_mask: u64) {
+ xsaves(mem_addr, (save_mask >> 32) as u32, save_mask as u32);
+}
+
+/// Performs a full or partial restore of the enabled processor states using the
+/// state information stored in memory at `mem_addr`.
+///
+/// `xrstors` differs from `xrstor` in that it can restore state components
+/// corresponding to bits set in the `IA32_XSS` `MSR`; `xrstors` cannot restore
+/// from an `xsave` area in which the extended region is in the standard form.
+/// State is restored based on bits `[62:0]` in `rs_mask`, `XCR0`, and
+/// `mem_addr.HEADER.XSTATE_BV`. `mem_addr` must be aligned on a 64-byte
+/// boundary.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_xrstors)
+#[inline]
+#[target_feature(enable = "xsave,xsaves")]
+#[cfg_attr(test, assert_instr(xrstors))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xrstors(mem_addr: *const u8, rs_mask: u64) {
+ xrstors(mem_addr, (rs_mask >> 32) as u32, rs_mask as u32);
+}
+
+#[cfg(test)]
+mod tests {
+ use std::{fmt, prelude::v1::*};
+
+ use crate::core_arch::x86::*;
+ use stdarch_test::simd_test;
+
+ #[repr(align(64))]
+ struct XsaveArea {
+ // max size for 256-bit registers is 800 bytes:
+ // see https://software.intel.com/en-us/node/682996
+ // max size for 512-bit registers is 2560 bytes:
+ // FIXME: add source
+ data: [u8; 2560],
+ }
+
+ impl XsaveArea {
+ fn new() -> XsaveArea {
+ XsaveArea { data: [0; 2560] }
+ }
+ fn ptr(&mut self) -> *mut u8 {
+ &mut self.data[0] as *mut _ as *mut u8
+ }
+ }
+
+ impl PartialEq<XsaveArea> for XsaveArea {
+ fn eq(&self, other: &XsaveArea) -> bool {
+ for i in 0..self.data.len() {
+ if self.data[i] != other.data[i] {
+ return false;
+ }
+ }
+ true
+ }
+ }
+
+ impl fmt::Debug for XsaveArea {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "[")?;
+ for i in 0..self.data.len() {
+ write!(f, "{}", self.data[i])?;
+ if i != self.data.len() - 1 {
+ write!(f, ", ")?;
+ }
+ }
+ write!(f, "]")
+ }
+ }
+
+ // FIXME: https://github.com/rust-lang/stdarch/issues/209
+ /*
+ #[simd_test(enable = "xsave")]
+ unsafe fn xsave() {
+ let m = 0xFFFFFFFFFFFFFFFF_u64; //< all registers
+ let mut a = XsaveArea::new();
+ let mut b = XsaveArea::new();
+
+ _xsave(a.ptr(), m);
+ _xrstor(a.ptr(), m);
+ _xsave(b.ptr(), m);
+ assert_eq!(a, b);
+ }
+ */
+
+ #[simd_test(enable = "xsave")]
+ unsafe fn xgetbv_xsetbv() {
+ let xcr_n: u32 = _XCR_XFEATURE_ENABLED_MASK;
+
+ let xcr: u64 = _xgetbv(xcr_n);
+ // FIXME: XSETBV is a privileged instruction we should only test this
+ // when running in privileged mode:
+ //
+ // _xsetbv(xcr_n, xcr);
+ let xcr_cpy: u64 = _xgetbv(xcr_n);
+ assert_eq!(xcr, xcr_cpy);
+ }
+
+ // FIXME: https://github.com/rust-lang/stdarch/issues/209
+ /*
+ #[simd_test(enable = "xsave,xsaveopt")]
+ unsafe fn xsaveopt() {
+ let m = 0xFFFFFFFFFFFFFFFF_u64; //< all registers
+ let mut a = XsaveArea::new();
+ let mut b = XsaveArea::new();
+
+ _xsaveopt(a.ptr(), m);
+ _xrstor(a.ptr(), m);
+ _xsaveopt(b.ptr(), m);
+ assert_eq!(a, b);
+ }
+ */
+
+ // FIXME: this looks like a bug in Intel's SDE:
+ #[cfg(not(stdarch_intel_sde))]
+ #[simd_test(enable = "xsave,xsavec")]
+ unsafe fn xsavec() {
+ let m = 0xFFFFFFFFFFFFFFFF_u64; //< all registers
+ let mut a = XsaveArea::new();
+ let mut b = XsaveArea::new();
+
+ _xsavec(a.ptr(), m);
+ _xrstor(a.ptr(), m);
+ _xsavec(b.ptr(), m);
+ assert_eq!(a, b);
+ }
+
+ // FIXME: https://github.com/rust-lang/stdarch/issues/209
+ /*
+ #[simd_test(enable = "xsave,xsaves")]
+ unsafe fn xsaves() {
+ let m = 0xFFFFFFFFFFFFFFFF_u64; //< all registers
+ let mut a = XsaveArea::new();
+ let mut b = XsaveArea::new();
+
+ _xsaves(a.ptr(), m);
+ _xrstors(a.ptr(), m);
+ _xsaves(b.ptr(), m);
+ assert_eq!(a, b);
+ }
+ */
+}